Chromium Code Reviews| Index: chrome/browser/tab_contents/tab_util.cc |
| diff --git a/chrome/browser/tab_contents/tab_util.cc b/chrome/browser/tab_contents/tab_util.cc |
| index cef319d4fd018f26ae5d59dd679cbcb6b2d7bc3e..da8c963af77f65e120dd77ad01b7e6f9d59dcc94 100644 |
| --- a/chrome/browser/tab_contents/tab_util.cc |
| +++ b/chrome/browser/tab_contents/tab_util.cc |
| @@ -1,19 +1,30 @@ |
| -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| #include "chrome/browser/tab_contents/tab_util.h" |
| +#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/tab_contents.h" |
| -TabContents* tab_util::GetTabContentsByID(int render_process_id, |
| - int render_view_id) { |
| +TabContents* tab_util::GetTabContentsByID(int render_process_host_id, |
| + int routing_id) { |
| RenderViewHost* render_view_host = |
| - RenderViewHost::FromID(render_process_id, render_view_id); |
| + RenderViewHost::FromID(render_process_host_id, routing_id); |
| if (!render_view_host) |
| return NULL; |
| return render_view_host->delegate()->GetAsTabContents(); |
| } |
| + |
| +TabContentsWrapper* tab_util::GetTabContentsWrapperByID( |
|
jam
2011/05/13 06:22:02
note: we want to get rid of GetAsTabContents() sin
|
| + int render_process_host_id, int routing_id) { |
| + TabContents* tab = GetTabContentsByID(render_process_host_id, routing_id); |
| + if (!tab) |
| + return NULL; |
| + |
| + return TabContentsWrapper::GetCurrentWrapperForContents(tab); |
| +} |
| + |