| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/extensions/extension_system.h" | 8 #include "chrome/browser/extensions/extension_system.h" |
| 9 | 9 |
| 10 class CommandLine; | 10 class CommandLine; |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 class FilePath; | 13 class FilePath; |
| 14 class Time; | 14 class Time; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 class BrowserContext; | 18 class BrowserContext; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace extensions { | 21 namespace extensions { |
| 22 class ExtensionPrefs; | 22 class ExtensionPrefs; |
| 23 | 23 |
| 24 // Test ExtensionSystem, for use with TestingProfile. | 24 // Test ExtensionSystem, for use with TestingProfile. |
| 25 class TestExtensionSystem : public ExtensionSystem { | 25 class TestExtensionSystem : public ExtensionSystem { |
| 26 public: | 26 public: |
| 27 explicit TestExtensionSystem(Profile* profile); | 27 explicit TestExtensionSystem(Profile* profile); |
| 28 virtual ~TestExtensionSystem(); | 28 virtual ~TestExtensionSystem(); |
| 29 | 29 |
| 30 // ProfileKeyedService implementation. | 30 // BrowserContextKeyedService implementation. |
| 31 virtual void Shutdown() OVERRIDE; | 31 virtual void Shutdown() OVERRIDE; |
| 32 | 32 |
| 33 // Creates an ExtensionPrefs with the testing profile and returns it. | 33 // Creates an ExtensionPrefs with the testing profile and returns it. |
| 34 // Useful for tests that need to modify prefs before creating the | 34 // Useful for tests that need to modify prefs before creating the |
| 35 // ExtensionService. | 35 // ExtensionService. |
| 36 ExtensionPrefs* CreateExtensionPrefs(const CommandLine* command_line, | 36 ExtensionPrefs* CreateExtensionPrefs(const CommandLine* command_line, |
| 37 const base::FilePath& install_directory); | 37 const base::FilePath& install_directory); |
| 38 | 38 |
| 39 // Creates an ExtensionService initialized with the testing profile and | 39 // Creates an ExtensionService initialized with the testing profile and |
| 40 // returns it, and creates ExtensionPrefs if it hasn't been created yet. | 40 // returns it, and creates ExtensionPrefs if it hasn't been created yet. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 65 virtual ApiResourceManager<SerialConnection>* serial_connection_manager() | 65 virtual ApiResourceManager<SerialConnection>* serial_connection_manager() |
| 66 OVERRIDE; | 66 OVERRIDE; |
| 67 virtual ApiResourceManager<Socket>* socket_manager() OVERRIDE; | 67 virtual ApiResourceManager<Socket>* socket_manager() OVERRIDE; |
| 68 virtual ApiResourceManager<UsbDeviceResource>* usb_device_resource_manager() | 68 virtual ApiResourceManager<UsbDeviceResource>* usb_device_resource_manager() |
| 69 OVERRIDE; | 69 OVERRIDE; |
| 70 virtual ExtensionWarningService* warning_service() OVERRIDE; | 70 virtual ExtensionWarningService* warning_service() OVERRIDE; |
| 71 virtual Blacklist* blacklist() OVERRIDE; | 71 virtual Blacklist* blacklist() OVERRIDE; |
| 72 virtual const OneShotEvent& ready() const OVERRIDE; | 72 virtual const OneShotEvent& ready() const OVERRIDE; |
| 73 | 73 |
| 74 // Factory method for tests to use with SetTestingProfile. | 74 // Factory method for tests to use with SetTestingProfile. |
| 75 static ProfileKeyedService* Build(content::BrowserContext* profile); | 75 static BrowserContextKeyedService* Build(content::BrowserContext* profile); |
| 76 | 76 |
| 77 protected: | 77 protected: |
| 78 Profile* profile_; | 78 Profile* profile_; |
| 79 | 79 |
| 80 private: | 80 private: |
| 81 scoped_ptr<StateStore> state_store_; | 81 scoped_ptr<StateStore> state_store_; |
| 82 scoped_ptr<Blacklist> blacklist_; | 82 scoped_ptr<Blacklist> blacklist_; |
| 83 scoped_ptr<StandardManagementPolicyProvider> | 83 scoped_ptr<StandardManagementPolicyProvider> |
| 84 standard_management_policy_provider_; | 84 standard_management_policy_provider_; |
| 85 scoped_ptr<ManagementPolicy> management_policy_; | 85 scoped_ptr<ManagementPolicy> management_policy_; |
| 86 scoped_ptr<ExtensionService> extension_service_; | 86 scoped_ptr<ExtensionService> extension_service_; |
| 87 scoped_ptr<ExtensionProcessManager> extension_process_manager_; | 87 scoped_ptr<ExtensionProcessManager> extension_process_manager_; |
| 88 scoped_refptr<ExtensionInfoMap> info_map_; | 88 scoped_refptr<ExtensionInfoMap> info_map_; |
| 89 scoped_ptr<ApiResourceManager<Socket> > socket_manager_; | 89 scoped_ptr<ApiResourceManager<Socket> > socket_manager_; |
| 90 OneShotEvent ready_; | 90 OneShotEvent ready_; |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 } // namespace extensions | 93 } // namespace extensions |
| 94 | 94 |
| 95 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ | 95 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ |
| OLD | NEW |