Index: chrome/browser/component_updater/cros_component_installer.h |
diff --git a/chrome/browser/component_updater/cros_component_installer.h b/chrome/browser/component_updater/cros_component_installer.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..60d90cf1e9fbf07a4a5159fcbf86df47bac9e689 |
--- /dev/null |
+++ b/chrome/browser/component_updater/cros_component_installer.h |
@@ -0,0 +1,101 @@ |
+// Copyright (c) 2012 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 CHROME_BROWSER_COMPONENT_UPDATER_CROS_COMPONENT_INSTALLER_H_ |
+#define CHROME_BROWSER_COMPONENT_UPDATER_CROS_COMPONENT_INSTALLER_H_ |
+ |
+#include "base/base_paths.h" |
+#include "base/bind.h" |
+#include "base/command_line.h" |
+#include "base/files/file_enumerator.h" |
+#include "base/files/file_path.h" |
+#include "base/files/file_util.h" |
+#include "base/json/json_reader.h" |
+#include "base/logging.h" |
+#include "base/memory/ptr_util.h" |
+#include "base/path_service.h" |
+#include "base/stl_util.h" |
+#include "base/strings/string_util.h" |
+#include "base/strings/stringprintf.h" |
+#include "base/strings/utf_string_conversions.h" |
+#include "base/version.h" |
+#include "build/build_config.h" |
+#include "chrome/browser/browser_process.h" |
+#include "chrome/browser/component_updater/component_installer_errors.h" |
+#include "chrome/browser/component_updater/cros_component_installer.h" |
+#include "chrome/browser/plugins/plugin_prefs.h" |
+#include "chrome/common/chrome_constants.h" |
+#include "chrome/common/chrome_content_client.h" |
+#include "chrome/common/chrome_paths.h" |
+#include "chrome/common/chrome_switches.h" |
+#include "components/component_updater/component_updater_service.h" |
+#include "components/component_updater/default_component_installer.h" |
+#include "components/update_client/update_client.h" |
+#include "components/update_client/update_client_errors.h" |
+#include "content/public/browser/browser_thread.h" |
+#include "content/public/browser/plugin_service.h" |
+#include "content/public/common/content_constants.h" |
+#include "crypto/sha2.h" |
+#include "third_party/libxml/chromium/libxml_utils.h" |
+ |
+#if defined(OS_CHROMEOS) |
+#include "chrome/browser/chromeos/settings/cros_settings.h" |
+#include "chrome/browser/ui/ash/system_tray_client.h" |
+#include "chrome/common/chrome_features.h" |
+#include "chromeos/dbus/dbus_method_call_status.h" |
+#include "chromeos/dbus/dbus_thread_manager.h" |
+#include "chromeos/dbus/image_loader_client.h" |
+#include "content/public/browser/browser_thread.h" |
+#elif defined(OS_LINUX) |
+#include "chrome/common/component_flash_hint_file_linux.h" |
+#endif // defined(OS_CHROMEOS) |
+ |
+namespace component_updater { |
+ |
+static const char filepathstr[] = "/etc/cros_component.config"; |
+ |
+class ComponentUpdateService; |
+ |
+struct ComponentConfig { |
+ std::string name; |
+ std::string dir; |
+ std::string sha2hashstr; |
+}; |
+class CrOSComponentInstallerTraits : public ComponentInstallerTraits { |
+ public: |
+ CrOSComponentInstallerTraits(std::string dir_name, |
+ std::string name, |
+ std::string sha2HashStr); |
+ ~CrOSComponentInstallerTraits() override {} |
+ |
+ private: |
+ // The following methods override ComponentInstallerTraits. |
+ bool SupportsGroupPolicyEnabledComponentUpdates() const override; |
+ bool RequiresNetworkEncryption() const override; |
+ update_client::CrxInstaller::Result OnCustomInstall( |
+ const base::DictionaryValue& manifest, |
+ const base::FilePath& install_dir) override; |
+ bool VerifyInstallation(const base::DictionaryValue& manifest, |
+ const base::FilePath& install_dir) const override; |
+ void ComponentReady(const base::Version& version, |
+ const base::FilePath& path, |
+ std::unique_ptr<base::DictionaryValue> manifest) override; |
+ base::FilePath GetRelativeInstallDir() const override; |
+ void GetHash(std::vector<uint8_t>* hash) const override; |
+ std::string GetName() const override; |
+ update_client::InstallerAttributes GetInstallerAttributes() const override; |
+ std::vector<std::string> GetMimeTypes() const override; |
+ std::string dir_name; |
+ std::string name; |
+ uint8_t kSha2Hash_[crypto::kSHA256Length] = {}; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(CrOSComponentInstallerTraits); |
+}; |
+ |
+void RegisterCrOSComponent(ComponentUpdateService* cus, |
+ ComponentConfig& config); |
+bool RegisterCrOSComponent(ComponentUpdateService* cus, std::string name); |
+ |
+} // namespace component_updater |
+ |
+#endif // CHROME_BROWSER_COMPONENT_UPDATER_CROS_COMPONENT_INSTALLER_H_ |