OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_ | 5 #ifndef COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_ |
6 #define COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_ | 6 #define COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // Registers the component for update checks and installs. | 92 // Registers the component for update checks and installs. |
93 void Register(ComponentUpdateService* cus); | 93 void Register(ComponentUpdateService* cus); |
94 | 94 |
95 // Overridden from ComponentInstaller: | 95 // Overridden from ComponentInstaller: |
96 void OnUpdateError(int error) override; | 96 void OnUpdateError(int error) override; |
97 bool Install(const base::DictionaryValue& manifest, | 97 bool Install(const base::DictionaryValue& manifest, |
98 const base::FilePath& unpack_path) override; | 98 const base::FilePath& unpack_path) override; |
99 bool GetInstalledFile(const std::string& file, | 99 bool GetInstalledFile(const std::string& file, |
100 base::FilePath* installed_file) override; | 100 base::FilePath* installed_file) override; |
101 | 101 |
| 102 private: |
102 ~DefaultComponentInstaller() override; | 103 ~DefaultComponentInstaller() override; |
103 | 104 |
104 private: | |
105 base::FilePath GetInstallDirectory(); | 105 base::FilePath GetInstallDirectory(); |
106 bool InstallHelper(const base::DictionaryValue& manifest, | 106 bool InstallHelper(const base::DictionaryValue& manifest, |
107 const base::FilePath& unpack_path, | 107 const base::FilePath& unpack_path, |
108 const base::FilePath& install_path); | 108 const base::FilePath& install_path); |
109 void StartRegistration(ComponentUpdateService* cus); | 109 void StartRegistration(ComponentUpdateService* cus); |
110 void FinishRegistration(ComponentUpdateService* cus); | 110 void FinishRegistration(ComponentUpdateService* cus); |
| 111 void ComponentReady(scoped_ptr<base::DictionaryValue> manifest); |
111 | 112 |
112 base::Version current_version_; | 113 base::Version current_version_; |
113 std::string current_fingerprint_; | 114 std::string current_fingerprint_; |
114 scoped_ptr<base::DictionaryValue> current_manifest_; | 115 scoped_ptr<base::DictionaryValue> current_manifest_; |
115 scoped_ptr<ComponentInstallerTraits> installer_traits_; | 116 scoped_ptr<ComponentInstallerTraits> installer_traits_; |
116 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 117 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
117 | 118 |
118 // Used to post responses back to the main thread. Initialized on the main | 119 // Used to post responses back to the main thread. Initialized on the main |
119 // loop but accessed from the task runner. | 120 // loop but accessed from the task runner. |
120 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 121 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
121 | 122 |
122 base::ThreadChecker thread_checker_; | 123 base::ThreadChecker thread_checker_; |
123 | 124 |
124 DISALLOW_COPY_AND_ASSIGN(DefaultComponentInstaller); | 125 DISALLOW_COPY_AND_ASSIGN(DefaultComponentInstaller); |
125 }; | 126 }; |
126 | 127 |
127 } // namespace component_updater | 128 } // namespace component_updater |
128 | 129 |
129 #endif // COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_ | 130 #endif // COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_ |
OLD | NEW |