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

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

Issue 7243012: Change many extension event routers to not be singletons and to be more profile-aware. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: bookmark remove observer Created 9 years, 6 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 | « chrome/browser/extensions/extension_webnavigation_api.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_webnavigation_api.cc
diff --git a/chrome/browser/extensions/extension_webnavigation_api.cc b/chrome/browser/extensions/extension_webnavigation_api.cc
index 04da675e5776353d2643a90987e0355ddd4486f2..513760e563ef1e5172222ee23294141a6bf8980d 100644
--- a/chrome/browser/extensions/extension_webnavigation_api.cc
+++ b/chrome/browser/extensions/extension_webnavigation_api.cc
@@ -247,16 +247,11 @@ void FrameNavigationState::RemoveTabContentsState(
// ExtensionWebNavigtionEventRouter -------------------------------------------
-ExtensionWebNavigationEventRouter::ExtensionWebNavigationEventRouter() {}
+ExtensionWebNavigationEventRouter::ExtensionWebNavigationEventRouter(
+ Profile* profile) : profile_(profile) {}
ExtensionWebNavigationEventRouter::~ExtensionWebNavigationEventRouter() {}
-// static
-ExtensionWebNavigationEventRouter*
-ExtensionWebNavigationEventRouter::GetInstance() {
- return Singleton<ExtensionWebNavigationEventRouter>::get();
-}
-
void ExtensionWebNavigationEventRouter::Init() {
if (registrar_.IsEmpty()) {
registrar_.Add(this,
@@ -284,10 +279,12 @@ void ExtensionWebNavigationEventRouter::Observe(
void ExtensionWebNavigationEventRouter::CreatingNewWindow(
TabContents* tab_contents,
const ViewHostMsg_CreateWindow_Params* details) {
- DispatchOnBeforeRetarget(tab_contents,
- tab_contents->profile(),
- details->opener_url,
- details->target_url);
+ if (profile_->IsSameProfile(tab_contents->profile())) {
+ DispatchOnBeforeRetarget(tab_contents,
+ tab_contents->profile(),
+ details->opener_url,
+ details->target_url);
+ }
}
« no previous file with comments | « chrome/browser/extensions/extension_webnavigation_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698