diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-04 07:58:34 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-04 07:58:34 +0000 |
commit | 57c6a6579cf274fe37d6196931a3034d90da7113 (patch) | |
tree | ec42313580156ccc039b5fee714ee12259cb08ee /chrome/browser/renderer_host | |
parent | b23c9e1f05d474adc327c85d87eacc77554976e0 (diff) | |
download | chromium_src-57c6a6579cf274fe37d6196931a3034d90da7113.zip chromium_src-57c6a6579cf274fe37d6196931a3034d90da7113.tar.gz chromium_src-57c6a6579cf274fe37d6196931a3034d90da7113.tar.bz2 |
Replace all occurrances of WebContents with TabContents.
Review URL: http://codereview.chromium.org/99177
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15194 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
14 files changed, 59 insertions, 59 deletions
diff --git a/chrome/browser/renderer_host/browser_render_process_host.h b/chrome/browser/renderer_host/browser_render_process_host.h index b7e3631..d9e9fe4 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.h +++ b/chrome/browser/renderer_host/browser_render_process_host.h @@ -25,7 +25,7 @@ class CommandLine; class GURL; class RendererMainThread; class RenderWidgetHelper; -class WebContents; +class TabContents; namespace gfx { class Size; @@ -42,7 +42,7 @@ class Size; // // This object communicates back and forth with the RenderProcess object // running in the renderer process. Each RenderProcessHost and RenderProcess -// keeps a list of RenderView (renderer) and WebContents (browser) which +// keeps a list of RenderView (renderer) and TabContents (browser) which // are correlated with IDs. This way, the Views and the corresponding ViewHosts // communicate through the two process objects. class BrowserRenderProcessHost : public RenderProcessHost, diff --git a/chrome/browser/renderer_host/cross_site_resource_handler.cc b/chrome/browser/renderer_host/cross_site_resource_handler.cc index 1e25f17..5064a34 100644 --- a/chrome/browser/renderer_host/cross_site_resource_handler.cc +++ b/chrome/browser/renderer_host/cross_site_resource_handler.cc @@ -8,11 +8,11 @@ #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/tab_contents/tab_util.h" -#include "chrome/browser/tab_contents/web_contents.h" +#include "chrome/browser/tab_contents/tab_contents.h" namespace { -// Task to notify the WebContents that a cross-site response has begun, so that -// WebContents can tell the old page to run its onunload handler. +// Task to notify the TabContents that a cross-site response has begun, so that +// TabContents can tell the old page to run its onunload handler. class CrossSiteNotifyTabTask : public Task { public: CrossSiteNotifyTabTask(int render_process_host_id, @@ -48,10 +48,10 @@ class CancelPendingRenderViewTask : public Task { render_view_id_(render_view_id) {} void Run() { - WebContents* web_contents = - tab_util::GetWebContentsByID(render_process_host_id_, render_view_id_); - if (web_contents) - web_contents->CrossSiteNavigationCanceled(); + TabContents* tab_contents = + tab_util::GetTabContentsByID(render_process_host_id_, render_view_id_); + if (tab_contents) + tab_contents->CrossSiteNavigationCanceled(); } private: @@ -174,7 +174,7 @@ bool CrossSiteResourceHandler::OnResponseCompleted( } // We can now send the response to the new renderer, which will cause -// WebContents to swap in the new renderer and destroy the old one. +// TabContents to swap in the new renderer and destroy the old one. void CrossSiteResourceHandler::ResumeResponse() { DCHECK(request_id_ != -1); DCHECK(in_cross_site_transition_); diff --git a/chrome/browser/renderer_host/cross_site_resource_handler.h b/chrome/browser/renderer_host/cross_site_resource_handler.h index 2ae2c75..b741aa0 100644 --- a/chrome/browser/renderer_host/cross_site_resource_handler.h +++ b/chrome/browser/renderer_host/cross_site_resource_handler.h @@ -32,7 +32,7 @@ class CrossSiteResourceHandler : public ResourceHandler { const std::string& security_info); // We can now send the response to the new renderer, which will cause - // WebContents to swap in the new renderer and destroy the old one. + // TabContents to swap in the new renderer and destroy the old one. void ResumeResponse(); private: diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index c3d7aeb..5a0a0cf 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -25,7 +25,7 @@ #include "chrome/browser/renderer_host/render_widget_host_view.h" #include "chrome/browser/tab_contents/navigation_entry.h" #include "chrome/browser/tab_contents/site_instance.h" -#include "chrome/browser/tab_contents/web_contents.h" +#include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/bindings_policy.h" #include "chrome/common/notification_service.h" #include "chrome/common/notification_type.h" @@ -219,7 +219,7 @@ void RenderViewHost::DoNavigate(ViewMsg_Navigate* nav_message) { if (navigations_suspended_) { // Shouldn't be possible to have a second navigation while suspended, since // navigations will only be suspended during a cross-site request. If a - // second navigation occurs, WebContents will cancel this pending RVH + // second navigation occurs, TabContents will cancel this pending RVH // create a new pending RVH. DCHECK(!suspended_nav_message_.get()); suspended_nav_message_.reset(nav_message); diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h index b86b5f5..b43e3ce 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -60,16 +60,16 @@ struct WebApplicationInfo; // // The intent of this class is to provide a view-agnostic communication // conduit with a renderer. This is so we can build HTML views not only as -// TabContents (see WebContents for an example) but also as views, etc. +// TabContents (see TabContents for an example) but also as views, etc. // // The exact API of this object needs to be more thoroughly designed. Right -// now it mimics what WebContents exposed, which is a fairly large API and may +// now it mimics what TabContents exposed, which is a fairly large API and may // contain things that are not relevant to a common subset of views. See also // the comment in render_view_host_delegate.h about the size and scope of the // delegate API. // // Right now, the concept of page navigation (both top level and frame) exists -// in the WebContents still, so if you instantiate one of these elsewhere, you +// in the TabContents still, so if you instantiate one of these elsewhere, you // will not be able to traverse pages back and forward. We need to determine // if we want to bring that and other functionality down into this object so // it can be shared by others. @@ -599,8 +599,8 @@ class RenderViewHost : public RenderWidgetHost { bool navigations_suspended_; // We only buffer a suspended navigation message while we a pending RVH for a - // WebContents. There will only ever be one suspended navigation, because - // WebContents will destroy the pending RVH and create a new one if a second + // TabContents. There will only ever be one suspended navigation, because + // TabContents will destroy the pending RVH and create a new one if a second // navigation occurs. scoped_ptr<ViewMsg_Navigate> suspended_nav_message_; diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h index fe49c4d..a52196e 100644 --- a/chrome/browser/renderer_host/render_view_host_delegate.h +++ b/chrome/browser/renderer_host/render_view_host_delegate.h @@ -28,7 +28,7 @@ class Profile; class RenderProcessHost; class RenderViewHost; class SkBitmap; -class WebContents; +class TabContents; class WebKeyboardEvent; struct ThumbnailScore; struct ContextMenuParams; @@ -56,7 +56,7 @@ struct WebApplicationInfo; // of the RenderViewHost. // // This interface currently encompasses every type of message that was -// previously being sent by WebContents itself. Some of these notifications +// previously being sent by TabContents itself. Some of these notifications // may not be relevant to all users of RenderViewHost and we should consider // exposing a more generic Send function on RenderViewHost and a response // listener here to serve that need. @@ -158,8 +158,8 @@ class RenderViewHostDelegate { return NULL; } - // Return this object cast to a WebContents, if it is one. - virtual WebContents* GetAsWebContents() { return NULL; } + // Return this object cast to a TabContents, if it is one. + virtual TabContents* GetAsTabContents() { return NULL; } // The RenderView is being constructed (message sent to the renderer process // to construct a RenderView). Now is a good time to send other setup events diff --git a/chrome/browser/renderer_host/render_widget_helper.h b/chrome/browser/renderer_host/render_widget_helper.h index e1b306e..0e1641b 100644 --- a/chrome/browser/renderer_host/render_widget_helper.h +++ b/chrome/browser/renderer_host/render_widget_helper.h @@ -65,7 +65,7 @@ class ResourceDispatcherHost; // is restored, it can be momentarily without a backingstore. (Restoring a // RenderWidgetHost results in a WasRestored message being sent to the // RenderWidget, which triggers a full PaintRect message.) This can lead to -// an observed rendering glitch as the WebContents will just have to fill +// an observed rendering glitch as the TabContents will just have to fill // white overtop the RenderWidgetHost until the RenderWidgetHost receives a // PaintRect message to refresh its backingstore. // diff --git a/chrome/browser/renderer_host/render_widget_host.h b/chrome/browser/renderer_host/render_widget_host.h index 861152a..27cb467 100644 --- a/chrome/browser/renderer_host/render_widget_host.h +++ b/chrome/browser/renderer_host/render_widget_host.h @@ -47,35 +47,35 @@ struct ViewHostMsg_ScrollRect_Params; // There are two situations in which this object, a RenderWidgetHost, can be // instantiated: // -// 1. By a WebContents as the communication conduit for a rendered web page. -// The WebContents instantiates a derived class: RenderViewHost. -// 2. By a WebContents as the communication conduit for a select widget. The -// WebContents instantiates the RenderWidgetHost directly. +// 1. By a TabContents as the communication conduit for a rendered web page. +// The TabContents instantiates a derived class: RenderViewHost. +// 2. By a TabContents as the communication conduit for a select widget. The +// TabContents instantiates the RenderWidgetHost directly. // -// For every WebContents there are several objects in play that need to be +// For every TabContents there are several objects in play that need to be // properly destroyed or cleaned up when certain events occur. // -// - WebContents - the TabContents itself, and its associated HWND. +// - TabContents - the TabContents itself, and its associated HWND. // - RenderViewHost - representing the communication conduit with the child // process. // - RenderWidgetHostView - the view of the web page content, message handler, // and plugin root. // -// Normally, the WebContents contains a child RenderWidgetHostView that renders +// Normally, the TabContents contains a child RenderWidgetHostView that renders // the contents of the loaded page. It has a WS_CLIPCHILDREN style so that it // does no painting of its own. // // The lifetime of the RenderWidgetHostView is tied to the render process. If // the render process dies, the RenderWidgetHostView goes away and all -// references to it must become NULL. If the WebContents finds itself without a +// references to it must become NULL. If the TabContents finds itself without a // RenderWidgetHostView, it paints Sad Tab instead. // // RenderViewHost (a RenderWidgetHost subclass) is the conduit used to -// communicate with the RenderView and is owned by the WebContents. If the +// communicate with the RenderView and is owned by the TabContents. If the // render process crashes, the RenderViewHost remains and restarts the render // process if needed to continue navigation. // -// The WebContents is itself owned by the NavigationController in which it +// The TabContents is itself owned by the NavigationController in which it // resides. // // Some examples of how shutdown works: @@ -84,7 +84,7 @@ struct ViewHostMsg_ScrollRect_Params; // etc) the TabStrip destroys the associated NavigationController, which calls // Destroy on each TabContents it owns. // -// For a WebContents, its Destroy method tells the RenderViewHost to +// For a TabContents, its Destroy method tells the RenderViewHost to // shut down the render process and die. // // When the render process is destroyed it destroys the View: the @@ -92,19 +92,19 @@ struct ViewHostMsg_ScrollRect_Params; // // For select popups, the situation is a little different. The RenderWidgetHost // associated with the select popup owns the view and itself (is responsible -// for destroying itself when the view is closed). The WebContents's only +// for destroying itself when the view is closed). The TabContents's only // responsibility is to select popups is to create them when it is told to. When // the View is destroyed via an IPC message (for when WebCore destroys the // popup, e.g. if the user selects one of the options), or because // WM_CANCELMODE is received by the view, the View schedules the destruction of -// the render process. However in this case since there's no WebContents +// the render process. However in this case since there's no TabContents // container, when the render process is destroyed, the RenderWidgetHost just // deletes itself, which is safe because no one else should have any references -// to it (the WebContents does not). +// to it (the TabContents does not). // // It should be noted that the RenderViewHost, not the RenderWidgetHost, // handles IPC messages relating to the render process going away, since the -// way a RenderViewHost (WebContents) handles the process dying is different to +// way a RenderViewHost (TabContents) handles the process dying is different to // the way a select popup does. As such the RenderWidgetHostView handles these // messages for select popups. This placement is more out of convenience than // anything else. When the view is live, these messages are forwarded to it by diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm index d6f67fe..5058bec 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm +++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm @@ -115,7 +115,7 @@ void RenderWidgetHostViewMac::SetSize(const gfx::Size& size) { if (is_hidden_) return; - // TODO(avi): the WebContents object uses this method to size the newly + // TODO(avi): the TabContents object uses this method to size the newly // created widget to the correct size. At the time of this call, we're not yet // in the view hierarchy so |size| ends up being 0x0. However, this works for // us because we're using the Cocoa view struture and resizer flags to fix diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc index d13fac4..9eb27d1 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc @@ -990,14 +990,14 @@ LRESULT RenderWidgetHostViewWin::OnMouseEvent(UINT message, WPARAM wparam, } // TODO(jcampan): I am not sure if we should forward the message to the - // WebContents first in the case of popups. If we do, we would need to - // convert the click from the popup window coordinates to the WebContents' + // TabContents first in the case of popups. If we do, we would need to + // convert the click from the popup window coordinates to the TabContents' // window coordinates. For now we don't forward the message in that case to // address bug #907474. // Note: GetParent() on popup windows returns the top window and not the // parent the window was created with (the parent and the owner of the popup // is the first non-child view of the view that was specified to the create - // call). So the WebContents window would have to be specified to the + // call). So the TabContents window would have to be specified to the // RenderViewHostHWND as there is no way to retrieve it from the HWND. if (!close_on_deactivate_) { // Don't forward if the container is a popup. if (message == WM_LBUTTONDOWN) { @@ -1020,7 +1020,7 @@ LRESULT RenderWidgetHostViewWin::OnMouseEvent(UINT message, WPARAM wparam, case WM_MOUSEMOVE: case WM_MOUSELEAVE: case WM_RBUTTONDOWN: { - // Give the WebContents first crack at the message. It may want to + // Give the TabContents first crack at the message. It may want to // prevent forwarding to the renderer if some higher level browser // functionality is invoked. if (SendMessage(GetParent(), message, wparam, lparam) != 0) @@ -1117,8 +1117,8 @@ LRESULT RenderWidgetHostViewWin::OnWheelEvent(UINT message, WPARAM wparam, } // This is a bit of a hack, but will work for now since we don't want to - // pollute this object with WebContents-specific functionality... - bool handled_by_webcontents = false; + // pollute this object with TabContents-specific functionality... + bool handled_by_TabContents = false; if (GetParent()) { // Use a special reflected message to break recursion. If we send // WM_MOUSEWHEEL, the focus manager subclass of web contents will @@ -1129,12 +1129,12 @@ LRESULT RenderWidgetHostViewWin::OnWheelEvent(UINT message, WPARAM wparam, new_message.wParam = wparam; new_message.lParam = lparam; - handled_by_webcontents = + handled_by_TabContents = !!::SendMessage(GetParent(), views::kReflectedMessage, 0, reinterpret_cast<LPARAM>(&new_message)); } - if (!handled_by_webcontents) { + if (!handled_by_TabContents) { render_widget_host_->ForwardWheelEvent( WebInputEventFactory::mouseWheelEvent(m_hWnd, message, wparam, lparam)); diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc index 631ea6c..d78e79a 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc @@ -32,7 +32,7 @@ #include "chrome/browser/renderer_host/save_file_resource_handler.h" #include "chrome/browser/renderer_host/sync_resource_handler.h" #include "chrome/browser/tab_contents/tab_util.h" -#include "chrome/browser/tab_contents/web_contents.h" +#include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/notification_service.h" #include "chrome/common/render_messages.h" #include "chrome/common/stl_util-inl.h" @@ -1289,7 +1289,7 @@ class NotificationTask : public Task { void Run() { // Find the tab associated with this request. TabContents* tab_contents = - tab_util::GetWebContentsByID(process_id_, tab_contents_id_); + tab_util::GetTabContentsByID(process_id_, tab_contents_id_); if (tab_contents) { // Issue the notification. diff --git a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc index 4c410e3..f3b5a07 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc @@ -291,7 +291,7 @@ TEST_F(ResourceDispatcherTest, CrossSiteNavigationErrorPage) { // Check that renderer-initiated navigations still work. In a previous bug, // the ResourceDispatcherHost would think that such navigations were // cross-site, because we didn't clean up from the previous request. Since - // WebContents was in the NORMAL state, it would ignore the attempt to run + // TabContents was in the NORMAL state, it would ignore the attempt to run // the onunload handler, and the navigation would fail. // (Test by redirecting to javascript:window.location='someURL'.) GURL test_url(server->TestServerPageW(L"files/title2.html")); diff --git a/chrome/browser/renderer_host/test_render_view_host.cc b/chrome/browser/renderer_host/test_render_view_host.cc index 5117465..44001fd 100644 --- a/chrome/browser/renderer_host/test_render_view_host.cc +++ b/chrome/browser/renderer_host/test_render_view_host.cc @@ -79,16 +79,16 @@ void RenderViewHostTestHarness::SetUp() { if (!profile_.get()) profile_.reset(new TestingProfile()); - // This will be deleted when the WebContents goes away. + // This will be deleted when the TabContents goes away. SiteInstance* instance = SiteInstance::CreateSiteInstance(profile_.get()); - contents_.reset(new TestWebContents(profile_.get(), instance)); + contents_.reset(new TestTabContents(profile_.get(), instance)); } void RenderViewHostTestHarness::TearDown() { contents_.reset(); - // Make sure that we flush any messages related to WebContents destruction + // Make sure that we flush any messages related to TabContents destruction // before we destroy the profile. MessageLoop::current()->RunAllPending(); } diff --git a/chrome/browser/renderer_host/test_render_view_host.h b/chrome/browser/renderer_host/test_render_view_host.h index 0e93526..51acf2d 100644 --- a/chrome/browser/renderer_host/test_render_view_host.h +++ b/chrome/browser/renderer_host/test_render_view_host.h @@ -23,10 +23,10 @@ #include "chrome/common/temp_scaffolding_stubs.h" #endif -class TestWebContents; +class TestTabContents; // This file provides a testing framework for mocking out the RenderProcessHost -// layer. It allows you to test RenderViewHost, WebContents, +// layer. It allows you to test RenderViewHost, TabContents, // NavigationController, and other layers above that without running an actual // renderer process. // @@ -87,8 +87,8 @@ class TestRenderWidgetHostView : public RenderWidgetHostView { // TestRenderViewHost ---------------------------------------------------------- -// TODO(brettw) this should use a TestWebContents which should be generalized -// from the WebContents test. We will probably also need that class' version of +// TODO(brettw) this should use a TestTabContents which should be generalized +// from the TabContents test. We will probably also need that class' version of // CreateRenderViewForRenderManager when more complicate tests start using this. class TestRenderViewHost : public RenderViewHost { public: @@ -193,7 +193,7 @@ class RenderViewHostTestHarness : public testing::Test { return contents_->controller(); } - TestWebContents* contents() { + TestTabContents* contents() { return contents_.get(); } @@ -234,7 +234,7 @@ class RenderViewHostTestHarness : public testing::Test { MockRenderProcessHostFactory rph_factory_; TestRenderViewHostFactory rvh_factory_; - scoped_ptr<TestWebContents> contents_; + scoped_ptr<TestTabContents> contents_; DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); }; |