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

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

Issue 567037: Initial work on making extensions work in incognito mode. (Closed)
Patch Set: added experimental requirement Created 10 years, 10 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/browser/extensions/extensions_service.cc
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index 7dddfa986790f0555b2c8f6707b3cfce88b2bca9..476f640f58fe64d813b8c0f801a443f6a4e8fdf0 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -529,6 +529,16 @@ base::Time ExtensionsService::LastPingDay(const std::string& extension_id) {
return extension_prefs_->LastPingDay(extension_id);
}
+bool ExtensionsService::IsIncognitoEnabled(const std::string& extension_id) {
+ Extension* extension = GetExtensionById(extension_id, true);
+ if (!extension)
+ return false;
+
+ return extension_prefs_->IsIncognitoEnabled(extension_id) &&
+ extension->HasApiPermission(Extension::kExperimentalPermission) &&
+ extension->HasApiPermission(Extension::kIncognitoPermission);
+}
+
void ExtensionsService::CheckForExternalUpdates() {
// This installs or updates externally provided extensions.
// TODO(aa): Why pass this list into the provider, why not just filter it
« no previous file with comments | « chrome/browser/extensions/extensions_service.h ('k') | chrome/browser/extensions/incognito_noscript_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698