Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(718)

Side by Side Diff: chrome/browser/component_updater/cros_component_installer.h

Issue 2707063002: Universial component install for chrome os. (Closed)
Patch Set: fix a bug Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_CROS_COMPONENT_INSTALLER_H_
5 #define CHROME_BROWSER_COMPONENT_UPDATER_CROS_COMPONENT_INSTALLER_H_
6
7 #include "base/base_paths.h"
8 #include "base/bind.h"
9 #include "base/command_line.h"
10 #include "base/files/file_enumerator.h"
11 #include "base/files/file_path.h"
12 #include "base/files/file_util.h"
13 #include "base/json/json_reader.h"
14 #include "base/logging.h"
15 #include "base/memory/ptr_util.h"
16 #include "base/path_service.h"
17 #include "base/stl_util.h"
18 #include "base/strings/string_util.h"
19 #include "base/strings/stringprintf.h"
20 #include "base/strings/utf_string_conversions.h"
21 #include "base/version.h"
22 #include "build/build_config.h"
23 #include "chrome/browser/browser_process.h"
24 #include "chrome/browser/component_updater/component_installer_errors.h"
25 #include "chrome/browser/component_updater/cros_component_installer.h"
26 #include "chrome/browser/plugins/plugin_prefs.h"
27 #include "chrome/common/chrome_constants.h"
28 #include "chrome/common/chrome_content_client.h"
29 #include "chrome/common/chrome_paths.h"
30 #include "chrome/common/chrome_switches.h"
31 #include "components/component_updater/component_updater_service.h"
32 #include "components/component_updater/default_component_installer.h"
33 #include "components/update_client/update_client.h"
34 #include "components/update_client/update_client_errors.h"
35 #include "content/public/browser/browser_thread.h"
36 #include "content/public/browser/plugin_service.h"
37 #include "content/public/common/content_constants.h"
38 #include "crypto/sha2.h"
39 #include "third_party/libxml/chromium/libxml_utils.h"
40
41 #if defined(OS_CHROMEOS)
42 #include "chrome/browser/chromeos/settings/cros_settings.h"
43 #include "chrome/browser/ui/ash/system_tray_client.h"
44 #include "chrome/common/chrome_features.h"
45 #include "chromeos/dbus/dbus_method_call_status.h"
46 #include "chromeos/dbus/dbus_thread_manager.h"
47 #include "chromeos/dbus/image_loader_client.h"
48 #include "content/public/browser/browser_thread.h"
49 #elif defined(OS_LINUX)
50 #include "chrome/common/component_flash_hint_file_linux.h"
51 #endif // defined(OS_CHROMEOS)
52
53 namespace component_updater {
54
55 static const char filepathstr[] = "/etc/cros_component.config";
56
57 class ComponentUpdateService;
58
59 struct ComponentConfig {
60 std::string name;
61 std::string dir;
62 std::string sha2hashstr;
63 };
64 class CrOSComponentInstallerTraits : public ComponentInstallerTraits {
65 public:
66 CrOSComponentInstallerTraits(std::string dir_name,
67 std::string name,
68 std::string sha2HashStr);
69 ~CrOSComponentInstallerTraits() override {}
70
71 private:
72 // The following methods override ComponentInstallerTraits.
73 bool SupportsGroupPolicyEnabledComponentUpdates() const override;
74 bool RequiresNetworkEncryption() const override;
75 update_client::CrxInstaller::Result OnCustomInstall(
76 const base::DictionaryValue& manifest,
77 const base::FilePath& install_dir) override;
78 bool VerifyInstallation(const base::DictionaryValue& manifest,
79 const base::FilePath& install_dir) const override;
80 void ComponentReady(const base::Version& version,
81 const base::FilePath& path,
82 std::unique_ptr<base::DictionaryValue> manifest) override;
83 base::FilePath GetRelativeInstallDir() const override;
84 void GetHash(std::vector<uint8_t>* hash) const override;
85 std::string GetName() const override;
86 update_client::InstallerAttributes GetInstallerAttributes() const override;
87 std::vector<std::string> GetMimeTypes() const override;
88 std::string dir_name;
89 std::string name;
90 uint8_t kSha2Hash_[crypto::kSHA256Length] = {};
91
92 DISALLOW_COPY_AND_ASSIGN(CrOSComponentInstallerTraits);
93 };
94
95 void RegisterCrOSComponent(ComponentUpdateService* cus,
96 ComponentConfig& config);
97 bool RegisterCrOSComponent(ComponentUpdateService* cus, std::string name);
98
99 } // namespace component_updater
100
101 #endif // CHROME_BROWSER_COMPONENT_UPDATER_CROS_COMPONENT_INSTALLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698