| 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 c07da6fdba3470fe2fab39fba880be11da859ae2..a52d8462d25481aea545e5a11703403c560c5621 100644
|
| --- a/chrome/browser/extensions/extension_tab_id_map.cc
|
| +++ b/chrome/browser/extensions/extension_tab_id_map.cc
|
| @@ -12,6 +12,7 @@
|
| #include "content/browser/tab_contents/tab_contents.h"
|
| #include "content/browser/renderer_host/render_view_host.h"
|
| #include "content/browser/renderer_host/render_process_host.h"
|
| +#include "content/browser/tab_contents/navigation_details.h"
|
| #include "content/public/browser/notification_registrar.h"
|
| #include "content/public/browser/notification_observer.h"
|
| #include "content/public/browser/notification_service.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(
|
|
|