OLD | NEW |
---|---|
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tab_contents/tab_util.h" | 5 #include "chrome/browser/tab_contents/tab_util.h" |
6 | 6 |
7 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | |
7 #include "content/browser/renderer_host/render_process_host.h" | 8 #include "content/browser/renderer_host/render_process_host.h" |
8 #include "content/browser/renderer_host/render_view_host.h" | 9 #include "content/browser/renderer_host/render_view_host.h" |
9 #include "content/browser/tab_contents/tab_contents.h" | 10 #include "content/browser/tab_contents/tab_contents.h" |
10 | 11 |
11 TabContents* tab_util::GetTabContentsByID(int render_process_id, | 12 TabContents* tab_util::GetTabContentsByID(int render_process_host_id, |
12 int render_view_id) { | 13 int routing_id) { |
13 RenderViewHost* render_view_host = | 14 RenderViewHost* render_view_host = |
14 RenderViewHost::FromID(render_process_id, render_view_id); | 15 RenderViewHost::FromID(render_process_host_id, routing_id); |
15 if (!render_view_host) | 16 if (!render_view_host) |
16 return NULL; | 17 return NULL; |
17 | 18 |
18 return render_view_host->delegate()->GetAsTabContents(); | 19 return render_view_host->delegate()->GetAsTabContents(); |
19 } | 20 } |
21 | |
22 TabContentsWrapper* tab_util::GetTabContentsWrapperByID( | |
jam
2011/05/13 06:22:02
note: we want to get rid of GetAsTabContents() sin
| |
23 int render_process_host_id, int routing_id) { | |
24 TabContents* tab = GetTabContentsByID(render_process_host_id, routing_id); | |
25 if (!tab) | |
26 return NULL; | |
27 | |
28 return TabContentsWrapper::GetCurrentWrapperForContents(tab); | |
29 } | |
30 | |
OLD | NEW |