Commit ca13a448 authored by avi@chromium.org's avatar avi@chromium.org

TabContents -> WebContentsImpl, part 16

Remove "tab contents".

BUG=105875
TEST=no change

Review URL: https://chromiumcodereview.appspot.com/9956154

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132571 0039d316-1c4b-4281-b951-d872f2087c98
parent 93425b44
...@@ -114,7 +114,7 @@ class CONTENT_EXPORT BrowserAccessibilityManager { ...@@ -114,7 +114,7 @@ class CONTENT_EXPORT BrowserAccessibilityManager {
const BrowserAccessibility& node, gfx::Rect subfocus); const BrowserAccessibility& node, gfx::Rect subfocus);
// Tell the renderer to scroll such that |node| is at |point|, // Tell the renderer to scroll such that |node| is at |point|,
// where |point| is in global coordinates of the tab contents. // where |point| is in global coordinates of the WebContents.
void ScrollToPoint( void ScrollToPoint(
const BrowserAccessibility& node, gfx::Point point); const BrowserAccessibility& node, gfx::Point point);
......
...@@ -95,7 +95,7 @@ void BrowserPluginWebContentsObserver::OnOpenChannelToBrowserPlugin( ...@@ -95,7 +95,7 @@ void BrowserPluginWebContentsObserver::OnOpenChannelToBrowserPlugin(
browser_context, browser_context,
site_instance, site_instance,
MSG_ROUTING_NONE, MSG_ROUTING_NONE,
NULL, // base tab contents NULL, // base WebContents
NULL // session storage namespace NULL // session storage namespace
)); ));
// TODO(fsamuel): Set the WebContentsDelegate here. // TODO(fsamuel): Set the WebContentsDelegate here.
......
...@@ -65,7 +65,7 @@ TEST(WebContentsDelegateTest, UnregisterInDestructor) { ...@@ -65,7 +65,7 @@ TEST(WebContentsDelegateTest, UnregisterInDestructor) {
EXPECT_TRUE(contents_a->GetDelegate() == NULL); EXPECT_TRUE(contents_a->GetDelegate() == NULL);
EXPECT_TRUE(contents_b->GetDelegate() == NULL); EXPECT_TRUE(contents_b->GetDelegate() == NULL);
// Destroy the tab contents and run the message loop to prevent leaks. // Destroy the WebContentses and run the message loop to prevent leaks.
contents_a.reset(NULL); contents_a.reset(NULL);
contents_b.reset(NULL); contents_b.reset(NULL);
loop.RunAllPending(); loop.RunAllPending();
......
...@@ -302,8 +302,8 @@ WebContentsImpl::WebContentsImpl( ...@@ -302,8 +302,8 @@ WebContentsImpl::WebContentsImpl(
} }
CHECK(view_.get()); CHECK(view_.get());
// We have the initial size of the view be based on the size of the passed in // We have the initial size of the view be based on the size of the view of
// tab contents (normally a tab from the same window). // the passed in WebContents.
view_->CreateView(base_web_contents ? view_->CreateView(base_web_contents ?
base_web_contents->GetView()->GetContainerSize() : gfx::Size()); base_web_contents->GetView()->GetContainerSize() : gfx::Size());
...@@ -328,7 +328,7 @@ WebContentsImpl::~WebContentsImpl() { ...@@ -328,7 +328,7 @@ WebContentsImpl::~WebContentsImpl() {
NotifyDisconnected(); NotifyDisconnected();
// Notify any observer that have a reference on this tab contents. // Notify any observer that have a reference on this WebContents.
content::NotificationService::current()->Notify( content::NotificationService::current()->Notify(
content::NOTIFICATION_WEB_CONTENTS_DESTROYED, content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
content::Source<WebContents>(this), content::Source<WebContents>(this),
......
...@@ -584,7 +584,7 @@ class CONTENT_EXPORT WebContentsImpl ...@@ -584,7 +584,7 @@ class CONTENT_EXPORT WebContentsImpl
base::TerminationStatus crashed_status_; base::TerminationStatus crashed_status_;
int crashed_error_code_; int crashed_error_code_;
// Whether this tab contents is waiting for a first-response for the // Whether this WebContents is waiting for a first-response for the
// main resource of the page. This controls whether the throbber state is // main resource of the page. This controls whether the throbber state is
// "waiting" or "loading." // "waiting" or "loading."
bool waiting_for_response_; bool waiting_for_response_;
...@@ -622,8 +622,7 @@ class CONTENT_EXPORT WebContentsImpl ...@@ -622,8 +622,7 @@ class CONTENT_EXPORT WebContentsImpl
// Data for misc internal state ---------------------------------------------- // Data for misc internal state ----------------------------------------------
// Whether the tab contents is currently being screenshotted by the // Whether the WebContents is currently being screenshotted.
// DraggedTabController.
bool capturing_contents_; bool capturing_contents_;
// See getter above. // See getter above.
......
...@@ -139,8 +139,8 @@ class CONTENT_EXPORT WebContentsViewGtk : public WebContentsView { ...@@ -139,8 +139,8 @@ class CONTENT_EXPORT WebContentsViewGtk : public WebContentsView {
// hierarchy. // hierarchy.
scoped_ptr<WebContentsViewDelegate> delegate_; scoped_ptr<WebContentsViewDelegate> delegate_;
// The size we want the tab contents view to be. We keep this in a separate // The size we want the view to be. We keep this in a separate variable
// variable because resizing in GTK+ is async. // because resizing in GTK+ is async.
gfx::Size requested_size_; gfx::Size requested_size_;
DISALLOW_COPY_AND_ASSIGN(WebContentsViewGtk); DISALLOW_COPY_AND_ASSIGN(WebContentsViewGtk);
......
...@@ -47,7 +47,7 @@ WebDragDestGtk::WebDragDestGtk(WebContents* web_contents, GtkWidget* widget) ...@@ -47,7 +47,7 @@ WebDragDestGtk::WebDragDestGtk(WebContents* web_contents, GtkWidget* widget)
g_signal_connect(widget, "drag-data-received", g_signal_connect(widget, "drag-data-received",
G_CALLBACK(OnDragDataReceivedThunk), this); G_CALLBACK(OnDragDataReceivedThunk), this);
// TODO(tony): Need a drag-data-delete handler for moving content out of // TODO(tony): Need a drag-data-delete handler for moving content out of
// the tab contents. http://crbug.com/38989 // the WebContents. http://crbug.com/38989
destroy_handler_ = g_signal_connect( destroy_handler_ = g_signal_connect(
widget, "destroy", G_CALLBACK(gtk_widget_destroyed), &widget_); widget, "destroy", G_CALLBACK(gtk_widget_destroyed), &widget_);
......
...@@ -35,8 +35,7 @@ class CONTENT_EXPORT WebDragSourceGtk : public MessageLoopForUI::Observer { ...@@ -35,8 +35,7 @@ class CONTENT_EXPORT WebDragSourceGtk : public MessageLoopForUI::Observer {
explicit WebDragSourceGtk(WebContents* web_contents); explicit WebDragSourceGtk(WebContents* web_contents);
virtual ~WebDragSourceGtk(); virtual ~WebDragSourceGtk();
// Starts a drag for the tab contents this WebDragSourceGtk was // Starts a drag for the WebContents this WebDragSourceGtk was created for.
// created for.
void StartDragging(const WebDropData& drop_data, void StartDragging(const WebDropData& drop_data,
WebKit::WebDragOperationsMask allowed_ops, WebKit::WebDragOperationsMask allowed_ops,
GdkEventButton* last_mouse_down, GdkEventButton* last_mouse_down,
......
...@@ -113,7 +113,7 @@ void WebDragSource::Observe(int type, ...@@ -113,7 +113,7 @@ void WebDragSource::Observe(int type,
const content::NotificationSource& source, const content::NotificationSource& source,
const content::NotificationDetails& details) { const content::NotificationDetails& details) {
if (content::NOTIFICATION_WEB_CONTENTS_SWAPPED == type) { if (content::NOTIFICATION_WEB_CONTENTS_SWAPPED == type) {
// When the tab contents get swapped, our render view host goes away. // When the WebContents get swapped, our render view host goes away.
// That's OK, we can continue the drag, we just can't send messages back to // That's OK, we can continue the drag, we just can't send messages back to
// our drag source. // our drag source.
render_view_host_ = NULL; render_view_host_ = NULL;
......
...@@ -158,8 +158,8 @@ IPC_MESSAGE_ROUTED2(AccessibilityMsg_ScrollToMakeVisible, ...@@ -158,8 +158,8 @@ IPC_MESSAGE_ROUTED2(AccessibilityMsg_ScrollToMakeVisible,
gfx::Rect /* subfocus */) gfx::Rect /* subfocus */)
// Relay a request from assistive technology to move a given object // Relay a request from assistive technology to move a given object
// to a specific location, in the tab content area coordinate space, i.e. // to a specific location, in the WebContents area coordinate space, i.e.
// (0, 0) is the top-left corner of the tab contents. // (0, 0) is the top-left corner of the WebContents.
IPC_MESSAGE_ROUTED2(AccessibilityMsg_ScrollToPoint, IPC_MESSAGE_ROUTED2(AccessibilityMsg_ScrollToPoint,
int /* object id */, int /* object id */,
gfx::Point /* new location */) gfx::Point /* new location */)
......
...@@ -50,11 +50,12 @@ struct RendererPreferences; ...@@ -50,11 +50,12 @@ struct RendererPreferences;
// Describes what goes in the main content area of a tab. // Describes what goes in the main content area of a tab.
class WebContents : public PageNavigator { class WebContents : public PageNavigator {
public: public:
// |base_web_contents| is used if we want to size the new web contents view // |base_tab_contents| is used if we want to size the new WebContents's view
// based on an existing web contents view. This can be NULL if not needed. // based on the view of an existing WebContents. This can be NULL if not
// needed.
// //
// The session storage namespace parameter allows multiple render views and // The session storage namespace parameter allows multiple render views and
// tab contentses to share the same session storage (part of the WebStorage // web contentses to share the same session storage (part of the WebStorage
// spec) space. This is useful when restoring tabs, but most callers should // spec) space. This is useful when restoring tabs, but most callers should
// pass in NULL which will cause a new SessionStorageNamespace to be created. // pass in NULL which will cause a new SessionStorageNamespace to be created.
CONTENT_EXPORT static WebContents* Create( CONTENT_EXPORT static WebContents* Create(
...@@ -68,7 +69,7 @@ class WebContents : public PageNavigator { ...@@ -68,7 +69,7 @@ class WebContents : public PageNavigator {
// Intrinsic tab state ------------------------------------------------------- // Intrinsic tab state -------------------------------------------------------
// Returns the property bag for this tab contents, where callers can add // Returns the property bag for this WebContents, where callers can add
// extra data they may wish to associate with the tab. Returns a pointer // extra data they may wish to associate with the tab. Returns a pointer
// rather than a reference since the PropertyAccessors expect this. // rather than a reference since the PropertyAccessors expect this.
virtual const base::PropertyBag* GetPropertyBag() const = 0; virtual const base::PropertyBag* GetPropertyBag() const = 0;
...@@ -78,7 +79,7 @@ class WebContents : public PageNavigator { ...@@ -78,7 +79,7 @@ class WebContents : public PageNavigator {
virtual WebContentsDelegate* GetDelegate() = 0; virtual WebContentsDelegate* GetDelegate() = 0;
virtual void SetDelegate(WebContentsDelegate* delegate) = 0; virtual void SetDelegate(WebContentsDelegate* delegate) = 0;
// Gets the controller for this tab contents. // Gets the controller for this WebContents.
virtual NavigationController& GetController() = 0; virtual NavigationController& GetController() = 0;
virtual const NavigationController& GetController() const = 0; virtual const NavigationController& GetController() const = 0;
...@@ -143,10 +144,10 @@ class WebContents : public PageNavigator { ...@@ -143,10 +144,10 @@ class WebContents : public PageNavigator {
// returns the current SiteInstance. // returns the current SiteInstance.
virtual SiteInstance* GetPendingSiteInstance() const = 0; virtual SiteInstance* GetPendingSiteInstance() const = 0;
// Return whether this tab contents is loading a resource. // Return whether this WebContents is loading a resource.
virtual bool IsLoading() const = 0; virtual bool IsLoading() const = 0;
// Returns whether this tab contents is waiting for a first-response for the // Returns whether this WebContents is waiting for a first-response for the
// main resource of the page. // main resource of the page.
virtual bool IsWaitingForResponse() const = 0; virtual bool IsWaitingForResponse() const = 0;
...@@ -166,8 +167,8 @@ class WebContents : public PageNavigator { ...@@ -166,8 +167,8 @@ class WebContents : public PageNavigator {
// Internal state ------------------------------------------------------------ // Internal state ------------------------------------------------------------
// This flag indicates whether the tab contents is currently being // This flag indicates whether the WebContents is currently being
// screenshotted by the DraggedTabController. // screenshotted.
virtual void SetCapturingContents(bool cap) = 0; virtual void SetCapturingContents(bool cap) = 0;
// Indicates whether this tab should be considered crashed. The setter will // Indicates whether this tab should be considered crashed. The setter will
...@@ -186,12 +187,12 @@ class WebContents : public PageNavigator { ...@@ -186,12 +187,12 @@ class WebContents : public PageNavigator {
// change. See InvalidateType enum. // change. See InvalidateType enum.
virtual void NotifyNavigationStateChanged(unsigned changed_flags) = 0; virtual void NotifyNavigationStateChanged(unsigned changed_flags) = 0;
// Invoked when the tab contents becomes selected. If you override, be sure // Invoked when the WebContents becomes selected. If you override, be sure
// and invoke super's implementation. // and invoke super's implementation.
virtual void DidBecomeSelected() = 0; virtual void DidBecomeSelected() = 0;
virtual base::TimeTicks GetLastSelectedTime() const = 0; virtual base::TimeTicks GetLastSelectedTime() const = 0;
// Invoked when the tab contents becomes hidden. // Invoked when the WebContents becomes hidden.
// NOTE: If you override this, call the superclass version too! // NOTE: If you override this, call the superclass version too!
virtual void WasHidden() = 0; virtual void WasHidden() = 0;
...@@ -311,7 +312,7 @@ class WebContents : public PageNavigator { ...@@ -311,7 +312,7 @@ class WebContents : public PageNavigator {
virtual bool ShouldAcceptDragAndDrop() const = 0; virtual bool ShouldAcceptDragAndDrop() const = 0;
// A render view-originated drag has ended. Informs the render view host and // A render view-originated drag has ended. Informs the render view host and
// tab contents delegate. // WebContentsDelegate.
virtual void SystemDragEnded() = 0; virtual void SystemDragEnded() = 0;
// Indicates if this tab was explicitly closed by the user (control-w, close // Indicates if this tab was explicitly closed by the user (control-w, close
......
...@@ -77,7 +77,7 @@ class CONTENT_EXPORT WebContentsDelegate { ...@@ -77,7 +77,7 @@ class CONTENT_EXPORT WebContentsDelegate {
virtual WebContents* OpenURLFromTab(WebContents* source, virtual WebContents* OpenURLFromTab(WebContents* source,
const OpenURLParams& params); const OpenURLParams& params);
// Called to inform the delegate that the tab content's navigation state // Called to inform the delegate that the WebContents's navigation state
// changed. The |changed_flags| indicates the parts of the navigation state // changed. The |changed_flags| indicates the parts of the navigation state
// that have been updated, and is any combination of the // that have been updated, and is any combination of the
// |WebContents::InvalidateTypes| bits. // |WebContents::InvalidateTypes| bits.
...@@ -125,7 +125,7 @@ class CONTENT_EXPORT WebContentsDelegate { ...@@ -125,7 +125,7 @@ class CONTENT_EXPORT WebContentsDelegate {
// out so it can perform any cleanup necessary. // out so it can perform any cleanup necessary.
virtual void SwappedOut(WebContents* source) {} virtual void SwappedOut(WebContents* source) {}
// Request the delegate to move this tab contents to the specified position // Request the delegate to move this WebContents to the specified position
// in screen coordinates. // in screen coordinates.
virtual void MoveContents(WebContents* source, const gfx::Rect& pos) {} virtual void MoveContents(WebContents* source, const gfx::Rect& pos) {}
...@@ -233,7 +233,7 @@ class CONTENT_EXPORT WebContentsDelegate { ...@@ -233,7 +233,7 @@ class CONTENT_EXPORT WebContentsDelegate {
// Returns true if the context menu command was handled // Returns true if the context menu command was handled
virtual bool ExecuteContextMenuCommand(int command); virtual bool ExecuteContextMenuCommand(int command);
// Opens source view for given tab contents that is navigated to the given // Opens source view for given WebContents that is navigated to the given
// page url. // page url.
virtual void ViewSourceForTab(WebContents* source, const GURL& page_url); virtual void ViewSourceForTab(WebContents* source, const GURL& page_url);
...@@ -267,13 +267,13 @@ class CONTENT_EXPORT WebContentsDelegate { ...@@ -267,13 +267,13 @@ class CONTENT_EXPORT WebContentsDelegate {
// Returns true to allow WebContents to continue with the default processing. // Returns true to allow WebContents to continue with the default processing.
virtual bool OnGoToEntryOffset(int offset); virtual bool OnGoToEntryOffset(int offset);
// Returns whether this tab contents should add the specified navigation to // Returns whether this WebContents should add the specified navigation to
// history. // history.
virtual bool ShouldAddNavigationToHistory( virtual bool ShouldAddNavigationToHistory(
const history::HistoryAddPageArgs& add_page_args, const history::HistoryAddPageArgs& add_page_args,
NavigationType navigation_type); NavigationType navigation_type);
// Returns the native window framing the view containing the tab contents. // Returns the native window framing the view containing the WebContents.
virtual gfx::NativeWindow GetFrameNativeWindow(); virtual gfx::NativeWindow GetFrameNativeWindow();
// Allows delegate to control whether a WebContents will be created. Returns // Allows delegate to control whether a WebContents will be created. Returns
......
...@@ -90,7 +90,7 @@ class CONTENT_EXPORT WebContentsView ...@@ -90,7 +90,7 @@ class CONTENT_EXPORT WebContentsView
// Sets focus to the native widget for this tab. // Sets focus to the native widget for this tab.
virtual void Focus() = 0; virtual void Focus() = 0;
// Sets focus to the appropriate element when the tab contents is shown the // Sets focus to the appropriate element when the WebContents is shown the
// first time. // first time.
virtual void SetInitialFocus() = 0; virtual void SetInitialFocus() = 0;
...@@ -102,7 +102,7 @@ class CONTENT_EXPORT WebContentsView ...@@ -102,7 +102,7 @@ class CONTENT_EXPORT WebContentsView
virtual void RestoreFocus() = 0; virtual void RestoreFocus() = 0;
// If we try to close the tab while a drag is in progress, we crash. These // If we try to close the tab while a drag is in progress, we crash. These
// methods allow the tab contents to determine if a drag is in progress and // methods allow the WebContents to determine if a drag is in progress and
// postpone the tab closing. // postpone the tab closing.
virtual bool IsDoingDrag() const = 0; virtual bool IsDoingDrag() const = 0;
virtual void CancelDragAndCloseTab() = 0; virtual void CancelDragAndCloseTab() = 0;
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
IPC_MESSAGE_ROUTED1(ShellViewMsg_CaptureTextDump, IPC_MESSAGE_ROUTED1(ShellViewMsg_CaptureTextDump,
bool /* recursive */) bool /* recursive */)
// Send a text dump of the tab contents to the render host. // Send a text dump of the WebContents to the render host.
IPC_MESSAGE_ROUTED1(ShellViewHostMsg_TextDump, IPC_MESSAGE_ROUTED1(ShellViewHostMsg_TextDump,
std::string /* dump */) std::string /* dump */)
......
...@@ -127,10 +127,10 @@ class RenderViewHostTestHarness : public testing::Test { ...@@ -127,10 +127,10 @@ class RenderViewHostTestHarness : public testing::Test {
BrowserContext* browser_context(); BrowserContext* browser_context();
MockRenderProcessHost* process(); MockRenderProcessHost* process();
// Frees the current tab contents for tests that want to test destruction. // Frees the current WebContents for tests that want to test destruction.
void DeleteContents(); void DeleteContents();
// Sets the current tab contents for tests that want to alter it. Takes // Sets the current WebContents for tests that want to alter it. Takes
// ownership of the WebContents passed. // ownership of the WebContents passed.
virtual void SetContents(WebContents* contents); virtual void SetContents(WebContents* contents);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment