| 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 CHROME_BROWSER_COMPONENT_UPDATER_CLD_COMPONENT_INSTALLER_H_ | 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_CLD_COMPONENT_INSTALLER_H_ |
| 6 #define CHROME_BROWSER_COMPONENT_UPDATER_CLD_COMPONENT_INSTALLER_H_ | 6 #define CHROME_BROWSER_COMPONENT_UPDATER_CLD_COMPONENT_INSTALLER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 8 #include <string> | 9 #include <string> |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 12 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/macros.h" |
| 13 #include "components/component_updater/default_component_installer.h" | 15 #include "components/component_updater/default_component_installer.h" |
| 14 | 16 |
| 15 namespace test { | 17 namespace test { |
| 16 class ComponentCldDataHarness; | 18 class ComponentCldDataHarness; |
| 17 } // namespace test | 19 } // namespace test |
| 18 | 20 |
| 19 namespace component_updater { | 21 namespace component_updater { |
| 20 | 22 |
| 21 class ComponentUpdateService; | 23 class ComponentUpdateService; |
| 22 | 24 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 42 virtual bool CanAutoUpdate() const OVERRIDE; | 44 virtual bool CanAutoUpdate() const OVERRIDE; |
| 43 virtual bool OnCustomInstall(const base::DictionaryValue& manifest, | 45 virtual bool OnCustomInstall(const base::DictionaryValue& manifest, |
| 44 const base::FilePath& install_dir) OVERRIDE; | 46 const base::FilePath& install_dir) OVERRIDE; |
| 45 virtual bool VerifyInstallation( | 47 virtual bool VerifyInstallation( |
| 46 const base::FilePath& install_dir) const OVERRIDE; | 48 const base::FilePath& install_dir) const OVERRIDE; |
| 47 virtual void ComponentReady( | 49 virtual void ComponentReady( |
| 48 const base::Version& version, | 50 const base::Version& version, |
| 49 const base::FilePath& path, | 51 const base::FilePath& path, |
| 50 scoped_ptr<base::DictionaryValue> manifest) OVERRIDE; | 52 scoped_ptr<base::DictionaryValue> manifest) OVERRIDE; |
| 51 virtual base::FilePath GetBaseDirectory() const OVERRIDE; | 53 virtual base::FilePath GetBaseDirectory() const OVERRIDE; |
| 52 virtual void GetHash(std::vector<uint8>* hash) const OVERRIDE; | 54 virtual void GetHash(std::vector<uint8_t>* hash) const OVERRIDE; |
| 53 virtual std::string GetName() const OVERRIDE; | 55 virtual std::string GetName() const OVERRIDE; |
| 54 | 56 |
| 55 static base::FilePath GetInstalledPath(const base::FilePath& base); | 57 static base::FilePath GetInstalledPath(const base::FilePath& base); |
| 56 | 58 |
| 57 // Sets the path to the CLD data file. Called internally once a valid CLD | 59 // Sets the path to the CLD data file. Called internally once a valid CLD |
| 58 // data file has been observed. The implementation of this method is | 60 // data file has been observed. The implementation of this method is |
| 59 // responsible for configuring the CLD data source. | 61 // responsible for configuring the CLD data source. |
| 60 // This method is threadsafe. | 62 // This method is threadsafe. |
| 61 static void SetLatestCldDataFile(const base::FilePath& path); | 63 static void SetLatestCldDataFile(const base::FilePath& path); |
| 62 | 64 |
| 63 // Returns the file path that was most recently set in SetLatestCldDataFile. | 65 // Returns the file path that was most recently set in SetLatestCldDataFile. |
| 64 static base::FilePath GetLatestCldDataFile(); | 66 static base::FilePath GetLatestCldDataFile(); |
| 65 | 67 |
| 66 DISALLOW_COPY_AND_ASSIGN(CldComponentInstallerTraits); | 68 DISALLOW_COPY_AND_ASSIGN(CldComponentInstallerTraits); |
| 67 }; | 69 }; |
| 68 | 70 |
| 69 // Call once during startup to make the component update service aware of | 71 // Call once during startup to make the component update service aware of |
| 70 // the CLD component. | 72 // the CLD component. |
| 71 void RegisterCldComponent(ComponentUpdateService* cus); | 73 void RegisterCldComponent(ComponentUpdateService* cus); |
| 72 | 74 |
| 73 } // namespace component_updater | 75 } // namespace component_updater |
| 74 | 76 |
| 75 #endif // CHROME_BROWSER_COMPONENT_UPDATER_CLD_COMPONENT_INSTALLER_H_ | 77 #endif // CHROME_BROWSER_COMPONENT_UPDATER_CLD_COMPONENT_INSTALLER_H_ |
| OLD | NEW |