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

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

Issue 4090011: Fix bug with context menus in incognito mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: manifest fix Created 10 years, 2 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/extension_event_router.cc
diff --git a/chrome/browser/extensions/extension_event_router.cc b/chrome/browser/extensions/extension_event_router.cc
index b1577167774aecacdb6a025791075effdea66302..c03345445ff104262a492037cc24d6a2e13f5db8 100644
--- a/chrome/browser/extensions/extension_event_router.cc
+++ b/chrome/browser/extensions/extension_event_router.cc
@@ -33,17 +33,6 @@ static void DispatchEvent(RenderProcessHost* renderer,
extension_id, kDispatchEvent, args, event_url));
}
-static bool CanCrossIncognito(Profile* profile,
- const std::string& extension_id) {
- // We allow the extension to see events and data from another profile iff it
- // uses "spanning" behavior and it has incognito access. "split" mode
- // extensions only see events for a matching profile.
- const Extension* extension =
- profile->GetExtensionsService()->GetExtensionById(extension_id, false);
- return (profile->GetExtensionsService()->IsIncognitoEnabled(extension) &&
- !extension->incognito_split_mode());
-}
-
} // namespace
struct ExtensionEventRouter::EventListener {
@@ -63,6 +52,24 @@ struct ExtensionEventRouter::EventListener {
}
};
+// static
+bool ExtensionEventRouter::CanCrossIncognito(Profile* profile,
+ const std::string& extension_id) {
+ const Extension* extension =
+ profile->GetExtensionsService()->GetExtensionById(extension_id, false);
+ return CanCrossIncognito(profile, extension);
+}
+
+// static
+bool ExtensionEventRouter::CanCrossIncognito(Profile* profile,
+ const Extension* extension) {
+ // We allow the extension to see events and data from another profile iff it
+ // uses "spanning" behavior and it has incognito access. "split" mode
+ // extensions only see events for a matching profile.
+ return (profile->GetExtensionsService()->IsIncognitoEnabled(extension) &&
+ !extension->incognito_split_mode());
+}
+
ExtensionEventRouter::ExtensionEventRouter(Profile* profile)
: profile_(profile),
extension_devtools_manager_(profile->GetExtensionDevToolsManager()) {
« no previous file with comments | « chrome/browser/extensions/extension_event_router.h ('k') | chrome/browser/extensions/extension_menu_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698