summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authoravayvod@chromium.org <avayvod@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-28 08:25:14 +0000
committeravayvod@chromium.org <avayvod@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-28 08:25:14 +0000
commit1f830eb0bdf991843bfb0fe26dc1970318475e71 (patch)
treec8cfa1a6705d12ff1aa2143714eedcfa1b036b21 /chrome
parent3967969eac7bd8acb4ab87cfbc59dc6662a01316 (diff)
downloadchromium_src-1f830eb0bdf991843bfb0fe26dc1970318475e71.zip
chromium_src-1f830eb0bdf991843bfb0fe26dc1970318475e71.tar.gz
chromium_src-1f830eb0bdf991843bfb0fe26dc1970318475e71.tar.bz2
Disabled external_extensions.json in Guest mode.
Added browser_defaults::extensions_enabled to control this behavior. BUG=chromiumos:4420 TEST=Go to Guest mode and verify that no extensions are loaded by going to chrome://extensions. Review URL: http://codereview.chromium.org/3462016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60759 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/extensions/extensions_service.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index e87e744..e2e6342 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -180,10 +180,11 @@ class ExtensionsServiceBackend
: public base::RefCountedThreadSafe<ExtensionsServiceBackend>,
public ExternalExtensionProvider::Visitor {
public:
- // |rdh| can be NULL in the case of test environment.
- // |extension_prefs| contains a dictionary value that points to the extension
- // preferences.
- explicit ExtensionsServiceBackend(const FilePath& install_directory);
+ // |install_directory| is a path where to look for extensions to load.
+ // |load_external_extensions| indicates whether or not backend should load
+ // external extensions listed in JSON file and Windows registry.
+ ExtensionsServiceBackend(const FilePath& install_directory,
+ bool load_external_extensions);
// Loads a single extension from |path| where |path| is the top directory of
// a specific extension where its manifest file lives.
@@ -285,11 +286,15 @@ class ExtensionsServiceBackend
};
ExtensionsServiceBackend::ExtensionsServiceBackend(
- const FilePath& install_directory)
+ const FilePath& install_directory,
+ bool load_external_extensions)
: frontend_(NULL),
install_directory_(install_directory),
alert_on_error_(false),
external_extension_added_(false) {
+ if (!load_external_extensions)
+ return;
+
// TODO(aa): This ends up doing blocking IO on the UI thread because it reads
// pref data in the ctor and that is called on the UI thread. Would be better
// to re-read data each time we list external extensions, anyway.
@@ -556,7 +561,8 @@ ExtensionsService::ExtensionsService(Profile* profile,
updater_ = new ExtensionUpdater(this, prefs, update_frequency);
}
- backend_ = new ExtensionsServiceBackend(install_directory_);
+ backend_ = new ExtensionsServiceBackend(install_directory_,
+ extensions_enabled_);
// Use monochrome icons for Omnibox icons.
omnibox_popup_icon_manager_.set_monochrome(true);