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_PNACL_COMPONENT_INSTALLER_H_ | 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_PNACL_PNACL_COMPONENT_INSTALLER_H_ |
6 #define CHROME_BROWSER_COMPONENT_UPDATER_PNACL_PNACL_COMPONENT_INSTALLER_H_ | 6 #define CHROME_BROWSER_COMPONENT_UPDATER_PNACL_PNACL_COMPONENT_INSTALLER_H_ |
7 | 7 |
8 #include <string> | |
9 | |
10 #include "base/compiler_specific.h" | |
11 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
12 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
13 #include "base/version.h" | 10 #include "base/version.h" |
14 #include "chrome/browser/component_updater/component_updater_service.h" | 11 #include "chrome/browser/component_updater/component_updater_service.h" |
15 #include "chrome/browser/component_updater/pnacl/pnacl_profile_observer.h" | 12 #include "chrome/browser/component_updater/pnacl/pnacl_profile_observer.h" |
16 | 13 |
17 class CommandLine; | 14 class CommandLine; |
18 | 15 |
19 namespace base { | 16 namespace base { |
20 class DictionaryValue; | 17 class DictionaryValue; |
21 } | 18 } |
22 | 19 |
23 // Component installer responsible for Portable Native Client files. | 20 // Component installer responsible for Portable Native Client files. |
24 // Files can be installed to a shared location, or be installed to | 21 // Files can be installed to a shared location, or be installed to |
25 // a per-user location. | 22 // a per-user location. |
26 class PnaclComponentInstaller : public ComponentInstaller { | 23 class PnaclComponentInstaller : public ComponentInstaller { |
27 public: | 24 public: |
28 PnaclComponentInstaller(); | 25 PnaclComponentInstaller(); |
29 | 26 |
30 virtual ~PnaclComponentInstaller(); | 27 virtual ~PnaclComponentInstaller(); |
31 | 28 |
32 virtual void OnUpdateError(int error) OVERRIDE; | 29 virtual void OnUpdateError(int error) OVERRIDE; |
33 | 30 |
34 virtual bool Install(const base::DictionaryValue& manifest, | 31 virtual bool Install(const base::DictionaryValue& manifest, |
35 const base::FilePath& unpack_path) OVERRIDE; | 32 const base::FilePath& unpack_path) OVERRIDE; |
36 | 33 |
37 virtual bool GetInstalledFile(const std::string& file, | |
38 base::FilePath* installed_file) OVERRIDE; | |
39 | |
40 // Register a PNaCl component for the first time. | 34 // Register a PNaCl component for the first time. |
41 void RegisterPnaclComponent(ComponentUpdateService* cus, | 35 void RegisterPnaclComponent(ComponentUpdateService* cus, |
42 const CommandLine& command_line); | 36 const CommandLine& command_line); |
43 | 37 |
44 // Check the PNaCl version again and re-register with the component | 38 // Check the PNaCl version again and re-register with the component |
45 // updater service. | 39 // updater service. |
46 void ReRegisterPnacl(); | 40 void ReRegisterPnacl(); |
47 | 41 |
48 bool per_user() const { return per_user_; } | 42 bool per_user() const { return per_user_; } |
49 | 43 |
(...skipping 17 matching lines...) Expand all Loading... |
67 ComponentUpdateService* cus_; | 61 ComponentUpdateService* cus_; |
68 DISALLOW_COPY_AND_ASSIGN(PnaclComponentInstaller); | 62 DISALLOW_COPY_AND_ASSIGN(PnaclComponentInstaller); |
69 }; | 63 }; |
70 | 64 |
71 // Returns true if this browser is compatible with the given Pnacl component | 65 // Returns true if this browser is compatible with the given Pnacl component |
72 // manifest, with the version specified in the manifest in |version_out|. | 66 // manifest, with the version specified in the manifest in |version_out|. |
73 bool CheckPnaclComponentManifest(const base::DictionaryValue& manifest, | 67 bool CheckPnaclComponentManifest(const base::DictionaryValue& manifest, |
74 base::Version* version_out); | 68 base::Version* version_out); |
75 | 69 |
76 #endif // CHROME_BROWSER_COMPONENT_UPDATER_PNACL_PNACL_COMPONENT_INSTALLER_H_ | 70 #endif // CHROME_BROWSER_COMPONENT_UPDATER_PNACL_PNACL_COMPONENT_INSTALLER_H_ |
OLD | NEW |