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

Side by Side Diff: chrome/browser/extensions/test_extension_system.cc

Issue 10382149: Refactor the various ways to control what users can do to extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
OLDNEW
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 #include "chrome/browser/extensions/test_extension_system.h" 5 #include "chrome/browser/extensions/test_extension_system.h"
6 6
7 #include "chrome/browser/extensions/api/alarms/alarm_manager.h" 7 #include "chrome/browser/extensions/api/alarms/alarm_manager.h"
8 #include "chrome/browser/extensions/extension_devtools_manager.h" 8 #include "chrome/browser/extensions/extension_devtools_manager.h"
9 #include "chrome/browser/extensions/extension_event_router.h" 9 #include "chrome/browser/extensions/extension_event_router.h"
10 #include "chrome/browser/extensions/extension_info_map.h" 10 #include "chrome/browser/extensions/extension_info_map.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 extension_prefs_->Init(extensions_disabled); 57 extension_prefs_->Init(extensions_disabled);
58 extension_service_.reset(new ExtensionService(profile_, 58 extension_service_.reset(new ExtensionService(profile_,
59 command_line, 59 command_line,
60 install_directory, 60 install_directory,
61 extension_prefs_.get(), 61 extension_prefs_.get(),
62 autoupdate_enabled, 62 autoupdate_enabled,
63 true)); 63 true));
64 return extension_service_.get(); 64 return extension_service_.get();
65 } 65 }
66 66
67 extensions::ManagementPolicy* TestExtensionSystem::CreateManagementPolicy() {
68 management_policy_.reset(new extensions::ManagementPolicy());
69
70 DCHECK(extension_prefs_.get());
71 management_policy_->RegisterProvider(extension_prefs_.get());
72 DCHECK(extension_service_.get());
73 management_policy_->RegisterProvider(extension_service_.get());
74
75 return management_policy_.get();
76 }
77
67 ExtensionService* TestExtensionSystem::extension_service() { 78 ExtensionService* TestExtensionSystem::extension_service() {
68 return extension_service_.get(); 79 return extension_service_.get();
69 } 80 }
70 81
82 extensions::ManagementPolicy* TestExtensionSystem::management_policy() {
Aaron Boodman 2012/05/22 15:56:11 Why bother overriding this? ManagementPolicy is fi
Pam (message me for reviews) 2012/05/23 15:00:58 TestExtensionSystem is a subclass of ExtensionSyst
83 return management_policy_.get();
84 }
85
71 void TestExtensionSystem::SetExtensionService(ExtensionService* service) { 86 void TestExtensionSystem::SetExtensionService(ExtensionService* service) {
72 extension_service_.reset(service); 87 extension_service_.reset(service);
73 } 88 }
74 89
75 UserScriptMaster* TestExtensionSystem::user_script_master() { 90 UserScriptMaster* TestExtensionSystem::user_script_master() {
76 return NULL; 91 return NULL;
77 } 92 }
78 93
79 ExtensionDevToolsManager* TestExtensionSystem::devtools_manager() { 94 ExtensionDevToolsManager* TestExtensionSystem::devtools_manager() {
80 return NULL; 95 return NULL;
(...skipping 26 matching lines...) Expand all
107 122
108 extensions::RulesRegistryService* 123 extensions::RulesRegistryService*
109 TestExtensionSystem::rules_registry_service() { 124 TestExtensionSystem::rules_registry_service() {
110 return NULL; 125 return NULL;
111 } 126 }
112 127
113 // static 128 // static
114 ProfileKeyedService* TestExtensionSystem::Build(Profile* profile) { 129 ProfileKeyedService* TestExtensionSystem::Build(Profile* profile) {
115 return new TestExtensionSystem(profile); 130 return new TestExtensionSystem(profile);
116 } 131 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698