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

Unified Diff: chrome/browser/extensions/extensions_service.cc

Issue 3462016: Disabled external_extensions.json and chrome://extensions in Guest mode. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Removed unnecessary code Created 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extensions_service.cc
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index e87e744b70437c47d7e490b3620c9f953d99ead1..e2e6342c4eae061db991e5818610034fd54899ea 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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698