Index: chrome/browser/extensions/extension_process_manager.cc |
diff --git a/chrome/browser/extensions/extension_process_manager.cc b/chrome/browser/extensions/extension_process_manager.cc |
index 1f8c9fb8e916a5a91aa6f6623354f9c3fbc8b8dc..d1ddbab867a547757fbcd557f47a95635b5af517 100644 |
--- a/chrome/browser/extensions/extension_process_manager.cc |
+++ b/chrome/browser/extensions/extension_process_manager.cc |
@@ -341,7 +341,7 @@ std::set<RenderViewHost*> |
} |
const Extension* ExtensionProcessManager::GetExtensionForRenderViewHost( |
- content::RenderViewHost* render_view_host) { |
+ RenderViewHost* render_view_host) { |
if (!render_view_host->GetSiteInstance()) |
return NULL; |
@@ -636,22 +636,20 @@ void ExtensionProcessManager::Observe( |
// navigation away from an extension URL). For the replaced case, we must |
// unregister the old RVH so it doesn't count as an active view that would |
// keep the event page alive. |
- content::WebContents* contents = |
- content::Source<content::WebContents>(source).ptr(); |
+ WebContents* contents = content::Source<WebContents>(source).ptr(); |
if (contents->GetBrowserContext() != GetProfile()) |
break; |
- content::RenderViewHost* old_render_view_host = |
- content::Details<content::RenderViewHost>(details).ptr(); |
- if (old_render_view_host) |
- UnregisterRenderViewHost(old_render_view_host); |
- RegisterRenderViewHost(contents->GetRenderViewHost()); |
+ typedef std::pair<RenderViewHost*, RenderViewHost*> RVHPair; |
+ RVHPair* switched_details = content::Details<RVHPair>(details).ptr(); |
+ if (switched_details->first) |
+ UnregisterRenderViewHost(switched_details->first); |
+ RegisterRenderViewHost(switched_details->second); |
break; |
} |
case content::NOTIFICATION_WEB_CONTENTS_CONNECTED: { |
- content::WebContents* contents = |
- content::Source<content::WebContents>(source).ptr(); |
+ WebContents* contents = content::Source<WebContents>(source).ptr(); |
if (contents->GetBrowserContext() != GetProfile()) |
break; |
const Extension* extension = GetExtensionForRenderViewHost( |
@@ -683,7 +681,7 @@ void ExtensionProcessManager::Observe( |
void ExtensionProcessManager::OnDevToolsStateChanged( |
content::DevToolsAgentHost* agent_host, bool attached) { |
- content::RenderViewHost* rvh = agent_host->GetRenderViewHost(); |
+ RenderViewHost* rvh = agent_host->GetRenderViewHost(); |
// Ignore unrelated notifications. |
if (!rvh || |
rvh->GetSiteInstance()->GetProcess()->GetBrowserContext() != GetProfile()) |