| 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 10 matching lines...) Expand all Loading... |
| 21 namespace content { | 21 namespace content { |
| 22 class BrowserContext; | 22 class BrowserContext; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace extensions { | 25 namespace extensions { |
| 26 class DeclarativeUserScriptManager; | 26 class DeclarativeUserScriptManager; |
| 27 class ExtensionPrefs; | 27 class ExtensionPrefs; |
| 28 class RuntimeData; | 28 class RuntimeData; |
| 29 class SharedUserScriptMaster; | 29 class SharedUserScriptMaster; |
| 30 class StandardManagementPolicyProvider; | 30 class StandardManagementPolicyProvider; |
| 31 class WebViewContentScriptManager; |
| 31 | 32 |
| 32 // Test ExtensionSystem, for use with TestingProfile. | 33 // Test ExtensionSystem, for use with TestingProfile. |
| 33 class TestExtensionSystem : public ExtensionSystem { | 34 class TestExtensionSystem : public ExtensionSystem { |
| 34 public: | 35 public: |
| 35 explicit TestExtensionSystem(Profile* profile); | 36 explicit TestExtensionSystem(Profile* profile); |
| 36 ~TestExtensionSystem() override; | 37 ~TestExtensionSystem() override; |
| 37 | 38 |
| 38 // KeyedService implementation. | 39 // KeyedService implementation. |
| 39 void Shutdown() override; | 40 void Shutdown() override; |
| 40 | 41 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 67 StateStore* state_store() override; | 68 StateStore* state_store() override; |
| 68 StateStore* rules_store() override; | 69 StateStore* rules_store() override; |
| 69 TestingValueStore* value_store() { return value_store_; } | 70 TestingValueStore* value_store() { return value_store_; } |
| 70 InfoMap* info_map() override; | 71 InfoMap* info_map() override; |
| 71 LazyBackgroundTaskQueue* lazy_background_task_queue() override; | 72 LazyBackgroundTaskQueue* lazy_background_task_queue() override; |
| 72 void SetEventRouter(scoped_ptr<EventRouter> event_router); | 73 void SetEventRouter(scoped_ptr<EventRouter> event_router); |
| 73 EventRouter* event_router() override; | 74 EventRouter* event_router() override; |
| 74 ErrorConsole* error_console() override; | 75 ErrorConsole* error_console() override; |
| 75 InstallVerifier* install_verifier() override; | 76 InstallVerifier* install_verifier() override; |
| 76 QuotaService* quota_service() override; | 77 QuotaService* quota_service() override; |
| 78 WebViewContentScriptManager* web_view_content_script_manager() override; |
| 77 const OneShotEvent& ready() const override; | 79 const OneShotEvent& ready() const override; |
| 78 ContentVerifier* content_verifier() override; | 80 ContentVerifier* content_verifier() override; |
| 79 scoped_ptr<ExtensionSet> GetDependentExtensions( | 81 scoped_ptr<ExtensionSet> GetDependentExtensions( |
| 80 const Extension* extension) override; | 82 const Extension* extension) override; |
| 81 | 83 |
| 82 // Note that you probably want to use base::RunLoop().RunUntilIdle() right | 84 // Note that you probably want to use base::RunLoop().RunUntilIdle() right |
| 83 // after this to run all the accumulated tasks. | 85 // after this to run all the accumulated tasks. |
| 84 void SetReady() { ready_.Signal(); } | 86 void SetReady() { ready_.Signal(); } |
| 85 | 87 |
| 86 // Factory method for tests to use with SetTestingProfile. | 88 // Factory method for tests to use with SetTestingProfile. |
| 87 static KeyedService* Build(content::BrowserContext* profile); | 89 static KeyedService* Build(content::BrowserContext* profile); |
| 88 | 90 |
| 89 protected: | 91 protected: |
| 90 Profile* profile_; | 92 Profile* profile_; |
| 91 | 93 |
| 92 private: | 94 private: |
| 93 scoped_ptr<StateStore> state_store_; | 95 scoped_ptr<StateStore> state_store_; |
| 94 // A pointer to the TestingValueStore owned by |state_store_|. | 96 // A pointer to the TestingValueStore owned by |state_store_|. |
| 95 TestingValueStore* value_store_; | 97 TestingValueStore* value_store_; |
| 96 scoped_ptr<DeclarativeUserScriptManager> declarative_user_script_manager_; | 98 scoped_ptr<DeclarativeUserScriptManager> declarative_user_script_manager_; |
| 97 scoped_ptr<ManagementPolicy> management_policy_; | 99 scoped_ptr<ManagementPolicy> management_policy_; |
| 98 scoped_ptr<RuntimeData> runtime_data_; | 100 scoped_ptr<RuntimeData> runtime_data_; |
| 99 scoped_ptr<ExtensionService> extension_service_; | 101 scoped_ptr<ExtensionService> extension_service_; |
| 100 scoped_refptr<InfoMap> info_map_; | 102 scoped_refptr<InfoMap> info_map_; |
| 101 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_; | 103 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_; |
| 102 scoped_ptr<EventRouter> event_router_; | 104 scoped_ptr<EventRouter> event_router_; |
| 103 scoped_ptr<ErrorConsole> error_console_; | 105 scoped_ptr<ErrorConsole> error_console_; |
| 104 scoped_ptr<InstallVerifier> install_verifier_; | 106 scoped_ptr<InstallVerifier> install_verifier_; |
| 105 scoped_ptr<QuotaService> quota_service_; | 107 scoped_ptr<QuotaService> quota_service_; |
| 108 scoped_ptr<WebViewContentScriptManager> web_view_content_script_manager_; |
| 106 OneShotEvent ready_; | 109 OneShotEvent ready_; |
| 107 }; | 110 }; |
| 108 | 111 |
| 109 } // namespace extensions | 112 } // namespace extensions |
| 110 | 113 |
| 111 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ | 114 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ |
| OLD | NEW |