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

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

Issue 595363002: Add policy controlled permission block list for extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ext-fix
Patch Set: fixes addressing #4 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 (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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/extensions/blacklist.h" 9 #include "chrome/browser/extensions/blacklist.h"
10 #include "chrome/browser/extensions/declarative_user_script_master.h" 10 #include "chrome/browser/extensions/declarative_user_script_master.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 install_verifier_.reset( 93 install_verifier_.reset(
94 new InstallVerifier(ExtensionPrefs::Get(profile_), profile_)); 94 new InstallVerifier(ExtensionPrefs::Get(profile_), profile_));
95 // The ownership of |value_store_| is immediately transferred to state_store_, 95 // The ownership of |value_store_| is immediately transferred to state_store_,
96 // but we keep a naked pointer to the TestingValueStore. 96 // but we keep a naked pointer to the TestingValueStore.
97 scoped_ptr<TestingValueStore> value_store(new TestingValueStore()); 97 scoped_ptr<TestingValueStore> value_store(new TestingValueStore());
98 value_store_ = value_store.get(); 98 value_store_ = value_store.get();
99 state_store_.reset( 99 state_store_.reset(
100 new StateStore(profile_, value_store.PassAs<ValueStore>())); 100 new StateStore(profile_, value_store.PassAs<ValueStore>()));
101 blacklist_.reset(new Blacklist(ExtensionPrefs::Get(profile_))); 101 blacklist_.reset(new Blacklist(ExtensionPrefs::Get(profile_)));
102 management_policy_.reset(new ManagementPolicy()); 102 management_policy_.reset(new ManagementPolicy());
103 management_policy_->RegisterProvider( 103 management_policy_->RegisterProviders(
104 ExtensionManagementFactory::GetForBrowserContext(profile_) 104 ExtensionManagementFactory::GetForBrowserContext(profile_)
105 ->GetProvider()); 105 ->GetProviders());
106 runtime_data_.reset(new RuntimeData(ExtensionRegistry::Get(profile_))); 106 runtime_data_.reset(new RuntimeData(ExtensionRegistry::Get(profile_)));
107 extension_service_.reset(new ExtensionService(profile_, 107 extension_service_.reset(new ExtensionService(profile_,
108 command_line, 108 command_line,
109 install_directory, 109 install_directory,
110 ExtensionPrefs::Get(profile_), 110 ExtensionPrefs::Get(profile_),
111 blacklist_.get(), 111 blacklist_.get(),
112 autoupdate_enabled, 112 autoupdate_enabled,
113 true, 113 true,
114 &ready_)); 114 &ready_));
115 extension_service_->ClearProvidersForTesting(); 115 extension_service_->ClearProvidersForTesting();
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 } 215 }
216 return master; 216 return master;
217 } 217 }
218 218
219 // static 219 // static
220 KeyedService* TestExtensionSystem::Build(content::BrowserContext* profile) { 220 KeyedService* TestExtensionSystem::Build(content::BrowserContext* profile) {
221 return new TestExtensionSystem(static_cast<Profile*>(profile)); 221 return new TestExtensionSystem(static_cast<Profile*>(profile));
222 } 222 }
223 223
224 } // namespace extensions 224 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698