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

Unified Diff: extensions/browser/extension_util.cc

Issue 1351223003: Allow extensions to specify that they are not allowed in incognito mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add expectations for IncognitoInfo to test Created 5 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 | « extensions/browser/extension_util.h ('k') | extensions/common/extension.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_util.cc
diff --git a/extensions/browser/extension_util.cc b/extensions/browser/extension_util.cc
index d8dbe62e8396654c32c122d2938ac9d77102f2b1..23de13057948d4202e70473872f8961d63ec582e 100644
--- a/extensions/browser/extension_util.cc
+++ b/extensions/browser/extension_util.cc
@@ -7,6 +7,7 @@
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/manifest_handlers/app_isolation_info.h"
+#include "extensions/common/manifest_handlers/incognito_info.h"
namespace extensions {
namespace util {
@@ -48,5 +49,11 @@ bool SiteHasIsolatedStorage(const GURL& extension_site_url,
return extension && AppIsolationInfo::HasIsolatedStorage(extension);
}
+bool CanBeIncognitoEnabled(const Extension* extension) {
+ return IncognitoInfo::IsIncognitoAllowed(extension) &&
+ (!extension->is_platform_app() ||
+ extension->location() == Manifest::COMPONENT);
+}
+
} // namespace util
} // namespace extensions
« no previous file with comments | « extensions/browser/extension_util.h ('k') | extensions/common/extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698