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

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: fix memory leaks Created 6 years, 1 month 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 CreateExtensionPrefs(command_line, install_directory); 82 CreateExtensionPrefs(command_line, install_directory);
83 install_verifier_.reset( 83 install_verifier_.reset(
84 new InstallVerifier(ExtensionPrefs::Get(profile_), profile_)); 84 new InstallVerifier(ExtensionPrefs::Get(profile_), profile_));
85 // The ownership of |value_store_| is immediately transferred to state_store_, 85 // The ownership of |value_store_| is immediately transferred to state_store_,
86 // but we keep a naked pointer to the TestingValueStore. 86 // but we keep a naked pointer to the TestingValueStore.
87 scoped_ptr<TestingValueStore> value_store(new TestingValueStore()); 87 scoped_ptr<TestingValueStore> value_store(new TestingValueStore());
88 value_store_ = value_store.get(); 88 value_store_ = value_store.get();
89 state_store_.reset(new StateStore(profile_, value_store.Pass())); 89 state_store_.reset(new StateStore(profile_, value_store.Pass()));
90 blacklist_.reset(new Blacklist(ExtensionPrefs::Get(profile_))); 90 blacklist_.reset(new Blacklist(ExtensionPrefs::Get(profile_)));
91 management_policy_.reset(new ManagementPolicy()); 91 management_policy_.reset(new ManagementPolicy());
92 management_policy_->RegisterProvider( 92 management_policy_->RegisterProviders(
93 ExtensionManagementFactory::GetForBrowserContext(profile_) 93 ExtensionManagementFactory::GetForBrowserContext(profile_)
94 ->GetProvider()); 94 ->GetProviders());
95 runtime_data_.reset(new RuntimeData(ExtensionRegistry::Get(profile_))); 95 runtime_data_.reset(new RuntimeData(ExtensionRegistry::Get(profile_)));
96 extension_service_.reset(new ExtensionService(profile_, 96 extension_service_.reset(new ExtensionService(profile_,
97 command_line, 97 command_line,
98 install_directory, 98 install_directory,
99 ExtensionPrefs::Get(profile_), 99 ExtensionPrefs::Get(profile_),
100 blacklist_.get(), 100 blacklist_.get(),
101 autoupdate_enabled, 101 autoupdate_enabled,
102 true, 102 true,
103 &ready_)); 103 &ready_));
104 extension_service_->ClearProvidersForTesting(); 104 extension_service_->ClearProvidersForTesting();
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 } 200 }
201 return master; 201 return master;
202 } 202 }
203 203
204 // static 204 // static
205 KeyedService* TestExtensionSystem::Build(content::BrowserContext* profile) { 205 KeyedService* TestExtensionSystem::Build(content::BrowserContext* profile) {
206 return new TestExtensionSystem(static_cast<Profile*>(profile)); 206 return new TestExtensionSystem(static_cast<Profile*>(profile));
207 } 207 }
208 208
209 } // namespace extensions 209 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698