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 "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "extensions/browser/extension_system.h" | 9 #include "extensions/browser/extension_system.h" |
10 #include "extensions/common/one_shot_event.h" | 10 #include "extensions/common/one_shot_event.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 // Creates an ExtensionService initialized with the testing profile and | 47 // Creates an ExtensionService initialized with the testing profile and |
48 // returns it, and creates ExtensionPrefs if it hasn't been created yet. | 48 // returns it, and creates ExtensionPrefs if it hasn't been created yet. |
49 ExtensionService* CreateExtensionService( | 49 ExtensionService* CreateExtensionService( |
50 const base::CommandLine* command_line, | 50 const base::CommandLine* command_line, |
51 const base::FilePath& install_directory, | 51 const base::FilePath& install_directory, |
52 bool autoupdate_enabled); | 52 bool autoupdate_enabled); |
53 | 53 |
54 // Creates a ProcessManager. If not invoked, the ProcessManager is NULL. | 54 // Creates a ProcessManager. If not invoked, the ProcessManager is NULL. |
55 void CreateProcessManager(); | 55 void CreateProcessManager(); |
56 | 56 |
57 // Allows the ProcessManager to be overriden, for example by a stub | 57 // Allows the ProcessManager to be overridden, for example by a stub |
58 // implementation. Takes ownership of |manager|. | 58 // implementation. Takes ownership of |manager|. |
59 void SetProcessManager(ProcessManager* manager); | 59 void SetProcessManager(ProcessManager* manager); |
60 | 60 |
61 void CreateSocketManager(); | 61 void CreateSocketManager(); |
62 | 62 |
63 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE {} | 63 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE {} |
64 void SetExtensionService(ExtensionService* service); | 64 // Takes ownership of |service| if |owned| if true. |
Yoyo Zhou
2014/09/05 16:21:33
typo: is true
Lei Zhang
2014/09/05 19:35:08
Reverted TestExtensionSystem changes.
| |
65 void SetExtensionService(ExtensionService* service, bool owned); | |
65 virtual ExtensionService* extension_service() OVERRIDE; | 66 virtual ExtensionService* extension_service() OVERRIDE; |
66 virtual RuntimeData* runtime_data() OVERRIDE; | 67 virtual RuntimeData* runtime_data() OVERRIDE; |
67 virtual ManagementPolicy* management_policy() OVERRIDE; | 68 virtual ManagementPolicy* management_policy() OVERRIDE; |
68 virtual SharedUserScriptMaster* shared_user_script_master() OVERRIDE; | 69 virtual SharedUserScriptMaster* shared_user_script_master() OVERRIDE; |
69 virtual ProcessManager* process_manager() OVERRIDE; | 70 virtual ProcessManager* process_manager() OVERRIDE; |
70 virtual StateStore* state_store() OVERRIDE; | 71 virtual StateStore* state_store() OVERRIDE; |
71 virtual StateStore* rules_store() OVERRIDE; | 72 virtual StateStore* rules_store() OVERRIDE; |
72 TestingValueStore* value_store() { return value_store_; } | 73 TestingValueStore* value_store() { return value_store_; } |
73 virtual InfoMap* info_map() OVERRIDE; | 74 virtual InfoMap* info_map() OVERRIDE; |
74 virtual LazyBackgroundTaskQueue* lazy_background_task_queue() OVERRIDE; | 75 virtual LazyBackgroundTaskQueue* lazy_background_task_queue() OVERRIDE; |
(...skipping 25 matching lines...) Expand all Loading... | |
100 private: | 101 private: |
101 scoped_ptr<StateStore> state_store_; | 102 scoped_ptr<StateStore> state_store_; |
102 // A pointer to the TestingValueStore owned by |state_store_|. | 103 // A pointer to the TestingValueStore owned by |state_store_|. |
103 TestingValueStore* value_store_; | 104 TestingValueStore* value_store_; |
104 ScopedVector<DeclarativeUserScriptMaster> declarative_user_script_masters_; | 105 ScopedVector<DeclarativeUserScriptMaster> declarative_user_script_masters_; |
105 scoped_ptr<Blacklist> blacklist_; | 106 scoped_ptr<Blacklist> blacklist_; |
106 scoped_ptr<StandardManagementPolicyProvider> | 107 scoped_ptr<StandardManagementPolicyProvider> |
107 standard_management_policy_provider_; | 108 standard_management_policy_provider_; |
108 scoped_ptr<ManagementPolicy> management_policy_; | 109 scoped_ptr<ManagementPolicy> management_policy_; |
109 scoped_ptr<RuntimeData> runtime_data_; | 110 scoped_ptr<RuntimeData> runtime_data_; |
110 scoped_ptr<ExtensionService> extension_service_; | |
111 scoped_ptr<ProcessManager> process_manager_; | 111 scoped_ptr<ProcessManager> process_manager_; |
112 scoped_refptr<InfoMap> info_map_; | 112 scoped_refptr<InfoMap> info_map_; |
113 scoped_ptr<EventRouter> event_router_; | 113 scoped_ptr<EventRouter> event_router_; |
114 scoped_ptr<ErrorConsole> error_console_; | 114 scoped_ptr<ErrorConsole> error_console_; |
115 scoped_ptr<InstallVerifier> install_verifier_; | 115 scoped_ptr<InstallVerifier> install_verifier_; |
116 scoped_ptr<QuotaService> quota_service_; | 116 scoped_ptr<QuotaService> quota_service_; |
117 OneShotEvent ready_; | 117 OneShotEvent ready_; |
118 | |
119 // Ownership depends on |extension_service_owned_|. | |
120 ExtensionService* extension_service_; | |
121 // True by default. | |
122 bool extension_service_owned_; | |
118 }; | 123 }; |
119 | 124 |
120 } // namespace extensions | 125 } // namespace extensions |
121 | 126 |
122 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ | 127 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ |
OLD | NEW |