Add FirmwareUpdateManager.
This is a skeleton class for FirmwareUpdateManager, which will
handle all logic for the firmware update SWA.
Bug: 1252981
Test: N/A
Change-Id: I6531ac4a3c8d991169836ad8daaabc6bf0e6b455
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3230176
Commit-Queue: Anton Swifton <swifton@google.com>
Reviewed-by: Jimmy Gong <jimmyxgong@chromium.org>
Cr-Commit-Position: refs/heads/main@{#933072}
diff --git a/ash/BUILD.gn b/ash/BUILD.gn
index 8fb6dda..35e5fda 100644
--- a/ash/BUILD.gn
+++ b/ash/BUILD.gn
@@ -1952,6 +1952,7 @@
"//ash/assistant/ui:constants",
"//ash/assistant/util",
"//ash/components/audio",
+ "//ash/components/fwupd",
"//ash/components/pcie_peripheral",
"//ash/components/quick_answers",
"//ash/components/quick_answers/public/cpp:prefs",
diff --git a/ash/components/BUILD.gn b/ash/components/BUILD.gn
index c4d6fef..6aa3bc18 100644
--- a/ash/components/BUILD.gn
+++ b/ash/components/BUILD.gn
@@ -14,6 +14,7 @@
"//ash/components/audio:unit_tests",
"//ash/components/device_activity:unit_tests",
"//ash/components/drivefs:unit_tests",
+ "//ash/components/fwupd:unit_tests",
"//ash/components/geolocation:unit_tests",
"//ash/components/pcie_peripheral:unit_tests",
"//ash/components/power:unit_tests",
diff --git a/ash/components/fwupd/BUILD.gn b/ash/components/fwupd/BUILD.gn
new file mode 100644
index 0000000..c82d05a
--- /dev/null
+++ b/ash/components/fwupd/BUILD.gn
@@ -0,0 +1,29 @@
+# Copyright 2021 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/chromeos/ui_mode.gni")
+
+assert(is_chromeos_ash, "Non-Chrome-OS builds must not depend on //ash")
+
+component("fwupd") {
+ defines = [ "IS_ASH_FIRMWARE_UPDATE_MANAGER_IMPL" ]
+
+ deps = [ "//base:base" ]
+
+ sources = [
+ "firmware_update_manager.cc",
+ "firmware_update_manager.h",
+ ]
+}
+
+source_set("unit_tests") {
+ testonly = true
+
+ deps = [
+ ":fwupd",
+ "//testing/gtest",
+ ]
+
+ sources = [ "firmware_update_manager_unittest.cc" ]
+}
diff --git a/ash/components/fwupd/OWNERS b/ash/components/fwupd/OWNERS
new file mode 100644
index 0000000..cbaa826
--- /dev/null
+++ b/ash/components/fwupd/OWNERS
@@ -0,0 +1,2 @@
+jimmyxgong@chromium.org
+zentaro@chromium.org
\ No newline at end of file
diff --git a/ash/components/fwupd/firmware_update_manager.cc b/ash/components/fwupd/firmware_update_manager.cc
new file mode 100644
index 0000000..8d3e51b6
--- /dev/null
+++ b/ash/components/fwupd/firmware_update_manager.cc
@@ -0,0 +1,12 @@
+// Copyright 2021 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/components/fwupd/firmware_update_manager.h"
+
+namespace ash {
+
+FirmwareUpdateManager::FirmwareUpdateManager() {}
+FirmwareUpdateManager::~FirmwareUpdateManager() {}
+
+} // namespace ash
diff --git a/ash/components/fwupd/firmware_update_manager.h b/ash/components/fwupd/firmware_update_manager.h
new file mode 100644
index 0000000..1665a3f
--- /dev/null
+++ b/ash/components/fwupd/firmware_update_manager.h
@@ -0,0 +1,21 @@
+// Copyright 2021 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_COMPONENTS_FWUPD_FIRMWARE_UPDATE_MANAGER_H_
+#define ASH_COMPONENTS_FWUPD_FIRMWARE_UPDATE_MANAGER_H_
+
+#include "base/component_export.h"
+
+namespace ash {
+// FirmwareUpdateManager contains all logic that runs the firmware update SWA.
+class COMPONENT_EXPORT(ASH_FIRMWARE_UPDATE_MANAGER) FirmwareUpdateManager {
+ public:
+ FirmwareUpdateManager();
+ FirmwareUpdateManager(const FirmwareUpdateManager&) = delete;
+ FirmwareUpdateManager& operator=(const FirmwareUpdateManager&) = delete;
+ ~FirmwareUpdateManager();
+};
+} // namespace ash
+
+#endif // ASH_COMPONENTS_FWUPD_FIRMWARE_UPDATE_MANAGER_H_
diff --git a/ash/components/fwupd/firmware_update_manager_unittest.cc b/ash/components/fwupd/firmware_update_manager_unittest.cc
new file mode 100644
index 0000000..67e26ed1
--- /dev/null
+++ b/ash/components/fwupd/firmware_update_manager_unittest.cc
@@ -0,0 +1,20 @@
+// Copyright 2021 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/components/fwupd/firmware_update_manager.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace ash {
+
+class FirmwareUpdateManagerTest : public testing::Test {
+ public:
+ FirmwareUpdateManagerTest() {}
+ FirmwareUpdateManagerTest(const FirmwareUpdateManagerTest&) = delete;
+ FirmwareUpdateManagerTest& operator=(const FirmwareUpdateManagerTest&) =
+ delete;
+ ~FirmwareUpdateManagerTest() override = default;
+};
+
+} // namespace ash