| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/extensions/extension_tab_id_map.h" | 5 #include "chrome/browser/extensions/extension_tab_id_map.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "chrome/browser/sessions/session_tab_helper.h" | 9 #include "chrome/browser/sessions/session_tab_helper.h" |
| 10 #include "chrome/browser/tab_contents/retargeting_details.h" | 10 #include "chrome/browser/tab_contents/retargeting_details.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 BrowserThread::IO, FROM_HERE, | 79 BrowserThread::IO, FROM_HERE, |
| 80 base::Bind( | 80 base::Bind( |
| 81 &ExtensionTabIdMap::SetTabAndWindowId, | 81 &ExtensionTabIdMap::SetTabAndWindowId, |
| 82 base::Unretained(ExtensionTabIdMap::GetInstance()), | 82 base::Unretained(ExtensionTabIdMap::GetInstance()), |
| 83 host->GetProcess()->GetID(), host->GetRoutingID(), | 83 host->GetProcess()->GetID(), host->GetRoutingID(), |
| 84 session_tab_helper->session_id().id(), | 84 session_tab_helper->session_id().id(), |
| 85 session_tab_helper->window_id().id())); | 85 session_tab_helper->window_id().id())); |
| 86 break; | 86 break; |
| 87 } | 87 } |
| 88 case chrome::NOTIFICATION_TAB_PARENTED: { | 88 case chrome::NOTIFICATION_TAB_PARENTED: { |
| 89 TabContents* tab = content::Source<TabContents>(source).ptr(); | 89 WebContents* web_contents = content::Source<WebContents>(source).ptr(); |
| 90 WebContents* web_contents = tab->web_contents(); | |
| 91 SessionTabHelper* session_tab_helper = | 90 SessionTabHelper* session_tab_helper = |
| 92 SessionTabHelper::FromWebContents(web_contents); | 91 SessionTabHelper::FromWebContents(web_contents); |
| 93 if (!session_tab_helper) | 92 if (!session_tab_helper) |
| 94 return; | 93 return; |
| 95 RenderViewHost* host = web_contents->GetRenderViewHost(); | 94 RenderViewHost* host = web_contents->GetRenderViewHost(); |
| 96 BrowserThread::PostTask( | 95 BrowserThread::PostTask( |
| 97 BrowserThread::IO, FROM_HERE, | 96 BrowserThread::IO, FROM_HERE, |
| 98 base::Bind( | 97 base::Bind( |
| 99 &ExtensionTabIdMap::SetTabAndWindowId, | 98 &ExtensionTabIdMap::SetTabAndWindowId, |
| 100 base::Unretained(ExtensionTabIdMap::GetInstance()), | 99 base::Unretained(ExtensionTabIdMap::GetInstance()), |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 179 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 181 RenderId render_id(render_process_host_id, routing_id); | 180 RenderId render_id(render_process_host_id, routing_id); |
| 182 TabAndWindowIdMap::iterator iter = map_.find(render_id); | 181 TabAndWindowIdMap::iterator iter = map_.find(render_id); |
| 183 if (iter != map_.end()) { | 182 if (iter != map_.end()) { |
| 184 *tab_id = iter->second.first; | 183 *tab_id = iter->second.first; |
| 185 *window_id = iter->second.second; | 184 *window_id = iter->second.second; |
| 186 return true; | 185 return true; |
| 187 } | 186 } |
| 188 return false; | 187 return false; |
| 189 } | 188 } |
| OLD | NEW |