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

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

Issue 8404046: When creating a tab contents for a browser in the RVHDelegateHelper, create a wrapper immediately. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_webrequest_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_tab_id_map.cc
diff --git a/chrome/browser/extensions/extension_tab_id_map.cc b/chrome/browser/extensions/extension_tab_id_map.cc
index 63c2fe71d4486132b763276739b4bf810711ffa7..f6954190a1e983d53a45b967c6ae9a2474bd87e3 100644
--- a/chrome/browser/extensions/extension_tab_id_map.cc
+++ b/chrome/browser/extensions/extension_tab_id_map.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "content/browser/renderer_host/render_process_host.h"
#include "content/browser/renderer_host/render_view_host.h"
+#include "content/browser/tab_contents/navigation_details.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_observer.h"
@@ -46,6 +47,8 @@ ExtensionTabIdMap::TabObserver::TabObserver() {
content::NotificationService::AllBrowserContextsAndSources());
registrar_.Add(this, content::NOTIFICATION_TAB_PARENTED,
content::NotificationService::AllBrowserContextsAndSources());
+ registrar_.Add(this, content::NOTIFICATION_RETARGETING,
+ content::NotificationService::AllBrowserContextsAndSources());
}
ExtensionTabIdMap::TabObserver::~TabObserver() {
@@ -89,6 +92,25 @@ void ExtensionTabIdMap::TabObserver::Observe(
tab->restore_tab_helper()->window_id().id()));
break;
}
+ case content::NOTIFICATION_RETARGETING: {
+ content::RetargetingDetails* retargeting_details =
+ content::Details<content::RetargetingDetails>(details).ptr();
+ TabContents* contents = retargeting_details->target_tab_contents;
+ TabContentsWrapper* tab =
+ TabContentsWrapper::GetCurrentWrapperForContents(contents);
+ if (!tab)
+ break;
+ RenderViewHost* host = tab->render_view_host();
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(
+ &ExtensionTabIdMap::SetTabAndWindowId,
+ base::Unretained(ExtensionTabIdMap::GetInstance()),
+ host->process()->id(), host->routing_id(),
+ tab->restore_tab_helper()->session_id().id(),
+ tab->restore_tab_helper()->window_id().id()));
+ break;
+ }
case content::NOTIFICATION_RENDER_VIEW_HOST_DELETED: {
RenderViewHost* host = content::Source<RenderViewHost>(source).ptr();
BrowserThread::PostTask(
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_webrequest_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698