| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PNACL_COMPONENT_INSTALLER_H_ | 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_PNACL_COMPONENT_INSTALLER_H_ |
| 6 #define CHROME_BROWSER_COMPONENT_UPDATER_PNACL_COMPONENT_INSTALLER_H_ | 6 #define CHROME_BROWSER_COMPONENT_UPDATER_PNACL_COMPONENT_INSTALLER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 // Component installer responsible for Portable Native Client files. | 37 // Component installer responsible for Portable Native Client files. |
| 38 // Files can be installed to a shared location, or be installed to | 38 // Files can be installed to a shared location, or be installed to |
| 39 // a per-user location. | 39 // a per-user location. |
| 40 class PnaclComponentInstaller : public update_client::CrxInstaller { | 40 class PnaclComponentInstaller : public update_client::CrxInstaller { |
| 41 public: | 41 public: |
| 42 PnaclComponentInstaller(); | 42 PnaclComponentInstaller(); |
| 43 | 43 |
| 44 // ComponentInstaller implementation: | 44 // ComponentInstaller implementation: |
| 45 void OnUpdateError(int error) override; | 45 void OnUpdateError(int error) override; |
| 46 bool Install(const base::DictionaryValue& manifest, | 46 update_client::CrxInstaller::Result Install( |
| 47 const base::FilePath& unpack_path) override; | 47 const base::DictionaryValue& manifest, |
| 48 const base::FilePath& unpack_path) override; |
| 48 bool GetInstalledFile(const std::string& file, | 49 bool GetInstalledFile(const std::string& file, |
| 49 base::FilePath* installed_file) override; | 50 base::FilePath* installed_file) override; |
| 50 bool Uninstall() override; | 51 bool Uninstall() override; |
| 51 | 52 |
| 52 // Register a PNaCl component for the first time. | 53 // Register a PNaCl component for the first time. |
| 53 void RegisterPnaclComponent(ComponentUpdateService* cus); | 54 void RegisterPnaclComponent(ComponentUpdateService* cus); |
| 54 | 55 |
| 55 update_client::CrxComponent GetCrxComponent(); | 56 update_client::CrxComponent GetCrxComponent(); |
| 56 | 57 |
| 57 // Determine the base directory for storing each version of PNaCl. | 58 // Determine the base directory for storing each version of PNaCl. |
| 58 base::FilePath GetPnaclBaseDirectory(); | 59 base::FilePath GetPnaclBaseDirectory(); |
| 59 | 60 |
| 60 base::Version current_version() const { return current_version_; } | 61 base::Version current_version() const { return current_version_; } |
| 61 | 62 |
| 62 void set_current_version(const base::Version& current_version) { | 63 void set_current_version(const base::Version& current_version) { |
| 63 current_version_ = current_version; | 64 current_version_ = current_version; |
| 64 } | 65 } |
| 65 | 66 |
| 66 std::string current_fingerprint() const { return current_fingerprint_; } | 67 std::string current_fingerprint() const { return current_fingerprint_; } |
| 67 | 68 |
| 68 void set_current_fingerprint(const std::string& current_fingerprint) { | 69 void set_current_fingerprint(const std::string& current_fingerprint) { |
| 69 current_fingerprint_ = current_fingerprint; | 70 current_fingerprint_ = current_fingerprint; |
| 70 } | 71 } |
| 71 | 72 |
| 72 ComponentUpdateService* cus() const { return cus_; } | 73 ComponentUpdateService* cus() const { return cus_; } |
| 73 | 74 |
| 74 private: | 75 private: |
| 75 ~PnaclComponentInstaller() override; | 76 ~PnaclComponentInstaller() override; |
| 76 | 77 |
| 78 bool DoInstall(const base::DictionaryValue& manifest, |
| 79 const base::FilePath& unpack_path); |
| 80 |
| 77 base::Version current_version_; | 81 base::Version current_version_; |
| 78 std::string current_fingerprint_; | 82 std::string current_fingerprint_; |
| 79 ComponentUpdateService* cus_; | 83 ComponentUpdateService* cus_; |
| 80 | 84 |
| 81 DISALLOW_COPY_AND_ASSIGN(PnaclComponentInstaller); | 85 DISALLOW_COPY_AND_ASSIGN(PnaclComponentInstaller); |
| 82 }; | 86 }; |
| 83 | 87 |
| 84 } // namespace component_updater | 88 } // namespace component_updater |
| 85 | 89 |
| 86 #endif // CHROME_BROWSER_COMPONENT_UPDATER_PNACL_COMPONENT_INSTALLER_H_ | 90 #endif // CHROME_BROWSER_COMPONENT_UPDATER_PNACL_COMPONENT_INSTALLER_H_ |
| OLD | NEW |