OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_CROS_COMPONENT_INSTALLER_H_ | 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_CROS_COMPONENT_INSTALLER_H_ |
6 #define CHROME_BROWSER_COMPONENT_UPDATER_CROS_COMPONENT_INSTALLER_H_ | 6 #define CHROME_BROWSER_COMPONENT_UPDATER_CROS_COMPONENT_INSTALLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 std::string GetName() const override; | 50 std::string GetName() const override; |
51 update_client::InstallerAttributes GetInstallerAttributes() const override; | 51 update_client::InstallerAttributes GetInstallerAttributes() const override; |
52 std::vector<std::string> GetMimeTypes() const override; | 52 std::vector<std::string> GetMimeTypes() const override; |
53 std::string name; | 53 std::string name; |
54 std::string env_version; | 54 std::string env_version; |
55 uint8_t kSha2Hash_[crypto::kSHA256Length] = {}; | 55 uint8_t kSha2Hash_[crypto::kSHA256Length] = {}; |
56 | 56 |
57 DISALLOW_COPY_AND_ASSIGN(CrOSComponentInstallerTraits); | 57 DISALLOW_COPY_AND_ASSIGN(CrOSComponentInstallerTraits); |
58 }; | 58 }; |
59 | 59 |
| 60 class CrOSComponentInstaller |
| 61 : public component_updater::DefaultComponentInstaller { |
| 62 public: |
| 63 CrOSComponentInstaller( |
| 64 std::unique_ptr<ComponentInstallerTraits> installer_traits); |
| 65 std::unique_ptr<base::DictionaryValue> GetCurrentManifest(); |
| 66 |
| 67 private: |
| 68 ~CrOSComponentInstaller() override; |
| 69 }; |
| 70 |
60 // This class contains functions used to register and install a component. | 71 // This class contains functions used to register and install a component. |
61 class CrOSComponent { | 72 class CrOSComponent { |
62 public: | 73 public: |
63 // Register and start installing a CrOS component. | 74 // Register and start installing a CrOS component. |
64 // |install_callback| is triggered after install finishes and returns error | 75 // |install_callback| is triggered after install finishes and returns error |
65 // code. | 76 // code. |
66 // | 77 // |
67 // example: | 78 // example: |
68 // ... | 79 // ... |
69 // void load_callback(const std::string& result){ | 80 // void load_callback(const std::string& result){ |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 static void InstallChromeOSComponent( | 126 static void InstallChromeOSComponent( |
116 ComponentUpdateService* cus, | 127 ComponentUpdateService* cus, |
117 const std::string& id, | 128 const std::string& id, |
118 const update_client::Callback& install_callback); | 129 const update_client::Callback& install_callback); |
119 }; | 130 }; |
120 #endif // defined(OS_CHROMEOS) | 131 #endif // defined(OS_CHROMEOS) |
121 | 132 |
122 } // namespace component_updater | 133 } // namespace component_updater |
123 | 134 |
124 #endif // CHROME_BROWSER_COMPONENT_UPDATER_CROS_COMPONENT_INSTALLER_H_ | 135 #endif // CHROME_BROWSER_COMPONENT_UPDATER_CROS_COMPONENT_INSTALLER_H_ |
OLD | NEW |