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 Clock; |
13 class FilePath; | 14 class FilePath; |
14 class Time; | 15 class Time; |
15 } | 16 } |
16 | 17 |
17 namespace extensions { | 18 namespace extensions { |
18 | 19 |
19 // Test ExtensionSystem, for use with TestingProfile. | 20 // Test ExtensionSystem, for use with TestingProfile. |
20 class TestExtensionSystem : public ExtensionSystem { | 21 class TestExtensionSystem : public ExtensionSystem { |
21 public: | 22 public: |
22 explicit TestExtensionSystem(Profile* profile); | 23 explicit TestExtensionSystem(Profile* profile); |
23 virtual ~TestExtensionSystem(); | 24 virtual ~TestExtensionSystem(); |
24 | 25 |
25 // ProfileKeyedService implementation. | 26 // ProfileKeyedService implementation. |
26 virtual void Shutdown() OVERRIDE; | 27 virtual void Shutdown() OVERRIDE; |
27 | 28 |
28 // Creates an ExtensionService initialized with the testing profile and | 29 // Creates an ExtensionService initialized with the testing profile and |
29 // returns it. | 30 // returns it. |
30 ExtensionService* CreateExtensionService(const CommandLine* command_line, | 31 ExtensionService* CreateExtensionService(const CommandLine* command_line, |
31 const base::FilePath& install_directo
ry, | 32 const base::FilePath& install_directo
ry, |
32 bool autoupdate_enabled); | 33 bool autoupdate_enabled); |
33 | 34 |
34 // Creates an ExtensionProcessManager. If not invoked, the | 35 // Creates an ExtensionProcessManager. If not invoked, the |
35 // ExtensionProcessManager is NULL. | 36 // ExtensionProcessManager is NULL. |
36 void CreateExtensionProcessManager(); | 37 void CreateExtensionProcessManager(); |
37 | 38 |
38 // Creates an AlarmManager. Will be NULL otherwise. | 39 // Creates an AlarmManager. Will be NULL otherwise. |
39 void CreateAlarmManager(base::Time (*now)()); | 40 void CreateAlarmManager(base::Clock* clock); |
40 | 41 |
41 void CreateSocketManager(); | 42 void CreateSocketManager(); |
42 | 43 |
43 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE {} | 44 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE {} |
44 virtual void InitForOTRProfile() OVERRIDE {} | 45 virtual void InitForOTRProfile() OVERRIDE {} |
45 void SetExtensionService(ExtensionService* service); | 46 void SetExtensionService(ExtensionService* service); |
46 virtual ExtensionService* extension_service() OVERRIDE; | 47 virtual ExtensionService* extension_service() OVERRIDE; |
47 virtual ManagementPolicy* management_policy() OVERRIDE; | 48 virtual ManagementPolicy* management_policy() OVERRIDE; |
48 virtual UserScriptMaster* user_script_master() OVERRIDE; | 49 virtual UserScriptMaster* user_script_master() OVERRIDE; |
49 virtual ExtensionProcessManager* process_manager() OVERRIDE; | 50 virtual ExtensionProcessManager* process_manager() OVERRIDE; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 scoped_ptr<ExtensionService> extension_service_; | 85 scoped_ptr<ExtensionService> extension_service_; |
85 scoped_ptr<ExtensionProcessManager> extension_process_manager_; | 86 scoped_ptr<ExtensionProcessManager> extension_process_manager_; |
86 scoped_ptr<AlarmManager> alarm_manager_; | 87 scoped_ptr<AlarmManager> alarm_manager_; |
87 scoped_refptr<ExtensionInfoMap> info_map_; | 88 scoped_refptr<ExtensionInfoMap> info_map_; |
88 scoped_ptr<ApiResourceManager<Socket> > socket_manager_; | 89 scoped_ptr<ApiResourceManager<Socket> > socket_manager_; |
89 }; | 90 }; |
90 | 91 |
91 } // namespace extensions | 92 } // namespace extensions |
92 | 93 |
93 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ | 94 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ |
OLD | NEW |