| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // Only user-level component installations can be uninstalled. | 115 // Only user-level component installations can be uninstalled. |
| 116 bool Uninstall() override; | 116 bool Uninstall() override; |
| 117 | 117 |
| 118 private: | 118 private: |
| 119 ~DefaultComponentInstaller() override; | 119 ~DefaultComponentInstaller() override; |
| 120 | 120 |
| 121 // If there is a installation of the component set up alongside Chrome's | 121 // If there is a installation of the component set up alongside Chrome's |
| 122 // files (as opposed to in the user data directory), sets current_* to the | 122 // files (as opposed to in the user data directory), sets current_* to the |
| 123 // values associated with that installation and returns true; otherwise, | 123 // values associated with that installation and returns true; otherwise, |
| 124 // returns false. | 124 // returns false. |
| 125 bool FindPreinstallation(); | 125 bool FindPreinstallation(const base::FilePath& root); |
| 126 bool InstallHelper(const base::DictionaryValue& manifest, | 126 bool InstallHelper(const base::DictionaryValue& manifest, |
| 127 const base::FilePath& unpack_path, | 127 const base::FilePath& unpack_path, |
| 128 const base::FilePath& install_path); | 128 const base::FilePath& install_path); |
| 129 void StartRegistration(ComponentUpdateService* cus); | 129 void StartRegistration(ComponentUpdateService* cus); |
| 130 void FinishRegistration(ComponentUpdateService* cus, | 130 void FinishRegistration(ComponentUpdateService* cus, |
| 131 const base::Closure& callback); | 131 const base::Closure& callback); |
| 132 void ComponentReady(std::unique_ptr<base::DictionaryValue> manifest); | 132 void ComponentReady(std::unique_ptr<base::DictionaryValue> manifest); |
| 133 void UninstallOnTaskRunner(); | 133 void UninstallOnTaskRunner(); |
| 134 | 134 |
| 135 base::FilePath current_install_dir_; | 135 base::FilePath current_install_dir_; |
| 136 base::Version current_version_; | 136 base::Version current_version_; |
| 137 std::string current_fingerprint_; | 137 std::string current_fingerprint_; |
| 138 std::unique_ptr<base::DictionaryValue> current_manifest_; | 138 std::unique_ptr<base::DictionaryValue> current_manifest_; |
| 139 std::unique_ptr<ComponentInstallerTraits> installer_traits_; | 139 std::unique_ptr<ComponentInstallerTraits> installer_traits_; |
| 140 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 140 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
| 141 | 141 |
| 142 // Used to post responses back to the main thread. Initialized on the main | 142 // Used to post responses back to the main thread. Initialized on the main |
| 143 // loop but accessed from the task runner. | 143 // loop but accessed from the task runner. |
| 144 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 144 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
| 145 | 145 |
| 146 base::ThreadChecker thread_checker_; | 146 base::ThreadChecker thread_checker_; |
| 147 | 147 |
| 148 DISALLOW_COPY_AND_ASSIGN(DefaultComponentInstaller); | 148 DISALLOW_COPY_AND_ASSIGN(DefaultComponentInstaller); |
| 149 }; | 149 }; |
| 150 | 150 |
| 151 } // namespace component_updater | 151 } // namespace component_updater |
| 152 | 152 |
| 153 #endif // COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_ | 153 #endif // COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_ |
| OLD | NEW |