Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: extensions/browser/mock_extension_system.h

Issue 664933004: Standardize usage of virtual/override/final in extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 EXTENSIONS_BROWSER_MOCK_EXTENSION_SYSTEM_H_ 5 #ifndef EXTENSIONS_BROWSER_MOCK_EXTENSION_SYSTEM_H_
6 #define EXTENSIONS_BROWSER_MOCK_EXTENSION_SYSTEM_H_ 6 #define EXTENSIONS_BROWSER_MOCK_EXTENSION_SYSTEM_H_
7 7
8 #include "components/keyed_service/content/browser_context_dependency_manager.h" 8 #include "components/keyed_service/content/browser_context_dependency_manager.h"
9 #include "extensions/browser/extension_registry_factory.h" 9 #include "extensions/browser/extension_registry_factory.h"
10 #include "extensions/browser/extension_system.h" 10 #include "extensions/browser/extension_system.h"
11 #include "extensions/browser/extension_system_provider.h" 11 #include "extensions/browser/extension_system_provider.h"
12 #include "extensions/common/one_shot_event.h" 12 #include "extensions/common/one_shot_event.h"
13 13
14 namespace extensions { 14 namespace extensions {
15 15
16 // An empty ExtensionSystem for testing. Tests that need only specific 16 // An empty ExtensionSystem for testing. Tests that need only specific
17 // parts of ExtensionSystem should derive from this class and override 17 // parts of ExtensionSystem should derive from this class and override
18 // functions as needed. To use this, use 18 // functions as needed. To use this, use
19 // TestExtensionsBrowserClient::set_extension_system_factory 19 // TestExtensionsBrowserClient::set_extension_system_factory
20 // with the MockExtensionSystemFactory below. 20 // with the MockExtensionSystemFactory below.
21 class MockExtensionSystem : public ExtensionSystem { 21 class MockExtensionSystem : public ExtensionSystem {
22 public: 22 public:
23 explicit MockExtensionSystem(content::BrowserContext* context); 23 explicit MockExtensionSystem(content::BrowserContext* context);
24 virtual ~MockExtensionSystem(); 24 ~MockExtensionSystem() override;
25 25
26 content::BrowserContext* browser_context() { return browser_context_; } 26 content::BrowserContext* browser_context() { return browser_context_; }
27 27
28 // ExtensionSystem overrides: 28 // ExtensionSystem overrides:
29 virtual void InitForRegularProfile(bool extensions_enabled) override; 29 void InitForRegularProfile(bool extensions_enabled) override;
30 virtual ExtensionService* extension_service() override; 30 ExtensionService* extension_service() override;
31 virtual RuntimeData* runtime_data() override; 31 RuntimeData* runtime_data() override;
32 virtual ManagementPolicy* management_policy() override; 32 ManagementPolicy* management_policy() override;
33 virtual SharedUserScriptMaster* shared_user_script_master() override; 33 SharedUserScriptMaster* shared_user_script_master() override;
34 virtual ProcessManager* process_manager() override; 34 ProcessManager* process_manager() override;
35 virtual StateStore* state_store() override; 35 StateStore* state_store() override;
36 virtual StateStore* rules_store() override; 36 StateStore* rules_store() override;
37 virtual InfoMap* info_map() override; 37 InfoMap* info_map() override;
38 virtual LazyBackgroundTaskQueue* lazy_background_task_queue() override; 38 LazyBackgroundTaskQueue* lazy_background_task_queue() override;
39 virtual EventRouter* event_router() override; 39 EventRouter* event_router() override;
40 virtual WarningService* warning_service() override; 40 WarningService* warning_service() override;
41 virtual Blacklist* blacklist() override; 41 Blacklist* blacklist() override;
42 virtual ErrorConsole* error_console() override; 42 ErrorConsole* error_console() override;
43 virtual InstallVerifier* install_verifier() override; 43 InstallVerifier* install_verifier() override;
44 virtual QuotaService* quota_service() override; 44 QuotaService* quota_service() override;
45 virtual const OneShotEvent& ready() const override; 45 const OneShotEvent& ready() const override;
46 virtual ContentVerifier* content_verifier() override; 46 ContentVerifier* content_verifier() override;
47 virtual scoped_ptr<ExtensionSet> GetDependentExtensions( 47 scoped_ptr<ExtensionSet> GetDependentExtensions(
48 const Extension* extension) override; 48 const Extension* extension) override;
49 virtual DeclarativeUserScriptMaster* 49 DeclarativeUserScriptMaster* GetDeclarativeUserScriptMasterByExtension(
50 GetDeclarativeUserScriptMasterByExtension( 50 const ExtensionId& extension_id) override;
51 const ExtensionId& extension_id) override;
52 51
53 private: 52 private:
54 content::BrowserContext* browser_context_; 53 content::BrowserContext* browser_context_;
55 OneShotEvent ready_; 54 OneShotEvent ready_;
56 55
57 DISALLOW_COPY_AND_ASSIGN(MockExtensionSystem); 56 DISALLOW_COPY_AND_ASSIGN(MockExtensionSystem);
58 }; 57 };
59 58
60 // A factory to create a MockExtensionSystem. Sample use: 59 // A factory to create a MockExtensionSystem. Sample use:
61 // 60 //
(...skipping 24 matching lines...) Expand all
86 GetServiceForBrowserContext(context, true)); 85 GetServiceForBrowserContext(context, true));
87 } 86 }
88 87
89 private: 88 private:
90 DISALLOW_COPY_AND_ASSIGN(MockExtensionSystemFactory); 89 DISALLOW_COPY_AND_ASSIGN(MockExtensionSystemFactory);
91 }; 90 };
92 91
93 } // namespace extensions 92 } // namespace extensions
94 93
95 #endif // EXTENSIONS_BROWSER_MOCK_EXTENSION_SYSTEM_H_ 94 #endif // EXTENSIONS_BROWSER_MOCK_EXTENSION_SYSTEM_H_
OLDNEW
« no previous file with comments | « extensions/browser/lazy_background_task_queue_unittest.cc ('k') | extensions/browser/null_app_sorting.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698