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 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
117 // Overridden from ComponentInstaller: | 117 // Overridden from ComponentInstaller: |
118 void OnUpdateError(int error) override; | 118 void OnUpdateError(int error) override; |
119 update_client::CrxInstaller::Result Install( | 119 update_client::CrxInstaller::Result Install( |
120 const base::DictionaryValue& manifest, | 120 const base::DictionaryValue& manifest, |
121 const base::FilePath& unpack_path) override; | 121 const base::FilePath& unpack_path) override; |
122 bool GetInstalledFile(const std::string& file, | 122 bool GetInstalledFile(const std::string& file, |
123 base::FilePath* installed_file) override; | 123 base::FilePath* installed_file) override; |
124 // Only user-level component installations can be uninstalled. | 124 // Only user-level component installations can be uninstalled. |
125 bool Uninstall() override; | 125 bool Uninstall() override; |
126 | 126 |
127 protected: | |
128 ~DefaultComponentInstaller() override; | |
129 std::unique_ptr<base::DictionaryValue> current_manifest_; | |
sky
2017/05/24 16:47:20
Style guide says no protected members.
xiaochu
2017/05/24 19:56:54
Done.
| |
130 | |
127 private: | 131 private: |
128 ~DefaultComponentInstaller() override; | |
129 | |
130 // If there is a installation of the component set up alongside Chrome's | 132 // If there is a installation of the component set up alongside Chrome's |
131 // files (as opposed to in the user data directory), sets current_* to the | 133 // files (as opposed to in the user data directory), sets current_* to the |
132 // values associated with that installation and returns true; otherwise, | 134 // values associated with that installation and returns true; otherwise, |
133 // returns false. | 135 // returns false. |
134 bool FindPreinstallation(const base::FilePath& root); | 136 bool FindPreinstallation(const base::FilePath& root); |
135 update_client::CrxInstaller::Result InstallHelper( | 137 update_client::CrxInstaller::Result InstallHelper( |
136 const base::DictionaryValue& manifest, | 138 const base::DictionaryValue& manifest, |
137 const base::FilePath& unpack_path, | 139 const base::FilePath& unpack_path, |
138 const base::FilePath& install_path); | 140 const base::FilePath& install_path); |
139 void StartRegistration(ComponentUpdateService* cus); | 141 void StartRegistration(ComponentUpdateService* cus); |
140 void FinishRegistration(ComponentUpdateService* cus, | 142 void FinishRegistration(ComponentUpdateService* cus, |
141 const base::Closure& callback); | 143 const base::Closure& callback); |
142 void ComponentReady(std::unique_ptr<base::DictionaryValue> manifest); | 144 void ComponentReady(std::unique_ptr<base::DictionaryValue> manifest); |
143 void UninstallOnTaskRunner(); | 145 void UninstallOnTaskRunner(); |
144 | 146 |
145 base::FilePath current_install_dir_; | 147 base::FilePath current_install_dir_; |
146 base::Version current_version_; | 148 base::Version current_version_; |
147 std::string current_fingerprint_; | 149 std::string current_fingerprint_; |
148 std::unique_ptr<base::DictionaryValue> current_manifest_; | |
149 std::unique_ptr<ComponentInstallerTraits> installer_traits_; | 150 std::unique_ptr<ComponentInstallerTraits> installer_traits_; |
150 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 151 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
151 | 152 |
152 // Used to post responses back to the main thread. Initialized on the main | 153 // Used to post responses back to the main thread. Initialized on the main |
153 // loop but accessed from the task runner. | 154 // loop but accessed from the task runner. |
154 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 155 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
155 | 156 |
156 base::ThreadChecker thread_checker_; | 157 base::ThreadChecker thread_checker_; |
157 | 158 |
158 DISALLOW_COPY_AND_ASSIGN(DefaultComponentInstaller); | 159 DISALLOW_COPY_AND_ASSIGN(DefaultComponentInstaller); |
159 }; | 160 }; |
160 | 161 |
161 } // namespace component_updater | 162 } // namespace component_updater |
162 | 163 |
163 #endif // COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_ | 164 #endif // COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_ |
OLD | NEW |