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); |
+ } |
} |