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 "extensions/browser/extension_system.h" | 8 #include "extensions/browser/extension_system.h" |
9 #include "extensions/common/one_shot_event.h" | 9 #include "extensions/common/one_shot_event.h" |
10 | 10 |
11 class CommandLine; | |
12 class Profile; | 11 class Profile; |
13 class TestingValueStore; | 12 class TestingValueStore; |
14 | 13 |
15 namespace base { | 14 namespace base { |
| 15 class CommandLine; |
16 class FilePath; | 16 class FilePath; |
17 class Time; | 17 class Time; |
18 } | 18 } |
19 | 19 |
20 namespace content { | 20 namespace content { |
21 class BrowserContext; | 21 class BrowserContext; |
22 } | 22 } |
23 | 23 |
24 namespace extensions { | 24 namespace extensions { |
25 class ExtensionPrefs; | 25 class ExtensionPrefs; |
26 class RuntimeData; | 26 class RuntimeData; |
27 class StandardManagementPolicyProvider; | 27 class StandardManagementPolicyProvider; |
28 | 28 |
29 // Test ExtensionSystem, for use with TestingProfile. | 29 // Test ExtensionSystem, for use with TestingProfile. |
30 class TestExtensionSystem : public ExtensionSystem { | 30 class TestExtensionSystem : public ExtensionSystem { |
31 public: | 31 public: |
32 explicit TestExtensionSystem(Profile* profile); | 32 explicit TestExtensionSystem(Profile* profile); |
33 virtual ~TestExtensionSystem(); | 33 virtual ~TestExtensionSystem(); |
34 | 34 |
35 // KeyedService implementation. | 35 // KeyedService implementation. |
36 virtual void Shutdown() OVERRIDE; | 36 virtual void Shutdown() OVERRIDE; |
37 | 37 |
38 // Creates an ExtensionPrefs with the testing profile and returns it. | 38 // Creates an ExtensionPrefs with the testing profile and returns it. |
39 // Useful for tests that need to modify prefs before creating the | 39 // Useful for tests that need to modify prefs before creating the |
40 // ExtensionService. | 40 // ExtensionService. |
41 ExtensionPrefs* CreateExtensionPrefs(const CommandLine* command_line, | 41 ExtensionPrefs* CreateExtensionPrefs(const base::CommandLine* command_line, |
42 const base::FilePath& install_directory); | 42 const base::FilePath& install_directory); |
43 | 43 |
44 // Creates an ExtensionService initialized with the testing profile and | 44 // Creates an ExtensionService initialized with the testing profile and |
45 // returns it, and creates ExtensionPrefs if it hasn't been created yet. | 45 // returns it, and creates ExtensionPrefs if it hasn't been created yet. |
46 ExtensionService* CreateExtensionService( | 46 ExtensionService* CreateExtensionService( |
47 const CommandLine* command_line, | 47 const base::CommandLine* command_line, |
48 const base::FilePath& install_directory, | 48 const base::FilePath& install_directory, |
49 bool autoupdate_enabled); | 49 bool autoupdate_enabled); |
50 | 50 |
51 // Creates a ProcessManager. If not invoked, the ProcessManager is NULL. | 51 // Creates a ProcessManager. If not invoked, the ProcessManager is NULL. |
52 void CreateProcessManager(); | 52 void CreateProcessManager(); |
53 | 53 |
54 // Allows the ProcessManager to be overriden, for example by a stub | 54 // Allows the ProcessManager to be overriden, for example by a stub |
55 // implementation. Takes ownership of |manager|. | 55 // implementation. Takes ownership of |manager|. |
56 void SetProcessManager(ProcessManager* manager); | 56 void SetProcessManager(ProcessManager* manager); |
57 | 57 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 scoped_ptr<EventRouter> event_router_; | 104 scoped_ptr<EventRouter> event_router_; |
105 scoped_ptr<ErrorConsole> error_console_; | 105 scoped_ptr<ErrorConsole> error_console_; |
106 scoped_ptr<InstallVerifier> install_verifier_; | 106 scoped_ptr<InstallVerifier> install_verifier_; |
107 scoped_ptr<QuotaService> quota_service_; | 107 scoped_ptr<QuotaService> quota_service_; |
108 OneShotEvent ready_; | 108 OneShotEvent ready_; |
109 }; | 109 }; |
110 | 110 |
111 } // namespace extensions | 111 } // namespace extensions |
112 | 112 |
113 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ | 113 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ |
OLD | NEW |