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

Unified Diff: chrome/test/base/testing_profile.cc

Issue 8060017: Ensure that --disable-extensions disables extension prefs from being enacted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed mnissler's comments Created 9 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/base/testing_profile.cc
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
index 8c1334596d86e7e32f61dde750e3e5bb4b45651a..8bb5c1b5485f62ef2b30dd2c2a3b7ef3b5022001 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -41,6 +41,7 @@
#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_notification_types.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/bookmark_load_observer.h"
#include "chrome/test/base/test_url_request_context_getter.h"
@@ -342,6 +343,10 @@ ExtensionService* TestingProfile::CreateExtensionService(
// Extension pref store, created for use by |extension_prefs_|.
extension_pref_value_map_.reset(new ExtensionPrefValueMap);
+
+ bool extensions_disabled =
+ command_line && command_line->HasSwitch(switches::kDisableExtensions);
+
// Note that the GetPrefs() creates a TestingPrefService, therefore
// the extension controlled pref values set in extension_prefs_
// are not reflected in the pref service. One would need to
@@ -349,7 +354,8 @@ ExtensionService* TestingProfile::CreateExtensionService(
extension_prefs_.reset(
new ExtensionPrefs(GetPrefs(),
install_directory,
- extension_pref_value_map_.get()));
+ extension_pref_value_map_.get(),
+ extensions_disabled));
extension_service_.reset(new ExtensionService(this,
command_line,
install_directory,
« chrome/browser/profiles/profile_impl.cc ('K') | « chrome/browser/profiles/profile_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698