Chromium Code Reviews| 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 "base/memory/scoped_ptr.h" | |
| 9 #include "chrome/browser/component_updater/component_updater_service.h" | |
| 10 #include "chrome/browser/component_updater/pnacl/pnacl_profile_observer.h" | |
| 11 | |
| 8 class CommandLine; | 12 class CommandLine; |
| 9 class ComponentUpdateService; | |
| 10 class Version; | 13 class Version; |
| 11 | 14 |
| 12 namespace base { | 15 namespace base { |
| 13 class DictionaryValue; | 16 class DictionaryValue; |
| 14 } | 17 } |
| 15 | 18 |
| 16 // Component update registration for Portable Native Client. | 19 // Component installer responsible for Portable Native Client files. |
| 17 void RegisterPnaclComponent(ComponentUpdateService* cus, | 20 // Files can be installed to a shared location, or be installed to |
| 18 const CommandLine& command_line); | 21 // a per-user location. |
| 22 class PnaclComponentInstaller : public ComponentInstaller { | |
| 23 public: | |
| 24 PnaclComponentInstaller(); | |
| 25 | |
| 26 virtual ~PnaclComponentInstaller(); | |
| 27 | |
| 28 virtual void OnUpdateError(int error) OVERRIDE; | |
| 29 | |
| 30 virtual bool Install(base::DictionaryValue* manifest, | |
| 31 const base::FilePath& unpack_path) OVERRIDE; | |
| 32 | |
| 33 void RegisterPnaclComponent(ComponentUpdateService* cus, | |
| 34 const CommandLine& command_line); | |
| 35 | |
| 36 // Check the PNaCl version again and re-register with the component | |
| 37 // updater service. | |
| 38 void ReRegisterPnacl(); | |
| 39 | |
| 40 bool per_user() const { return per_user_; } | |
| 41 | |
| 42 CrxComponent component() const { | |
| 43 return pnacl_component_; | |
| 44 } | |
| 45 | |
| 46 Version current_version() const { | |
| 47 return pnacl_component_.version; | |
| 48 } | |
| 49 | |
| 50 void set_current_version(const Version& ver) { | |
| 51 pnacl_component_.version = ver; | |
| 52 } | |
| 53 | |
| 54 private: | |
| 55 DISALLOW_COPY_AND_ASSIGN(PnaclComponentInstaller); | |
| 56 bool per_user_; | |
| 57 scoped_ptr<PnaclProfileObserver> profile_observer_; | |
| 58 CrxComponent pnacl_component_; | |
|
cpu_(ooo_6.6-7.5)
2013/03/29 22:20:55
I don't see the need for the pnacl_component_ memb
jvoung (off chromium)
2013/03/29 22:54:52
That's true, I'll simplify it.
| |
| 59 ComponentUpdateService* cus_; | |
| 60 }; | |
| 19 | 61 |
| 20 // Returns true if this browser is compatible with the given Pnacl component | 62 // Returns true if this browser is compatible with the given Pnacl component |
| 21 // manifest, with the version specified in the manifest in |version_out|. | 63 // manifest, with the version specified in the manifest in |version_out|. |
| 22 bool CheckPnaclComponentManifest(base::DictionaryValue* manifest, | 64 bool CheckPnaclComponentManifest(base::DictionaryValue* manifest, |
| 23 Version* version_out); | 65 Version* version_out); |
| 24 | 66 |
| 25 #endif // CHROME_BROWSER_COMPONENT_UPDATER_PNACL_PNACL_COMPONENT_INSTALLER_H_ | 67 #endif // CHROME_BROWSER_COMPONENT_UPDATER_PNACL_PNACL_COMPONENT_INSTALLER_H_ |
| OLD | NEW |