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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // to the constructor. | 84 // to the constructor. |
85 class DefaultComponentInstaller : public ComponentInstaller { | 85 class DefaultComponentInstaller : public ComponentInstaller { |
86 public: | 86 public: |
87 DefaultComponentInstaller( | 87 DefaultComponentInstaller( |
88 scoped_ptr<ComponentInstallerTraits> installer_traits); | 88 scoped_ptr<ComponentInstallerTraits> installer_traits); |
89 | 89 |
90 // Registers the component for update checks and installs. | 90 // Registers the component for update checks and installs. |
91 void Register(ComponentUpdateService* cus); | 91 void Register(ComponentUpdateService* cus); |
92 | 92 |
93 // Overridden from ComponentInstaller: | 93 // Overridden from ComponentInstaller: |
94 virtual void OnUpdateError(int error) OVERRIDE; | 94 virtual void OnUpdateError(int error) override; |
95 virtual bool Install(const base::DictionaryValue& manifest, | 95 virtual bool Install(const base::DictionaryValue& manifest, |
96 const base::FilePath& unpack_path) OVERRIDE; | 96 const base::FilePath& unpack_path) override; |
97 virtual bool GetInstalledFile(const std::string& file, | 97 virtual bool GetInstalledFile(const std::string& file, |
98 base::FilePath* installed_file) OVERRIDE; | 98 base::FilePath* installed_file) override; |
99 | 99 |
100 virtual ~DefaultComponentInstaller(); | 100 virtual ~DefaultComponentInstaller(); |
101 | 101 |
102 private: | 102 private: |
103 base::FilePath GetInstallDirectory(); | 103 base::FilePath GetInstallDirectory(); |
104 bool InstallHelper(const base::DictionaryValue& manifest, | 104 bool InstallHelper(const base::DictionaryValue& manifest, |
105 const base::FilePath& unpack_path, | 105 const base::FilePath& unpack_path, |
106 const base::FilePath& install_path); | 106 const base::FilePath& install_path); |
107 void StartRegistration(ComponentUpdateService* cus); | 107 void StartRegistration(ComponentUpdateService* cus); |
108 void FinishRegistration(ComponentUpdateService* cus); | 108 void FinishRegistration(ComponentUpdateService* cus); |
109 | 109 |
110 base::Version current_version_; | 110 base::Version current_version_; |
111 std::string current_fingerprint_; | 111 std::string current_fingerprint_; |
112 scoped_ptr<base::DictionaryValue> current_manifest_; | 112 scoped_ptr<base::DictionaryValue> current_manifest_; |
113 scoped_ptr<ComponentInstallerTraits> installer_traits_; | 113 scoped_ptr<ComponentInstallerTraits> installer_traits_; |
114 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 114 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
115 | 115 |
116 // Used to post responses back to the main thread. Initialized on the main | 116 // Used to post responses back to the main thread. Initialized on the main |
117 // loop but accessed from the task runner. | 117 // loop but accessed from the task runner. |
118 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 118 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
119 | 119 |
120 base::ThreadChecker thread_checker_; | 120 base::ThreadChecker thread_checker_; |
121 | 121 |
122 DISALLOW_COPY_AND_ASSIGN(DefaultComponentInstaller); | 122 DISALLOW_COPY_AND_ASSIGN(DefaultComponentInstaller); |
123 }; | 123 }; |
124 | 124 |
125 } // namespace component_updater | 125 } // namespace component_updater |
126 | 126 |
127 #endif // COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_ | 127 #endif // COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_ |
OLD | NEW |