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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/extensions/extension_system.h" | 9 #include "chrome/browser/extensions/extension_system.h" |
10 | 10 |
11 class CommandLine; | 11 class CommandLine; |
12 class FilePath; | 12 class FilePath; |
| 13 namespace base { |
| 14 class Time; |
| 15 } |
13 | 16 |
14 // Test ExtensionSystem, for use with TestingProfile. | 17 // Test ExtensionSystem, for use with TestingProfile. |
15 class TestExtensionSystem : public ExtensionSystem { | 18 class TestExtensionSystem : public ExtensionSystem { |
16 public: | 19 public: |
17 explicit TestExtensionSystem(Profile* profile); | 20 explicit TestExtensionSystem(Profile* profile); |
18 virtual ~TestExtensionSystem(); | 21 virtual ~TestExtensionSystem(); |
19 | 22 |
20 // ProfileKeyedService implementation. | 23 // ProfileKeyedService implementation. |
21 virtual void Shutdown() OVERRIDE; | 24 virtual void Shutdown() OVERRIDE; |
22 | 25 |
23 // Creates an ExtensionService initialized with the testing profile and | 26 // Creates an ExtensionService initialized with the testing profile and |
24 // returns it. | 27 // returns it. |
25 ExtensionService* CreateExtensionService(const CommandLine* command_line, | 28 ExtensionService* CreateExtensionService(const CommandLine* command_line, |
26 const FilePath& install_directory, | 29 const FilePath& install_directory, |
27 bool autoupdate_enabled); | 30 bool autoupdate_enabled); |
28 | 31 |
29 // Creates and returns a ManagementPolicy with the ExtensionService and | 32 // Creates and returns a ManagementPolicy with the ExtensionService and |
30 // ExtensionPrefs registered. If not invoked, the ManagementPolicy is NULL. | 33 // ExtensionPrefs registered. If not invoked, the ManagementPolicy is NULL. |
31 extensions::ManagementPolicy* CreateManagementPolicy(); | 34 extensions::ManagementPolicy* CreateManagementPolicy(); |
32 | 35 |
33 // Creates an ExtensionProcessManager. If not invoked, the | 36 // Creates an ExtensionProcessManager. If not invoked, the |
34 // ExtensionProcessManager is NULL. | 37 // ExtensionProcessManager is NULL. |
35 void CreateExtensionProcessManager(); | 38 void CreateExtensionProcessManager(); |
36 | 39 |
37 // Creates an AlarmManager. Will be NULL otherwise. | 40 // Creates an AlarmManager. Will be NULL otherwise. |
38 void CreateAlarmManager(); | 41 void CreateAlarmManager(base::Time (*now)()); |
39 | 42 |
40 virtual void Init(bool extensions_enabled) OVERRIDE {} | 43 virtual void Init(bool extensions_enabled) OVERRIDE {} |
41 virtual ExtensionService* extension_service() OVERRIDE; | 44 virtual ExtensionService* extension_service() OVERRIDE; |
42 virtual extensions::ManagementPolicy* management_policy() OVERRIDE; | 45 virtual extensions::ManagementPolicy* management_policy() OVERRIDE; |
43 void SetExtensionService(ExtensionService* service); | 46 void SetExtensionService(ExtensionService* service); |
44 virtual UserScriptMaster* user_script_master() OVERRIDE; | 47 virtual UserScriptMaster* user_script_master() OVERRIDE; |
45 virtual ExtensionDevToolsManager* devtools_manager() OVERRIDE; | 48 virtual ExtensionDevToolsManager* devtools_manager() OVERRIDE; |
46 virtual ExtensionProcessManager* process_manager() OVERRIDE; | 49 virtual ExtensionProcessManager* process_manager() OVERRIDE; |
47 virtual extensions::AlarmManager* alarm_manager() OVERRIDE; | 50 virtual extensions::AlarmManager* alarm_manager() OVERRIDE; |
48 virtual extensions::StateStore* state_store() OVERRIDE; | 51 virtual extensions::StateStore* state_store() OVERRIDE; |
(...skipping 14 matching lines...) Expand all Loading... |
63 // The Extension Preferences. Only created if CreateExtensionService is | 66 // The Extension Preferences. Only created if CreateExtensionService is |
64 // invoked. | 67 // invoked. |
65 scoped_ptr<ExtensionPrefs> extension_prefs_; | 68 scoped_ptr<ExtensionPrefs> extension_prefs_; |
66 scoped_ptr<ExtensionService> extension_service_; | 69 scoped_ptr<ExtensionService> extension_service_; |
67 scoped_ptr<extensions::ManagementPolicy> management_policy_; | 70 scoped_ptr<extensions::ManagementPolicy> management_policy_; |
68 scoped_ptr<ExtensionProcessManager> extension_process_manager_; | 71 scoped_ptr<ExtensionProcessManager> extension_process_manager_; |
69 scoped_ptr<extensions::AlarmManager> alarm_manager_; | 72 scoped_ptr<extensions::AlarmManager> alarm_manager_; |
70 }; | 73 }; |
71 | 74 |
72 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ | 75 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ |
OLD | NEW |