diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-11 16:18:35 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-11 16:18:35 +0000 |
commit | 6eddfd447c7c6f3e0fb9a5e46761c857592e9efd (patch) | |
tree | 12558656e0d7804a5b456e126f1ca4e5fbbdeca7 | |
parent | 2efdbfd1a2f7c3eda02d44c66dafd3266fe407f7 (diff) | |
download | chromium_src-6eddfd447c7c6f3e0fb9a5e46761c857592e9efd.zip chromium_src-6eddfd447c7c6f3e0fb9a5e46761c857592e9efd.tar.gz chromium_src-6eddfd447c7c6f3e0fb9a5e46761c857592e9efd.tar.bz2 |
TabContents -> WebContentsImpl, part 5.
TabContentsViewAura -> WebContentsViewAura
TabContentsViewGtk -> WebContentsViewGtk
TabContentsViewHelper -> WebContentsViewHelper
TabContentsViewWin -> WebContentsViewWin
BUG=105875
TEST=no change
Review URL: https://chromiumcodereview.appspot.com/10031044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131779 0039d316-1c4b-4281-b951-d872f2087c98
26 files changed, 266 insertions, 267 deletions
diff --git a/chrome/browser/DEPS b/chrome/browser/DEPS index 8837941..f2c21d1 100644 --- a/chrome/browser/DEPS +++ b/chrome/browser/DEPS @@ -39,8 +39,8 @@ include_rules = [ "+content/browser/download/download_state_info.h", # TODO(ben): http://crbug.com/118410 will fix the following: "+content/browser/renderer_host/render_view_host_factory.h", - "+content/browser/tab_contents/tab_contents_view_helper.h", "+content/browser/web_contents/web_contents_drag_win.h", + "+content/browser/web_contents/web_contents_view_helper.h", "+content/browser/web_contents/web_drag_dest_win.h", # DO NOT ADD ANY MORE ITEMS TO THE ABOVE LIST! diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc index 7310a6d..2eb7a5f 100644 --- a/chrome/browser/bookmarks/bookmark_utils.cc +++ b/chrome/browser/bookmarks/bookmark_utils.cc @@ -361,8 +361,8 @@ void DragBookmarks(Profile* profile, if (widget) { widget->RunShellDrag(NULL, data, gfx::Point(), operation); } else { - // We hit this case when we're using TabContentsViewWin or - // TabContentsViewAura, instead of TabContentsViewViews. + // We hit this case when we're using WebContentsViewWin or + // WebContentsViewAura, instead of TabContentsViewViews. views::RunShellDrag(view, data, gfx::Point(), operation); } diff --git a/chrome/browser/tab_contents/chrome_web_contents_view_delegate_gtk.cc b/chrome/browser/tab_contents/chrome_web_contents_view_delegate_gtk.cc index 2d5de417..199a469 100644 --- a/chrome/browser/tab_contents/chrome_web_contents_view_delegate_gtk.cc +++ b/chrome/browser/tab_contents/chrome_web_contents_view_delegate_gtk.cc @@ -110,7 +110,7 @@ gboolean ChromeWebContentsViewDelegateGtk::OnNativeViewFocusEvent( return TRUE; } - // Let the default TabContentsViewGtk::OnFocus() behaviour run. + // Let the default WebContentsViewGtk::OnFocus() behaviour run. return FALSE; } diff --git a/chrome/browser/tab_contents/chrome_web_contents_view_delegate_gtk.h b/chrome/browser/tab_contents/chrome_web_contents_view_delegate_gtk.h index 758145b..5afc7da 100644 --- a/chrome/browser/tab_contents/chrome_web_contents_view_delegate_gtk.h +++ b/chrome/browser/tab_contents/chrome_web_contents_view_delegate_gtk.h @@ -20,7 +20,7 @@ namespace content { class WebContents; } -// A chrome/ specific class that extends TabContentsViewGtk with features like +// A chrome/ specific class that extends WebContentsViewGtk with features like // constrained windows, which live in chrome/. class ChromeWebContentsViewDelegateGtk : public content::WebContentsViewDelegate { @@ -35,7 +35,7 @@ class ChromeWebContentsViewDelegateGtk ui::FocusStoreGtk* focus_store() { return focus_store_; } // Unlike Windows, ConstrainedWindows need to collaborate with the - // TabContentsViewGtk to position the dialogs. + // WebContentsViewGtk to position the dialogs. void AttachConstrainedWindow(ConstrainedWindowGtk* constrained_window); void RemoveConstrainedWindow(ConstrainedWindowGtk* constrained_window); diff --git a/chrome/browser/tab_contents/chrome_web_contents_view_delegate_views.h b/chrome/browser/tab_contents/chrome_web_contents_view_delegate_views.h index cbf6486..0ec4491 100644 --- a/chrome/browser/tab_contents/chrome_web_contents_view_delegate_views.h +++ b/chrome/browser/tab_contents/chrome_web_contents_view_delegate_views.h @@ -24,7 +24,7 @@ class FocusManager; class Widget; } -// A chrome specific class that extends TabContentsViewWin with features like +// A chrome specific class that extends WebContentsViewWin with features like // constrained windows, which live in chrome. class ChromeWebContentsViewDelegateViews : public content::WebContentsViewDelegate { diff --git a/chrome/browser/ui/gtk/browser_window_gtk.cc b/chrome/browser/ui/gtk/browser_window_gtk.cc index 1313a3b..249c796 100644 --- a/chrome/browser/ui/gtk/browser_window_gtk.cc +++ b/chrome/browser/ui/gtk/browser_window_gtk.cc @@ -1431,7 +1431,7 @@ void BrowserWindowGtk::UpdateDevToolsForContents(WebContents* contents) { devtools_container_->SetTab(devtools_contents); if (devtools_contents) { - // TabContentsViewGtk::WasShown is not called when tab contents is shown by + // WebContentsViewGtk::WasShown is not called when tab contents is shown by // anything other than user selecting a Tab. // See TabContentsViewViews::OnWindowPosChanged for reference on how it // should be implemented. diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_container_win.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_container_win.cc index 37361e2..f962912 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_container_win.cc +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_container_win.cc @@ -120,7 +120,7 @@ void NativeTabContentsContainerWin::RequestFocus() { // don't send it to listeners. views::AutoNativeNotificationDisabler local_notification_disabler; views::FocusManager* focus_manager = GetFocusManager(); - if (focus_manager) // NULL in unittests when using TabContentsViewWin. + if (focus_manager) // NULL in unittests when using WebContentsViewWin. focus_manager->ClearFocus(); } View::RequestFocus(); diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.cc index 76a26fb..39fabd0 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.cc +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.cc @@ -22,7 +22,7 @@ using content::WebContents; namespace { -// See comment above TempParent in tab_contents_view_win.cc. +// See comment above TempParent in web_contents_view_win.cc. // Also, Tabs must be created as child widgets, otherwise they will be given // a FocusManager which will conflict with the FocusManager of the // window they eventually end up attached to. diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc index d37c85f..5b44826 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc +++ b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc @@ -270,19 +270,19 @@ views::Widget* TabContentsViewViews::GetSadTab() const { void TabContentsViewViews::CreateNewWindow( int route_id, const ViewHostMsg_CreateWindow_Params& params) { - tab_contents_view_helper_.CreateNewWindow(web_contents_, route_id, params); + web_contents_view_helper_.CreateNewWindow(web_contents_, route_id, params); } void TabContentsViewViews::CreateNewWidget( int route_id, WebKit::WebPopupType popup_type) { - tab_contents_view_helper_.CreateNewWidget(web_contents_, + web_contents_view_helper_.CreateNewWidget(web_contents_, route_id, false, popup_type); } void TabContentsViewViews::CreateNewFullscreenWidget(int route_id) { - tab_contents_view_helper_.CreateNewWidget(web_contents_, + web_contents_view_helper_.CreateNewWidget(web_contents_, route_id, true, WebKit::WebPopupTypeNone); @@ -292,20 +292,20 @@ void TabContentsViewViews::ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture) { - tab_contents_view_helper_.ShowCreatedWindow( + web_contents_view_helper_.ShowCreatedWindow( web_contents_, route_id, disposition, initial_pos, user_gesture); } void TabContentsViewViews::ShowCreatedWidget( int route_id, const gfx::Rect& initial_pos) { - tab_contents_view_helper_.ShowCreatedWidget(web_contents_, + web_contents_view_helper_.ShowCreatedWidget(web_contents_, route_id, false, initial_pos); } void TabContentsViewViews::ShowCreatedFullscreenWidget(int route_id) { - tab_contents_view_helper_.ShowCreatedWidget(web_contents_, + web_contents_view_helper_.ShowCreatedWidget(web_contents_, route_id, true, gfx::Rect()); diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.h b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.h index 41b9e78..8e8522a 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.h +++ b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.h @@ -10,7 +10,7 @@ #include "base/memory/scoped_ptr.h" #include "base/timer.h" #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate.h" -#include "content/browser/tab_contents/tab_contents_view_helper.h" +#include "content/browser/web_contents/web_contents_view_helper.h" #include "content/public/browser/web_contents_view.h" #include "ui/views/widget/widget.h" @@ -128,7 +128,7 @@ class TabContentsViewViews : public views::Widget, content::WebContents* web_contents_; // Common implementations of some WebContentsView methods. - TabContentsViewHelper tab_contents_view_helper_; + WebContentsViewHelper web_contents_view_helper_; NativeTabContentsView* native_tab_contents_view_; diff --git a/content/browser/renderer_host/render_widget_host_view_gtk.cc b/content/browser/renderer_host/render_widget_host_view_gtk.cc index 7c5fcdf..6dde399 100644 --- a/content/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/content/browser/renderer_host/render_widget_host_view_gtk.cc @@ -337,7 +337,7 @@ class RenderWidgetHostViewGtkWidget { widget_host->ForwardMouseEvent(WebInputEventFactory::mouseEvent(event)); // Although we did handle the mouse event, we need to let other handlers - // run (in particular the one installed by TabContentsViewGtk). + // run (in particular the one installed by WebContentsViewGtk). return FALSE; } diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc index 0c555a1..3afb53e 100644 --- a/content/browser/tab_contents/tab_contents.cc +++ b/content/browser/tab_contents/tab_contents.cc @@ -66,11 +66,11 @@ #include "webkit/glue/webpreferences.h" #if defined(USE_AURA) -#include "content/browser/tab_contents/tab_contents_view_aura.h" +#include "content/browser/web_contents/web_contents_view_aura.h" #elif defined(OS_WIN) -#include "content/browser/tab_contents/tab_contents_view_win.h" +#include "content/browser/web_contents/web_contents_view_win.h" #elif defined(TOOLKIT_GTK) -#include "content/browser/tab_contents/tab_contents_view_gtk.h" +#include "content/browser/web_contents/web_contents_view_gtk.h" #elif defined(OS_MACOSX) #include "content/browser/web_contents/web_contents_view_mac.h" #include "ui/gfx/surface/io_surface_support_mac.h" @@ -287,11 +287,11 @@ WebContentsImpl::WebContentsImpl( content::GetContentClient()->browser()->GetWebContentsViewDelegate( this); #if defined(USE_AURA) - view_.reset(new TabContentsViewAura(this, delegate)); + view_.reset(new WebContentsViewAura(this, delegate)); #elif defined(OS_WIN) - view_.reset(new TabContentsViewWin(this, delegate)); + view_.reset(new WebContentsViewWin(this, delegate)); #elif defined(TOOLKIT_GTK) - view_.reset(new content::TabContentsViewGtk(this, delegate)); + view_.reset(new content::WebContentsViewGtk(this, delegate)); #elif defined(OS_MACOSX) view_.reset(web_contents_view_mac::CreateWebContentsView(this, delegate)); #elif defined(OS_ANDROID) diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h index 8dbea62..cf0b362 100644 --- a/content/browser/tab_contents/tab_contents.h +++ b/content/browser/tab_contents/tab_contents.h @@ -390,7 +390,7 @@ class CONTENT_EXPORT WebContentsImpl #elif defined(OS_MACOSX) friend class WebContentsViewMac; #elif defined(TOOLKIT_GTK) - friend class TabContentsViewGtk; + friend class WebContentsViewGtk; #endif // So InterstitialPageImpl can access SetIsLoading. diff --git a/content/browser/tab_contents/tab_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc index 23d0e37..86dad10 100644 --- a/content/browser/tab_contents/tab_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/tab_contents/tab_contents_view_aura.h" +#include "content/browser/web_contents/web_contents_view_aura.h" #include "base/utf_string_conversions.h" #include "content/browser/renderer_host/render_view_host_factory.h" @@ -160,9 +160,9 @@ WebKit::WebDragOperationsMask ConvertToWeb(int drag_op) { //////////////////////////////////////////////////////////////////////////////// -// TabContentsViewAura, public: +// WebContentsViewAura, public: -TabContentsViewAura::TabContentsViewAura( +WebContentsViewAura::WebContentsViewAura( TabContents* tab_contents, content::WebContentsViewDelegate* delegate) : tab_contents_(tab_contents), @@ -172,13 +172,13 @@ TabContentsViewAura::TabContentsViewAura( close_tab_after_drag_ends_(false) { } -TabContentsViewAura::~TabContentsViewAura() { +WebContentsViewAura::~WebContentsViewAura() { } //////////////////////////////////////////////////////////////////////////////// -// TabContentsViewAura, private: +// WebContentsViewAura, private: -void TabContentsViewAura::SizeChangedCommon(const gfx::Size& size) { +void WebContentsViewAura::SizeChangedCommon(const gfx::Size& size) { if (tab_contents_->GetInterstitialPage()) tab_contents_->GetInterstitialPage()->SetSize(size); content::RenderWidgetHostView* rwhv = @@ -187,7 +187,7 @@ void TabContentsViewAura::SizeChangedCommon(const gfx::Size& size) { rwhv->SetSize(size); } -void TabContentsViewAura::EndDrag(WebKit::WebDragOperationsMask ops) { +void WebContentsViewAura::EndDrag(WebKit::WebDragOperationsMask ops) { aura::RootWindow* root_window = GetNativeView()->GetRootWindow(); gfx::Point screen_loc = root_window->last_mouse_location(); gfx::Point client_loc = screen_loc; @@ -198,14 +198,14 @@ void TabContentsViewAura::EndDrag(WebKit::WebDragOperationsMask ops) { screen_loc.y(), ops); } -content::WebDragDestDelegate* TabContentsViewAura::GetDragDestDelegate() { +content::WebDragDestDelegate* WebContentsViewAura::GetDragDestDelegate() { return delegate_.get() ? delegate_->GetDragDestDelegate() : NULL; } //////////////////////////////////////////////////////////////////////////////// -// TabContentsViewAura, WebContentsView implementation: +// WebContentsViewAura, WebContentsView implementation: -void TabContentsViewAura::CreateView(const gfx::Size& initial_size) { +void WebContentsViewAura::CreateView(const gfx::Size& initial_size) { initial_size_ = initial_size; window_.reset(new aura::Window(this)); @@ -215,10 +215,10 @@ void TabContentsViewAura::CreateView(const gfx::Size& initial_size) { window_->Init(ui::LAYER_NOT_DRAWN); window_->SetParent(NULL); window_->layer()->SetMasksToBounds(true); - window_->SetName("TabContentsViewAura"); + window_->SetName("WebContentsViewAura"); } -content::RenderWidgetHostView* TabContentsViewAura::CreateViewForWidget( +content::RenderWidgetHostView* WebContentsViewAura::CreateViewForWidget( content::RenderWidgetHost* render_widget_host) { if (render_widget_host->GetView()) { // During testing, the view will already be set up in most cases to the @@ -241,32 +241,32 @@ content::RenderWidgetHostView* TabContentsViewAura::CreateViewForWidget( return view_; } -gfx::NativeView TabContentsViewAura::GetNativeView() const { +gfx::NativeView WebContentsViewAura::GetNativeView() const { return window_.get(); } -gfx::NativeView TabContentsViewAura::GetContentNativeView() const { +gfx::NativeView WebContentsViewAura::GetContentNativeView() const { return view_->GetNativeView(); } -gfx::NativeWindow TabContentsViewAura::GetTopLevelNativeWindow() const { +gfx::NativeWindow WebContentsViewAura::GetTopLevelNativeWindow() const { return window_->GetToplevelWindow(); } -void TabContentsViewAura::GetContainerBounds(gfx::Rect *out) const { +void WebContentsViewAura::GetContainerBounds(gfx::Rect *out) const { *out = window_->GetScreenBounds(); } -void TabContentsViewAura::SetPageTitle(const string16& title) { +void WebContentsViewAura::SetPageTitle(const string16& title) { window_->set_title(title); } -void TabContentsViewAura::OnTabCrashed(base::TerminationStatus status, +void WebContentsViewAura::OnTabCrashed(base::TerminationStatus status, int error_code) { view_ = NULL; } -void TabContentsViewAura::SizeContents(const gfx::Size& size) { +void WebContentsViewAura::SizeContents(const gfx::Size& size) { gfx::Rect bounds = window_->bounds(); if (bounds.size() != size) { bounds.set_size(size); @@ -279,10 +279,10 @@ void TabContentsViewAura::SizeContents(const gfx::Size& size) { } } -void TabContentsViewAura::RenderViewCreated(content::RenderViewHost* host) { +void WebContentsViewAura::RenderViewCreated(content::RenderViewHost* host) { } -void TabContentsViewAura::Focus() { +void WebContentsViewAura::Focus() { if (tab_contents_->GetInterstitialPage()) { tab_contents_->GetInterstitialPage()->Focus(); return; @@ -297,31 +297,31 @@ void TabContentsViewAura::Focus() { rwhv->Focus(); } -void TabContentsViewAura::SetInitialFocus() { +void WebContentsViewAura::SetInitialFocus() { if (tab_contents_->FocusLocationBarByDefault()) tab_contents_->SetFocusToLocationBar(false); else Focus(); } -void TabContentsViewAura::StoreFocus() { +void WebContentsViewAura::StoreFocus() { if (delegate_.get()) delegate_->StoreFocus(); } -void TabContentsViewAura::RestoreFocus() { +void WebContentsViewAura::RestoreFocus() { if (delegate_.get()) delegate_->RestoreFocus(); } -bool TabContentsViewAura::IsDoingDrag() const { +bool WebContentsViewAura::IsDoingDrag() const { aura::RootWindow* root_window = GetNativeView()->GetRootWindow(); if (aura::client::GetDragDropClient(root_window)) return aura::client::GetDragDropClient(root_window)->IsDragDropInProgress(); return false; } -void TabContentsViewAura::CancelDragAndCloseTab() { +void WebContentsViewAura::CancelDragAndCloseTab() { DCHECK(IsDoingDrag()); // We can't close the tab while we're in the drag and // |drag_handler_->CancelDrag()| is async. Instead, set a flag to cancel @@ -333,65 +333,65 @@ void TabContentsViewAura::CancelDragAndCloseTab() { close_tab_after_drag_ends_ = true; } -bool TabContentsViewAura::IsEventTracking() const { +bool WebContentsViewAura::IsEventTracking() const { return false; } -void TabContentsViewAura::CloseTabAfterEventTracking() { +void WebContentsViewAura::CloseTabAfterEventTracking() { } -void TabContentsViewAura::GetViewBounds(gfx::Rect* out) const { +void WebContentsViewAura::GetViewBounds(gfx::Rect* out) const { *out = window_->GetScreenBounds(); } //////////////////////////////////////////////////////////////////////////////// -// TabContentsViewAura, RenderViewHostDelegate::View implementation: +// WebContentsViewAura, RenderViewHostDelegate::View implementation: -void TabContentsViewAura::CreateNewWindow( +void WebContentsViewAura::CreateNewWindow( int route_id, const ViewHostMsg_CreateWindow_Params& params) { - tab_contents_view_helper_.CreateNewWindow(tab_contents_, route_id, params); + web_contents_view_helper_.CreateNewWindow(tab_contents_, route_id, params); } -void TabContentsViewAura::CreateNewWidget(int route_id, +void WebContentsViewAura::CreateNewWidget(int route_id, WebKit::WebPopupType popup_type) { - tab_contents_view_helper_.CreateNewWidget(tab_contents_, + web_contents_view_helper_.CreateNewWidget(tab_contents_, route_id, false, popup_type); } -void TabContentsViewAura::CreateNewFullscreenWidget(int route_id) { - tab_contents_view_helper_.CreateNewWidget(tab_contents_, +void WebContentsViewAura::CreateNewFullscreenWidget(int route_id) { + web_contents_view_helper_.CreateNewWidget(tab_contents_, route_id, true, WebKit::WebPopupTypeNone); } -void TabContentsViewAura::ShowCreatedWindow(int route_id, +void WebContentsViewAura::ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture) { - tab_contents_view_helper_.ShowCreatedWindow( + web_contents_view_helper_.ShowCreatedWindow( tab_contents_, route_id, disposition, initial_pos, user_gesture); } -void TabContentsViewAura::ShowCreatedWidget(int route_id, +void WebContentsViewAura::ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos) { - tab_contents_view_helper_.ShowCreatedWidget(tab_contents_, + web_contents_view_helper_.ShowCreatedWidget(tab_contents_, route_id, false, initial_pos); } -void TabContentsViewAura::ShowCreatedFullscreenWidget(int route_id) { - tab_contents_view_helper_.ShowCreatedWidget(tab_contents_, +void WebContentsViewAura::ShowCreatedFullscreenWidget(int route_id) { + web_contents_view_helper_.ShowCreatedWidget(tab_contents_, route_id, true, gfx::Rect()); } -void TabContentsViewAura::ShowContextMenu( +void WebContentsViewAura::ShowContextMenu( const content::ContextMenuParams& params) { // Allow WebContentsDelegates to handle the context menu operation first. if (tab_contents_->GetDelegate() && @@ -403,7 +403,7 @@ void TabContentsViewAura::ShowContextMenu( delegate_->ShowContextMenu(params); } -void TabContentsViewAura::ShowPopupMenu(const gfx::Rect& bounds, +void WebContentsViewAura::ShowPopupMenu(const gfx::Rect& bounds, int item_height, double item_font_size, int selected_item, @@ -413,7 +413,7 @@ void TabContentsViewAura::ShowPopupMenu(const gfx::Rect& bounds, NOTIMPLEMENTED(); } -void TabContentsViewAura::StartDragging( +void WebContentsViewAura::StartDragging( const WebDropData& drop_data, WebKit::WebDragOperationsMask operations, const SkBitmap& image, @@ -424,10 +424,8 @@ void TabContentsViewAura::StartDragging( ui::OSExchangeDataProviderAura* provider = new ui::OSExchangeDataProviderAura; PrepareDragData(drop_data, provider); - if (!image.isNull()) { + if (!image.isNull()) provider->set_drag_image(image); - provider->set_drag_image_offset(image_offset); - } ui::OSExchangeData data(provider); // takes ownership of |provider|. scoped_ptr<WebDragSourceAura> drag_source( @@ -442,6 +440,7 @@ void TabContentsViewAura::StartDragging( // initiate the drag). The location information should be carried over from // webkit. http://crbug.com/114754 gfx::Point location(root_window->last_mouse_location()); + location.Offset(-image_offset.x(), -image_offset.y()); MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); result_op = aura::client::GetDragDropClient(root_window)->StartDragAndDrop( data, location, ConvertFromWeb(operations)); @@ -450,16 +449,16 @@ void TabContentsViewAura::StartDragging( EndDrag(ConvertToWeb(result_op)); tab_contents_->GetRenderViewHost()->DragSourceSystemDragEnded();} -void TabContentsViewAura::UpdateDragCursor(WebKit::WebDragOperation operation) { +void WebContentsViewAura::UpdateDragCursor(WebKit::WebDragOperation operation) { current_drag_op_ = operation; } -void TabContentsViewAura::GotFocus() { +void WebContentsViewAura::GotFocus() { if (tab_contents_->GetDelegate()) tab_contents_->GetDelegate()->WebContentsFocused(tab_contents_); } -void TabContentsViewAura::TakeFocus(bool reverse) { +void WebContentsViewAura::TakeFocus(bool reverse) { if (tab_contents_->GetDelegate() && !tab_contents_->GetDelegate()->TakeFocus(reverse) && delegate_.get()) { @@ -468,38 +467,38 @@ void TabContentsViewAura::TakeFocus(bool reverse) { } //////////////////////////////////////////////////////////////////////////////// -// TabContentsViewAura, aura::WindowDelegate implementation: +// WebContentsViewAura, aura::WindowDelegate implementation: -gfx::Size TabContentsViewAura::GetMinimumSize() const { +gfx::Size WebContentsViewAura::GetMinimumSize() const { return gfx::Size(); } -void TabContentsViewAura::OnBoundsChanged(const gfx::Rect& old_bounds, +void WebContentsViewAura::OnBoundsChanged(const gfx::Rect& old_bounds, const gfx::Rect& new_bounds) { SizeChangedCommon(new_bounds.size()); if (delegate_.get()) delegate_->SizeChanged(new_bounds.size()); } -void TabContentsViewAura::OnFocus() { +void WebContentsViewAura::OnFocus() { } -void TabContentsViewAura::OnBlur() { +void WebContentsViewAura::OnBlur() { } -bool TabContentsViewAura::OnKeyEvent(aura::KeyEvent* event) { +bool WebContentsViewAura::OnKeyEvent(aura::KeyEvent* event) { return false; } -gfx::NativeCursor TabContentsViewAura::GetCursor(const gfx::Point& point) { +gfx::NativeCursor WebContentsViewAura::GetCursor(const gfx::Point& point) { return gfx::kNullCursor; } -int TabContentsViewAura::GetNonClientComponent(const gfx::Point& point) const { +int WebContentsViewAura::GetNonClientComponent(const gfx::Point& point) const { return HTCLIENT; } -bool TabContentsViewAura::OnMouseEvent(aura::MouseEvent* event) { +bool WebContentsViewAura::OnMouseEvent(aura::MouseEvent* event) { if (!tab_contents_->GetDelegate()) return false; @@ -517,41 +516,41 @@ bool TabContentsViewAura::OnMouseEvent(aura::MouseEvent* event) { return false; } -ui::TouchStatus TabContentsViewAura::OnTouchEvent(aura::TouchEvent* event) { +ui::TouchStatus WebContentsViewAura::OnTouchEvent(aura::TouchEvent* event) { return ui::TOUCH_STATUS_UNKNOWN; } -ui::GestureStatus TabContentsViewAura::OnGestureEvent( +ui::GestureStatus WebContentsViewAura::OnGestureEvent( aura::GestureEvent* event) { return ui::GESTURE_STATUS_UNKNOWN; } -bool TabContentsViewAura::CanFocus() { +bool WebContentsViewAura::CanFocus() { return true; } -void TabContentsViewAura::OnCaptureLost() { +void WebContentsViewAura::OnCaptureLost() { } -void TabContentsViewAura::OnPaint(gfx::Canvas* canvas) { +void WebContentsViewAura::OnPaint(gfx::Canvas* canvas) { } -void TabContentsViewAura::OnWindowDestroying() { +void WebContentsViewAura::OnWindowDestroying() { } -void TabContentsViewAura::OnWindowDestroyed() { +void WebContentsViewAura::OnWindowDestroyed() { } -void TabContentsViewAura::OnWindowVisibilityChanged(bool visible) { +void WebContentsViewAura::OnWindowVisibilityChanged(bool visible) { if (visible) tab_contents_->ShowContents(); else tab_contents_->HideContents(); } //////////////////////////////////////////////////////////////////////////////// -// TabContentsViewAura, aura::client::DragDropDelegate implementation: +// WebContentsViewAura, aura::client::DragDropDelegate implementation: -void TabContentsViewAura::OnDragEntered(const aura::DropTargetEvent& event) { +void WebContentsViewAura::OnDragEntered(const aura::DropTargetEvent& event) { if (GetDragDestDelegate()) GetDragDestDelegate()->DragInitialize(tab_contents_); @@ -570,7 +569,7 @@ void TabContentsViewAura::OnDragEntered(const aura::DropTargetEvent& event) { } } -int TabContentsViewAura::OnDragUpdated(const aura::DropTargetEvent& event) { +int WebContentsViewAura::OnDragUpdated(const aura::DropTargetEvent& event) { WebKit::WebDragOperationsMask op = ConvertToWeb(event.source_operations()); gfx::Point screen_pt = GetNativeView()->GetRootWindow()->last_mouse_location(); @@ -583,13 +582,13 @@ int TabContentsViewAura::OnDragUpdated(const aura::DropTargetEvent& event) { return ConvertFromWeb(current_drag_op_); } -void TabContentsViewAura::OnDragExited() { +void WebContentsViewAura::OnDragExited() { tab_contents_->GetRenderViewHost()->DragTargetDragLeave(); if (GetDragDestDelegate()) GetDragDestDelegate()->OnDragLeave(); } -int TabContentsViewAura::OnPerformDrop(const aura::DropTargetEvent& event) { +int WebContentsViewAura::OnPerformDrop(const aura::DropTargetEvent& event) { tab_contents_->GetRenderViewHost()->DragTargetDrop( event.location(), GetNativeView()->GetRootWindow()->last_mouse_location()); diff --git a/content/browser/tab_contents/tab_contents_view_aura.h b/content/browser/web_contents/web_contents_view_aura.h index 56b3ba8..360006a 100644 --- a/content/browser/tab_contents/tab_contents_view_aura.h +++ b/content/browser/web_contents/web_contents_view_aura.h @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_AURA_H_ -#define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_AURA_H_ +#ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ +#define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ #pragma once #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" -#include "content/browser/tab_contents/tab_contents_view_helper.h" +#include "content/browser/web_contents/web_contents_view_helper.h" #include "content/common/content_export.h" #include "content/public/browser/web_contents_view.h" #include "ui/aura/client/drag_drop_delegate.h" @@ -23,14 +23,14 @@ class WebContentsViewDelegate; class WebDragDestDelegate; } -class CONTENT_EXPORT TabContentsViewAura +class CONTENT_EXPORT WebContentsViewAura : public content::WebContentsView, public aura::WindowDelegate, public aura::client::DragDropDelegate { public: - TabContentsViewAura(WebContentsImpl* web_contents, + WebContentsViewAura(WebContentsImpl* web_contents, content::WebContentsViewDelegate* delegate); - virtual ~TabContentsViewAura(); + virtual ~WebContentsViewAura(); private: void SizeChangedCommon(const gfx::Size& size); @@ -129,7 +129,7 @@ class CONTENT_EXPORT TabContentsViewAura scoped_ptr<content::WebContentsViewDelegate> delegate_; // Common implementations of some WebContentsView methods. - TabContentsViewHelper tab_contents_view_helper_; + WebContentsViewHelper web_contents_view_helper_; WebKit::WebDragOperationsMask current_drag_op_; @@ -137,7 +137,7 @@ class CONTENT_EXPORT TabContentsViewAura // has finished. bool close_tab_after_drag_ends_; - DISALLOW_COPY_AND_ASSIGN(TabContentsViewAura); + DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura); }; -#endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_AURA_H_
\ No newline at end of file +#endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ diff --git a/content/browser/tab_contents/tab_contents_view_gtk.cc b/content/browser/web_contents/web_contents_view_gtk.cc index 7c191a3..43f1e7b 100644 --- a/content/browser/tab_contents/tab_contents_view_gtk.cc +++ b/content/browser/web_contents/web_contents_view_gtk.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/tab_contents/tab_contents_view_gtk.h" +#include "content/browser/web_contents/web_contents_view_gtk.h" #include <gdk/gdk.h> #include <gdk/gdkkeysyms.h> @@ -78,7 +78,7 @@ gboolean OnMouseScroll(GtkWidget* widget, GdkEventScroll* event, namespace content { -TabContentsViewGtk::TabContentsViewGtk( +WebContentsViewGtk::WebContentsViewGtk( TabContents* tab_contents, content::WebContentsViewDelegate* delegate) : tab_contents_(tab_contents), @@ -97,15 +97,15 @@ TabContentsViewGtk::TabContentsViewGtk( delegate_->Initialize(expanded_.get(), &focus_store_); } -TabContentsViewGtk::~TabContentsViewGtk() { +WebContentsViewGtk::~WebContentsViewGtk() { expanded_.Destroy(); } -void TabContentsViewGtk::CreateView(const gfx::Size& initial_size) { +void WebContentsViewGtk::CreateView(const gfx::Size& initial_size) { requested_size_ = initial_size; } -RenderWidgetHostView* TabContentsViewGtk::CreateViewForWidget( +RenderWidgetHostView* WebContentsViewGtk::CreateViewForWidget( RenderWidgetHost* render_widget_host) { if (render_widget_host->GetView()) { // During testing, the view will already be set up in most cases to the @@ -141,26 +141,26 @@ RenderWidgetHostView* TabContentsViewGtk::CreateViewForWidget( return view; } -gfx::NativeView TabContentsViewGtk::GetNativeView() const { +gfx::NativeView WebContentsViewGtk::GetNativeView() const { if (delegate_.get()) return delegate_->GetNativeView(); return expanded_.get(); } -gfx::NativeView TabContentsViewGtk::GetContentNativeView() const { +gfx::NativeView WebContentsViewGtk::GetContentNativeView() const { RenderWidgetHostView* rwhv = tab_contents_->GetRenderWidgetHostView(); if (!rwhv) return NULL; return rwhv->GetNativeView(); } -gfx::NativeWindow TabContentsViewGtk::GetTopLevelNativeWindow() const { +gfx::NativeWindow WebContentsViewGtk::GetTopLevelNativeWindow() const { GtkWidget* window = gtk_widget_get_ancestor(GetNativeView(), GTK_TYPE_WINDOW); return window ? GTK_WINDOW(window) : NULL; } -void TabContentsViewGtk::GetContainerBounds(gfx::Rect* out) const { +void WebContentsViewGtk::GetContainerBounds(gfx::Rect* out) const { // This is used for positioning the download shelf arrow animation, // as well as sizing some other widgets in Windows. In GTK the size is // managed for us, so it appears to be only used for the download shelf @@ -177,7 +177,7 @@ void TabContentsViewGtk::GetContainerBounds(gfx::Rect* out) const { requested_size_.width(), requested_size_.height()); } -void TabContentsViewGtk::SetPageTitle(const string16& title) { +void WebContentsViewGtk::SetPageTitle(const string16& title) { // Set the window name to include the page title so it's easier to spot // when debugging (e.g. via xwininfo -tree). gfx::NativeView content_view = GetContentNativeView(); @@ -189,11 +189,11 @@ void TabContentsViewGtk::SetPageTitle(const string16& title) { } } -void TabContentsViewGtk::OnTabCrashed(base::TerminationStatus status, +void WebContentsViewGtk::OnTabCrashed(base::TerminationStatus status, int error_code) { } -void TabContentsViewGtk::SizeContents(const gfx::Size& size) { +void WebContentsViewGtk::SizeContents(const gfx::Size& size) { // We don't need to manually set the size of of widgets in GTK+, but we do // need to pass the sizing information on to the RWHV which will pass the // sizing information on to the renderer. @@ -203,10 +203,10 @@ void TabContentsViewGtk::SizeContents(const gfx::Size& size) { rwhv->SetSize(size); } -void TabContentsViewGtk::RenderViewCreated(content::RenderViewHost* host) { +void WebContentsViewGtk::RenderViewCreated(content::RenderViewHost* host) { } -void TabContentsViewGtk::Focus() { +void WebContentsViewGtk::Focus() { if (tab_contents_->ShowingInterstitialPage()) { tab_contents_->GetInterstitialPage()->Focus(); } else if (delegate_.get()) { @@ -214,39 +214,39 @@ void TabContentsViewGtk::Focus() { } } -void TabContentsViewGtk::SetInitialFocus() { +void WebContentsViewGtk::SetInitialFocus() { if (tab_contents_->FocusLocationBarByDefault()) tab_contents_->SetFocusToLocationBar(false); else Focus(); } -void TabContentsViewGtk::StoreFocus() { +void WebContentsViewGtk::StoreFocus() { focus_store_.Store(GetNativeView()); } -void TabContentsViewGtk::RestoreFocus() { +void WebContentsViewGtk::RestoreFocus() { if (focus_store_.widget()) gtk_widget_grab_focus(focus_store_.widget()); else SetInitialFocus(); } -bool TabContentsViewGtk::IsDoingDrag() const { +bool WebContentsViewGtk::IsDoingDrag() const { return false; } -void TabContentsViewGtk::CancelDragAndCloseTab() { +void WebContentsViewGtk::CancelDragAndCloseTab() { } -bool TabContentsViewGtk::IsEventTracking() const { +bool WebContentsViewGtk::IsEventTracking() const { return false; } -void TabContentsViewGtk::CloseTabAfterEventTracking() { +void WebContentsViewGtk::CloseTabAfterEventTracking() { } -void TabContentsViewGtk::GetViewBounds(gfx::Rect* out) const { +void WebContentsViewGtk::GetViewBounds(gfx::Rect* out) const { GdkWindow* window = gtk_widget_get_window(GetNativeView()); if (!window) { out->SetRect(0, 0, requested_size_.width(), requested_size_.height()); @@ -257,22 +257,22 @@ void TabContentsViewGtk::GetViewBounds(gfx::Rect* out) const { out->SetRect(x, y, w, h); } -WebContents* TabContentsViewGtk::web_contents() { +WebContents* WebContentsViewGtk::web_contents() { return tab_contents_; } -void TabContentsViewGtk::UpdateDragCursor(WebDragOperation operation) { +void WebContentsViewGtk::UpdateDragCursor(WebDragOperation operation) { drag_dest_->UpdateDragStatus(operation); } -void TabContentsViewGtk::GotFocus() { +void WebContentsViewGtk::GotFocus() { // This is only used in the views FocusManager stuff but it bleeds through // all subclasses. http://crbug.com/21875 } // This is called when the renderer asks us to take focus back (i.e., it has // iterated past the last focusable element on the page). -void TabContentsViewGtk::TakeFocus(bool reverse) { +void WebContentsViewGtk::TakeFocus(bool reverse) { if (!tab_contents_->GetDelegate()) return; if (!tab_contents_->GetDelegate()->TakeFocus(reverse)) { @@ -281,7 +281,7 @@ void TabContentsViewGtk::TakeFocus(bool reverse) { } } -void TabContentsViewGtk::InsertIntoContentArea(GtkWidget* widget) { +void WebContentsViewGtk::InsertIntoContentArea(GtkWidget* widget) { gtk_container_add(GTK_CONTAINER(expanded_.get()), widget); } @@ -290,7 +290,7 @@ void TabContentsViewGtk::InsertIntoContentArea(GtkWidget* widget) { // and grab focus if we don't have it. The call to // FocusThroughTabTraversal(bool) forwards the "move focus forward" effect to // webkit. -gboolean TabContentsViewGtk::OnFocus(GtkWidget* widget, +gboolean WebContentsViewGtk::OnFocus(GtkWidget* widget, GtkDirectionType focus) { // Give our view wrapper first chance at this event. if (delegate_.get()) { @@ -311,51 +311,51 @@ gboolean TabContentsViewGtk::OnFocus(GtkWidget* widget, return TRUE; } -void TabContentsViewGtk::CreateNewWindow( +void WebContentsViewGtk::CreateNewWindow( int route_id, const ViewHostMsg_CreateWindow_Params& params) { - tab_contents_view_helper_.CreateNewWindow(tab_contents_, route_id, params); + web_contents_view_helper_.CreateNewWindow(tab_contents_, route_id, params); } -void TabContentsViewGtk::CreateNewWidget( +void WebContentsViewGtk::CreateNewWidget( int route_id, WebKit::WebPopupType popup_type) { - tab_contents_view_helper_.CreateNewWidget(tab_contents_, + web_contents_view_helper_.CreateNewWidget(tab_contents_, route_id, false, popup_type); } -void TabContentsViewGtk::CreateNewFullscreenWidget(int route_id) { - tab_contents_view_helper_.CreateNewWidget(tab_contents_, +void WebContentsViewGtk::CreateNewFullscreenWidget(int route_id) { + web_contents_view_helper_.CreateNewWidget(tab_contents_, route_id, true, WebKit::WebPopupTypeNone); } -void TabContentsViewGtk::ShowCreatedWindow(int route_id, +void WebContentsViewGtk::ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture) { - tab_contents_view_helper_.ShowCreatedWindow( + web_contents_view_helper_.ShowCreatedWindow( tab_contents_, route_id, disposition, initial_pos, user_gesture); } -void TabContentsViewGtk::ShowCreatedWidget( +void WebContentsViewGtk::ShowCreatedWidget( int route_id, const gfx::Rect& initial_pos) { - tab_contents_view_helper_.ShowCreatedWidget(tab_contents_, + web_contents_view_helper_.ShowCreatedWidget(tab_contents_, route_id, false, initial_pos); } -void TabContentsViewGtk::ShowCreatedFullscreenWidget(int route_id) { - tab_contents_view_helper_.ShowCreatedWidget(tab_contents_, +void WebContentsViewGtk::ShowCreatedFullscreenWidget(int route_id) { + web_contents_view_helper_.ShowCreatedWidget(tab_contents_, route_id, true, gfx::Rect()); } -void TabContentsViewGtk::ShowContextMenu( +void WebContentsViewGtk::ShowContextMenu( const content::ContextMenuParams& params) { // Allow delegates to handle the context menu operation first. if (web_contents()->GetDelegate() && @@ -369,7 +369,7 @@ void TabContentsViewGtk::ShowContextMenu( DLOG(ERROR) << "Cannot show context menus without a delegate."; } -void TabContentsViewGtk::ShowPopupMenu(const gfx::Rect& bounds, +void WebContentsViewGtk::ShowPopupMenu(const gfx::Rect& bounds, int item_height, double item_font_size, int selected_item, @@ -382,7 +382,7 @@ void TabContentsViewGtk::ShowPopupMenu(const gfx::Rect& bounds, // Render view DnD ------------------------------------------------------------- -void TabContentsViewGtk::StartDragging(const WebDropData& drop_data, +void WebContentsViewGtk::StartDragging(const WebDropData& drop_data, WebDragOperationsMask ops, const SkBitmap& image, const gfx::Point& image_offset) { @@ -399,7 +399,7 @@ void TabContentsViewGtk::StartDragging(const WebDropData& drop_data, // ----------------------------------------------------------------------------- -void TabContentsViewGtk::OnChildSizeRequest(GtkWidget* widget, +void WebContentsViewGtk::OnChildSizeRequest(GtkWidget* widget, GtkWidget* child, GtkRequisition* requisition) { if (tab_contents_->GetDelegate()) { @@ -408,7 +408,7 @@ void TabContentsViewGtk::OnChildSizeRequest(GtkWidget* widget, } } -void TabContentsViewGtk::OnSizeAllocate(GtkWidget* widget, +void WebContentsViewGtk::OnSizeAllocate(GtkWidget* widget, GtkAllocation* allocation) { int width = allocation->width; int height = allocation->height; diff --git a/content/browser/tab_contents/tab_contents_view_gtk.h b/content/browser/web_contents/web_contents_view_gtk.h index 815d4a9..88c4a7a 100644 --- a/content/browser/tab_contents/tab_contents_view_gtk.h +++ b/content/browser/web_contents/web_contents_view_gtk.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_GTK_H_ -#define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_GTK_H_ +#ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_GTK_H_ +#define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_GTK_H_ #pragma once #include <gtk/gtk.h> @@ -11,7 +11,7 @@ #include <vector> #include "base/memory/scoped_ptr.h" -#include "content/browser/tab_contents/tab_contents_view_helper.h" +#include "content/browser/web_contents/web_contents_view_helper.h" #include "content/common/content_export.h" #include "content/public/browser/web_contents_view.h" #include "ui/base/gtk/focus_store_gtk.h" @@ -25,16 +25,16 @@ class WebDragDestDelegate; class WebDragDestGtk; class WebDragSourceGtk; -class CONTENT_EXPORT TabContentsViewGtk : public WebContentsView { +class CONTENT_EXPORT WebContentsViewGtk : public WebContentsView { public: // The corresponding TabContents is passed in the constructor, and manages // our lifetime. This doesn't need to be the case, but is this way currently // because that's what was easiest when they were split. We optionally take // |wrapper| which creates an intermediary widget layer for features from the // Embedding layer that lives with the WebContentsView. - TabContentsViewGtk(WebContentsImpl* web_contents, + WebContentsViewGtk(WebContentsImpl* web_contents, WebContentsViewDelegate* delegate); - virtual ~TabContentsViewGtk(); + virtual ~WebContentsViewGtk(); WebContentsViewDelegate* delegate() const { return delegate_.get(); } WebContents* web_contents(); @@ -103,23 +103,23 @@ class CONTENT_EXPORT TabContentsViewGtk : public WebContentsView { // Handle focus traversal on the render widget native view. Can be overridden // by subclasses. - CHROMEGTK_CALLBACK_1(TabContentsViewGtk, gboolean, OnFocus, GtkDirectionType); + CHROMEGTK_CALLBACK_1(WebContentsViewGtk, gboolean, OnFocus, GtkDirectionType); // Used to adjust the size of its children when the size of |expanded_| is // changed. - CHROMEGTK_CALLBACK_2(TabContentsViewGtk, void, OnChildSizeRequest, + CHROMEGTK_CALLBACK_2(WebContentsViewGtk, void, OnChildSizeRequest, GtkWidget*, GtkRequisition*); // Used to propagate the size change of |expanded_| to our RWHV to resize the // renderer content. - CHROMEGTK_CALLBACK_1(TabContentsViewGtk, void, OnSizeAllocate, + CHROMEGTK_CALLBACK_1(WebContentsViewGtk, void, OnSizeAllocate, GtkAllocation*); // The WebContentsImpl whose contents we display. WebContentsImpl* tab_contents_; // Common implementations of some WebContentsView methods. - TabContentsViewHelper tab_contents_view_helper_; + WebContentsViewHelper web_contents_view_helper_; // This container holds the tab's web page views. It is a GtkExpandedContainer // so that we can control the size of the web pages. @@ -143,9 +143,9 @@ class CONTENT_EXPORT TabContentsViewGtk : public WebContentsView { // variable because resizing in GTK+ is async. gfx::Size requested_size_; - DISALLOW_COPY_AND_ASSIGN(TabContentsViewGtk); + DISALLOW_COPY_AND_ASSIGN(WebContentsViewGtk); }; } // namespace content -#endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_GTK_H_ +#endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_GTK_H_ diff --git a/content/browser/tab_contents/tab_contents_view_helper.cc b/content/browser/web_contents/web_contents_view_helper.cc index beaae80..5334f3c 100644 --- a/content/browser/tab_contents/tab_contents_view_helper.cc +++ b/content/browser/web_contents/web_contents_view_helper.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/tab_contents/tab_contents_view_helper.h" +#include "content/browser/web_contents/web_contents_view_helper.h" #include "content/browser/renderer_host/render_view_host_impl.h" #include "content/browser/tab_contents/tab_contents.h" @@ -23,15 +23,15 @@ using content::RenderWidgetHostView; using content::RenderWidgetHostViewPort; using content::WebContents; -TabContentsViewHelper::TabContentsViewHelper() { +WebContentsViewHelper::WebContentsViewHelper() { registrar_.Add(this, content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, content::NotificationService::AllBrowserContextsAndSources()); } -TabContentsViewHelper::~TabContentsViewHelper() {} +WebContentsViewHelper::~WebContentsViewHelper() {} -void TabContentsViewHelper::Observe( +void WebContentsViewHelper::Observe( int type, const content::NotificationSource& source, const content::NotificationDetails& details) { @@ -46,7 +46,7 @@ void TabContentsViewHelper::Observe( } } -TabContents* TabContentsViewHelper::CreateNewWindow( +TabContents* WebContentsViewHelper::CreateNewWindow( WebContents* web_contents, int route_id, const ViewHostMsg_CreateWindow_Params& params) { @@ -122,7 +122,7 @@ TabContents* TabContentsViewHelper::CreateNewWindow( return new_contents; } -RenderWidgetHostView* TabContentsViewHelper::CreateNewWidget( +RenderWidgetHostView* WebContentsViewHelper::CreateNewWidget( WebContents* web_contents, int route_id, bool is_fullscreen, @@ -141,7 +141,7 @@ RenderWidgetHostView* TabContentsViewHelper::CreateNewWidget( return widget_view; } -TabContents* TabContentsViewHelper::GetCreatedWindow(int route_id) { +TabContents* WebContentsViewHelper::GetCreatedWindow(int route_id) { PendingContents::iterator iter = pending_contents_.find(route_id); // Certain systems can block the creation of new windows. If we didn't succeed @@ -162,7 +162,7 @@ TabContents* TabContentsViewHelper::GetCreatedWindow(int route_id) { return new_contents; } -RenderWidgetHostView* TabContentsViewHelper::GetCreatedWidget(int route_id) { +RenderWidgetHostView* WebContentsViewHelper::GetCreatedWidget(int route_id) { PendingWidgetViews::iterator iter = pending_widget_views_.find(route_id); if (iter == pending_widget_views_.end()) { DCHECK(false); @@ -181,7 +181,7 @@ RenderWidgetHostView* TabContentsViewHelper::GetCreatedWidget(int route_id) { return widget_host_view; } -TabContents* TabContentsViewHelper::ShowCreatedWindow( +TabContents* WebContentsViewHelper::ShowCreatedWindow( WebContents* web_contents, int route_id, WindowOpenDisposition disposition, @@ -197,7 +197,7 @@ TabContents* TabContentsViewHelper::ShowCreatedWindow( return contents; } -RenderWidgetHostView* TabContentsViewHelper::ShowCreatedWidget( +RenderWidgetHostView* WebContentsViewHelper::ShowCreatedWidget( WebContents* web_contents, int route_id, bool is_fullscreen, diff --git a/content/browser/tab_contents/tab_contents_view_helper.h b/content/browser/web_contents/web_contents_view_helper.h index 33fbd3c7..b36bb0c 100644 --- a/content/browser/tab_contents/tab_contents_view_helper.h +++ b/content/browser/web_contents/web_contents_view_helper.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_HELPER_H_ -#define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_HELPER_H_ +#ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_HELPER_H_ +#define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_HELPER_H_ #pragma once #include <map> @@ -34,11 +34,11 @@ class Rect; // Provides helper methods that provide common implementations of some // WebContentsView methods. -class CONTENT_EXPORT TabContentsViewHelper +class CONTENT_EXPORT WebContentsViewHelper : public content::NotificationObserver { public: - TabContentsViewHelper(); - virtual ~TabContentsViewHelper(); + WebContentsViewHelper(); + virtual ~WebContentsViewHelper(); // Creates a new window; call |ShowCreatedWindow| below to show it. WebContentsImpl* CreateNewWindow( @@ -98,7 +98,7 @@ class CONTENT_EXPORT TabContentsViewHelper // Registers and unregisters us for notifications. content::NotificationRegistrar registrar_; - DISALLOW_COPY_AND_ASSIGN(TabContentsViewHelper); + DISALLOW_COPY_AND_ASSIGN(WebContentsViewHelper); }; -#endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_HELPER_H_ +#endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_HELPER_H_ diff --git a/content/browser/web_contents/web_contents_view_mac.h b/content/browser/web_contents/web_contents_view_mac.h index e8a0899..df3c80b 100644 --- a/content/browser/web_contents/web_contents_view_mac.h +++ b/content/browser/web_contents/web_contents_view_mac.h @@ -15,7 +15,7 @@ #include "base/memory/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" -#include "content/browser/tab_contents/tab_contents_view_helper.h" +#include "content/browser/web_contents/web_contents_view_helper.h" #include "content/public/browser/web_contents_view.h" #include "ui/base/cocoa/base_view.h" #include "ui/gfx/size.h" @@ -123,7 +123,7 @@ class WebContentsViewMac : public content::WebContentsView { WebContentsImpl* web_contents_; // Common implementations of some WebContentsView methods. - TabContentsViewHelper tab_contents_view_helper_; + WebContentsViewHelper web_contents_view_helper_; // The Cocoa NSView that lives in the view hierarchy. scoped_nsobject<WebContentsViewCocoa> cocoa_view_; diff --git a/content/browser/web_contents/web_contents_view_mac.mm b/content/browser/web_contents/web_contents_view_mac.mm index 0e49d0c..d30d728 100644 --- a/content/browser/web_contents/web_contents_view_mac.mm +++ b/content/browser/web_contents/web_contents_view_mac.mm @@ -269,13 +269,13 @@ void WebContentsViewMac::TakeFocus(bool reverse) { void WebContentsViewMac::CreateNewWindow( int route_id, const ViewHostMsg_CreateWindow_Params& params) { - tab_contents_view_helper_.CreateNewWindow(web_contents_, route_id, params); + web_contents_view_helper_.CreateNewWindow(web_contents_, route_id, params); } void WebContentsViewMac::CreateNewWidget( int route_id, WebKit::WebPopupType popup_type) { RenderWidgetHostView* widget_view = - tab_contents_view_helper_.CreateNewWidget(web_contents_, + web_contents_view_helper_.CreateNewWidget(web_contents_, route_id, false, popup_type); @@ -289,7 +289,7 @@ void WebContentsViewMac::CreateNewWidget( void WebContentsViewMac::CreateNewFullscreenWidget(int route_id) { RenderWidgetHostView* widget_view = - tab_contents_view_helper_.CreateNewWidget(web_contents_, + web_contents_view_helper_.CreateNewWidget(web_contents_, route_id, true, WebKit::WebPopupTypeNone); @@ -305,14 +305,14 @@ void WebContentsViewMac::ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture) { - tab_contents_view_helper_.ShowCreatedWindow( + web_contents_view_helper_.ShowCreatedWindow( web_contents_, route_id, disposition, initial_pos, user_gesture); } void WebContentsViewMac::ShowCreatedWidget( int route_id, const gfx::Rect& initial_pos) { RenderWidgetHostView* widget_host_view = - tab_contents_view_helper_.ShowCreatedWidget(web_contents_, + web_contents_view_helper_.ShowCreatedWidget(web_contents_, route_id, false, initial_pos); @@ -327,7 +327,7 @@ void WebContentsViewMac::ShowCreatedWidget( void WebContentsViewMac::ShowCreatedFullscreenWidget(int route_id) { RenderWidgetHostView* widget_host_view = - tab_contents_view_helper_.ShowCreatedWidget(web_contents_, + web_contents_view_helper_.ShowCreatedWidget(web_contents_, route_id, true, gfx::Rect()); diff --git a/content/browser/tab_contents/tab_contents_view_win.cc b/content/browser/web_contents/web_contents_view_win.cc index f0e4f4b..f5c5c01 100644 --- a/content/browser/tab_contents/tab_contents_view_win.cc +++ b/content/browser/web_contents/web_contents_view_win.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/tab_contents/tab_contents_view_win.h" +#include "content/browser/web_contents/web_contents_view_win.h" #include "base/bind.h" #include "content/browser/renderer_host/render_view_host_factory.h" @@ -55,14 +55,14 @@ class TempParent : public ui::WindowImpl { void OnClose() { } - BEGIN_MSG_MAP_EX(TabContentsViewWin) + BEGIN_MSG_MAP_EX(WebContentsViewWin) MSG_WM_CLOSE(OnClose) END_MSG_MAP() }; } // namespace namespace -TabContentsViewWin::TabContentsViewWin(TabContents* tab_contents, +WebContentsViewWin::WebContentsViewWin(TabContents* tab_contents, WebContentsViewDelegate* delegate) : tab_contents_(tab_contents), view_(NULL), @@ -70,12 +70,12 @@ TabContentsViewWin::TabContentsViewWin(TabContents* tab_contents, close_tab_after_drag_ends_(false) { } -TabContentsViewWin::~TabContentsViewWin() { +WebContentsViewWin::~WebContentsViewWin() { if (IsWindow(hwnd())) DestroyWindow(hwnd()); } -void TabContentsViewWin::CreateView(const gfx::Size& initial_size) { +void WebContentsViewWin::CreateView(const gfx::Size& initial_size) { initial_size_ = initial_size; set_window_style(WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); @@ -92,7 +92,7 @@ void TabContentsViewWin::CreateView(const gfx::Size& initial_size) { } } -RenderWidgetHostView* TabContentsViewWin::CreateViewForWidget( +RenderWidgetHostView* WebContentsViewWin::CreateViewForWidget( content::RenderWidgetHost* render_widget_host) { if (render_widget_host->GetView()) { // During testing, the view will already be set up in most cases to the @@ -112,20 +112,20 @@ RenderWidgetHostView* TabContentsViewWin::CreateViewForWidget( return view_; } -gfx::NativeView TabContentsViewWin::GetNativeView() const { +gfx::NativeView WebContentsViewWin::GetNativeView() const { return hwnd(); } -gfx::NativeView TabContentsViewWin::GetContentNativeView() const { +gfx::NativeView WebContentsViewWin::GetContentNativeView() const { RenderWidgetHostView* rwhv = tab_contents_->GetRenderWidgetHostView(); return rwhv ? rwhv->GetNativeView() : NULL; } -gfx::NativeWindow TabContentsViewWin::GetTopLevelNativeWindow() const { +gfx::NativeWindow WebContentsViewWin::GetTopLevelNativeWindow() const { return GetParent(GetNativeView()); } -void TabContentsViewWin::GetContainerBounds(gfx::Rect *out) const { +void WebContentsViewWin::GetContainerBounds(gfx::Rect *out) const { // Copied from NativeWidgetWin::GetClientAreaScreenBounds(). RECT r; GetClientRect(hwnd(), &r); @@ -134,20 +134,20 @@ void TabContentsViewWin::GetContainerBounds(gfx::Rect *out) const { *out = gfx::Rect(point.x, point.y, r.right - r.left, r.bottom - r.top); } -void TabContentsViewWin::SetPageTitle(const string16& title) { +void WebContentsViewWin::SetPageTitle(const string16& title) { // It's possible to get this after the hwnd has been destroyed. if (GetNativeView()) ::SetWindowText(GetNativeView(), title.c_str()); } -void TabContentsViewWin::OnTabCrashed(base::TerminationStatus status, +void WebContentsViewWin::OnTabCrashed(base::TerminationStatus status, int error_code) { // TODO(avi): No other TCV implementation does anything in this callback. Can // this be moved elsewhere so that |OnTabCrashed| can be removed everywhere? view_ = NULL; } -void TabContentsViewWin::SizeContents(const gfx::Size& size) { +void WebContentsViewWin::SizeContents(const gfx::Size& size) { gfx::Rect bounds; GetContainerBounds(&bounds); if (bounds.size() != size) { @@ -164,10 +164,10 @@ void TabContentsViewWin::SizeContents(const gfx::Size& size) { } } -void TabContentsViewWin::RenderViewCreated(RenderViewHost* host) { +void WebContentsViewWin::RenderViewCreated(RenderViewHost* host) { } -void TabContentsViewWin::Focus() { +void WebContentsViewWin::Focus() { if (tab_contents_->GetInterstitialPage()) { tab_contents_->GetInterstitialPage()->Focus(); return; @@ -181,28 +181,28 @@ void TabContentsViewWin::Focus() { rwhv->Focus(); } -void TabContentsViewWin::SetInitialFocus() { +void WebContentsViewWin::SetInitialFocus() { if (tab_contents_->FocusLocationBarByDefault()) tab_contents_->SetFocusToLocationBar(false); else Focus(); } -void TabContentsViewWin::StoreFocus() { +void WebContentsViewWin::StoreFocus() { if (delegate_.get()) delegate_->StoreFocus(); } -void TabContentsViewWin::RestoreFocus() { +void WebContentsViewWin::RestoreFocus() { if (delegate_.get()) delegate_->RestoreFocus(); } -bool TabContentsViewWin::IsDoingDrag() const { +bool WebContentsViewWin::IsDoingDrag() const { return drag_handler_.get() != NULL; } -void TabContentsViewWin::CancelDragAndCloseTab() { +void WebContentsViewWin::CancelDragAndCloseTab() { DCHECK(IsDoingDrag()); // We can't close the tab while we're in the drag and // |drag_handler_->CancelDrag()| is async. Instead, set a flag to cancel @@ -211,64 +211,64 @@ void TabContentsViewWin::CancelDragAndCloseTab() { close_tab_after_drag_ends_ = true; } -bool TabContentsViewWin::IsEventTracking() const { +bool WebContentsViewWin::IsEventTracking() const { return false; } -void TabContentsViewWin::CloseTabAfterEventTracking() { +void WebContentsViewWin::CloseTabAfterEventTracking() { } -void TabContentsViewWin::GetViewBounds(gfx::Rect* out) const { +void WebContentsViewWin::GetViewBounds(gfx::Rect* out) const { RECT r; GetWindowRect(hwnd(), &r); *out = gfx::Rect(r); } -void TabContentsViewWin::CreateNewWindow( +void WebContentsViewWin::CreateNewWindow( int route_id, const ViewHostMsg_CreateWindow_Params& params) { - tab_contents_view_helper_.CreateNewWindow(tab_contents_, route_id, params); + web_contents_view_helper_.CreateNewWindow(tab_contents_, route_id, params); } -void TabContentsViewWin::CreateNewWidget(int route_id, +void WebContentsViewWin::CreateNewWidget(int route_id, WebKit::WebPopupType popup_type) { - tab_contents_view_helper_.CreateNewWidget(tab_contents_, + web_contents_view_helper_.CreateNewWidget(tab_contents_, route_id, false, popup_type); } -void TabContentsViewWin::CreateNewFullscreenWidget(int route_id) { - tab_contents_view_helper_.CreateNewWidget(tab_contents_, +void WebContentsViewWin::CreateNewFullscreenWidget(int route_id) { + web_contents_view_helper_.CreateNewWidget(tab_contents_, route_id, true, WebKit::WebPopupTypeNone); } -void TabContentsViewWin::ShowCreatedWindow(int route_id, +void WebContentsViewWin::ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture) { - tab_contents_view_helper_.ShowCreatedWindow( + web_contents_view_helper_.ShowCreatedWindow( tab_contents_, route_id, disposition, initial_pos, user_gesture); } -void TabContentsViewWin::ShowCreatedWidget(int route_id, +void WebContentsViewWin::ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos) { - tab_contents_view_helper_.ShowCreatedWidget(tab_contents_, + web_contents_view_helper_.ShowCreatedWidget(tab_contents_, route_id, false, initial_pos); } -void TabContentsViewWin::ShowCreatedFullscreenWidget(int route_id) { - tab_contents_view_helper_.ShowCreatedWidget(tab_contents_, +void WebContentsViewWin::ShowCreatedFullscreenWidget(int route_id) { + web_contents_view_helper_.ShowCreatedWidget(tab_contents_, route_id, true, gfx::Rect()); } -void TabContentsViewWin::ShowContextMenu( +void WebContentsViewWin::ShowContextMenu( const content::ContextMenuParams& params) { // Allow WebContentsDelegates to handle the context menu operation first. if (tab_contents_->GetDelegate() && @@ -280,7 +280,7 @@ void TabContentsViewWin::ShowContextMenu( delegate_->ShowContextMenu(params); } -void TabContentsViewWin::ShowPopupMenu(const gfx::Rect& bounds, +void WebContentsViewWin::ShowPopupMenu(const gfx::Rect& bounds, int item_height, double item_font_size, int selected_item, @@ -290,7 +290,7 @@ void TabContentsViewWin::ShowPopupMenu(const gfx::Rect& bounds, NOTIMPLEMENTED(); } -void TabContentsViewWin::StartDragging(const WebDropData& drop_data, +void WebContentsViewWin::StartDragging(const WebDropData& drop_data, WebKit::WebDragOperationsMask operations, const SkBitmap& image, const gfx::Point& image_offset) { @@ -298,20 +298,20 @@ void TabContentsViewWin::StartDragging(const WebDropData& drop_data, GetNativeView(), tab_contents_, drag_dest_, - base::Bind(&TabContentsViewWin::EndDragging, base::Unretained(this))); + base::Bind(&WebContentsViewWin::EndDragging, base::Unretained(this))); drag_handler_->StartDragging(drop_data, operations, image, image_offset); } -void TabContentsViewWin::UpdateDragCursor(WebKit::WebDragOperation operation) { +void WebContentsViewWin::UpdateDragCursor(WebKit::WebDragOperation operation) { drag_dest_->set_drag_cursor(operation); } -void TabContentsViewWin::GotFocus() { +void WebContentsViewWin::GotFocus() { if (tab_contents_->GetDelegate()) tab_contents_->GetDelegate()->WebContentsFocused(tab_contents_); } -void TabContentsViewWin::TakeFocus(bool reverse) { +void WebContentsViewWin::TakeFocus(bool reverse) { if (tab_contents_->GetDelegate() && !tab_contents_->GetDelegate()->TakeFocus(reverse) && delegate_.get()) { @@ -319,21 +319,21 @@ void TabContentsViewWin::TakeFocus(bool reverse) { } } -void TabContentsViewWin::EndDragging() { +void WebContentsViewWin::EndDragging() { drag_handler_ = NULL; if (close_tab_after_drag_ends_) { close_tab_timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(0), - this, &TabContentsViewWin::CloseTab); + this, &WebContentsViewWin::CloseTab); } tab_contents_->SystemDragEnded(); } -void TabContentsViewWin::CloseTab() { +void WebContentsViewWin::CloseTab() { RenderViewHost* rvh = tab_contents_->GetRenderViewHost(); rvh->GetDelegate()->Close(rvh); } -LRESULT TabContentsViewWin::OnDestroy( +LRESULT WebContentsViewWin::OnDestroy( UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled) { if (drag_dest_.get()) { RevokeDragDrop(GetNativeView()); @@ -342,7 +342,7 @@ LRESULT TabContentsViewWin::OnDestroy( return 0; } -LRESULT TabContentsViewWin::OnWindowPosChanged( +LRESULT WebContentsViewWin::OnWindowPosChanged( UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled) { WINDOWPOS* window_pos = reinterpret_cast<WINDOWPOS*>(lparam); if (window_pos->flags & SWP_HIDEWINDOW) { @@ -375,7 +375,7 @@ LRESULT TabContentsViewWin::OnWindowPosChanged( return 0; } -LRESULT TabContentsViewWin::OnMouseDown( +LRESULT WebContentsViewWin::OnMouseDown( UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled) { // Make sure this TabContents is activated when it is clicked on. if (tab_contents_->GetDelegate()) @@ -383,7 +383,7 @@ LRESULT TabContentsViewWin::OnMouseDown( return 0; } -LRESULT TabContentsViewWin::OnMouseMove( +LRESULT WebContentsViewWin::OnMouseMove( UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled) { // Let our delegate know that the mouse moved (useful for resetting status // bubble state). @@ -394,7 +394,7 @@ LRESULT TabContentsViewWin::OnMouseMove( return 0; } -LRESULT TabContentsViewWin::OnReflectedMessage( +LRESULT WebContentsViewWin::OnReflectedMessage( UINT msg, WPARAM wparam, LPARAM lparam, BOOL& handled) { MSG* message = reinterpret_cast<MSG*>(lparam); switch (message->message) { @@ -410,7 +410,7 @@ LRESULT TabContentsViewWin::OnReflectedMessage( return 0; } -LRESULT TabContentsViewWin::OnNCCalcSize( +LRESULT WebContentsViewWin::OnNCCalcSize( UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled) { // Hack for ThinkPad mouse wheel driver. We have set the fake scroll bars // to receive scroll messages from ThinkPad touch-pad driver. Suppress @@ -418,7 +418,7 @@ LRESULT TabContentsViewWin::OnNCCalcSize( return 0; } -LRESULT TabContentsViewWin::OnScroll( +LRESULT WebContentsViewWin::OnScroll( UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled) { int scroll_type = LOWORD(wparam); short position = HIWORD(wparam); @@ -459,7 +459,7 @@ LRESULT TabContentsViewWin::OnScroll( return 0; } -LRESULT TabContentsViewWin::OnSize( +LRESULT WebContentsViewWin::OnSize( UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled) { // NOTE: Because we handle OnWindowPosChanged without calling DefWindowProc, // OnSize is NOT called on window resize. This handler is called only once diff --git a/content/browser/tab_contents/tab_contents_view_win.h b/content/browser/web_contents/web_contents_view_win.h index 28ffee5..e5b9cba 100644 --- a/content/browser/tab_contents/tab_contents_view_win.h +++ b/content/browser/web_contents/web_contents_view_win.h @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_WIN_H_ -#define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_WIN_H_ +#ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_WIN_H_ +#define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_WIN_H_ #pragma once #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/timer.h" #include "base/win/win_util.h" -#include "content/browser/tab_contents/tab_contents_view_helper.h" +#include "content/browser/web_contents/web_contents_view_helper.h" #include "content/common/content_export.h" #include "content/public/browser/web_contents_view.h" #include "ui/base/win/window_impl.h" @@ -24,14 +24,14 @@ class WebContentsViewDelegate; } // An implementation of WebContentsView for Windows. -class CONTENT_EXPORT TabContentsViewWin : public content::WebContentsView, +class CONTENT_EXPORT WebContentsViewWin : public content::WebContentsView, public ui::WindowImpl { public: - TabContentsViewWin(WebContentsImpl* web_contents, + WebContentsViewWin(WebContentsImpl* web_contents, content::WebContentsViewDelegate* delegate); - virtual ~TabContentsViewWin(); + virtual ~WebContentsViewWin(); - BEGIN_MSG_MAP_EX(TabContentsViewWin) + BEGIN_MSG_MAP_EX(WebContentsViewWin) MESSAGE_HANDLER(WM_DESTROY, OnDestroy) MESSAGE_HANDLER(WM_WINDOWPOSCHANGED, OnWindowPosChanged) MESSAGE_HANDLER(WM_LBUTTONDOWN, OnMouseDown) @@ -143,12 +143,12 @@ class CONTENT_EXPORT TabContentsViewWin : public content::WebContentsView, bool close_tab_after_drag_ends_; // Used to close the tab after the stack has unwound. - base::OneShotTimer<TabContentsViewWin> close_tab_timer_; + base::OneShotTimer<WebContentsViewWin> close_tab_timer_; // Common implementations of some WebContentsView methods. - TabContentsViewHelper tab_contents_view_helper_; + WebContentsViewHelper web_contents_view_helper_; - DISALLOW_COPY_AND_ASSIGN(TabContentsViewWin); + DISALLOW_COPY_AND_ASSIGN(WebContentsViewWin); }; -#endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_WIN_H_ +#endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_WIN_H_ diff --git a/content/content_browser.gypi b/content/content_browser.gypi index 3367bb9..b8a9627 100644 --- a/content/content_browser.gypi +++ b/content/content_browser.gypi @@ -653,14 +653,6 @@ 'browser/system_message_window_win.h', 'browser/tab_contents/tab_contents.cc', 'browser/tab_contents/tab_contents.h', - 'browser/tab_contents/tab_contents_view_aura.cc', - 'browser/tab_contents/tab_contents_view_aura.h', - 'browser/tab_contents/tab_contents_view_gtk.cc', - 'browser/tab_contents/tab_contents_view_gtk.h', - 'browser/tab_contents/tab_contents_view_helper.cc', - 'browser/tab_contents/tab_contents_view_helper.h', - 'browser/tab_contents/tab_contents_view_win.cc', - 'browser/tab_contents/tab_contents_view_win.h', 'browser/web_contents/debug_urls.cc', 'browser/web_contents/debug_urls.h', 'browser/web_contents/drag_utils_gtk.cc', @@ -679,8 +671,16 @@ 'browser/web_contents/web_contents_drag_win.h', 'browser/web_contents/web_contents_view_android.cc', 'browser/web_contents/web_contents_view_android.h', + 'browser/web_contents/web_contents_view_aura.cc', + 'browser/web_contents/web_contents_view_aura.h', + 'browser/web_contents/web_contents_view_gtk.cc', + 'browser/web_contents/web_contents_view_gtk.h', + 'browser/web_contents/web_contents_view_helper.cc', + 'browser/web_contents/web_contents_view_helper.h', 'browser/web_contents/web_contents_view_mac.h', 'browser/web_contents/web_contents_view_mac.mm', + 'browser/web_contents/web_contents_view_win.cc', + 'browser/web_contents/web_contents_view_win.h', 'browser/web_contents/web_drag_dest_gtk.cc', 'browser/web_contents/web_drag_dest_gtk.h', 'browser/web_contents/web_drag_dest_mac.h', @@ -871,10 +871,10 @@ ['exclude', '^browser/renderer_host/render_widget_host_view_win.h'], ['exclude', '^browser/renderer_host/render_message_filter_win.cc'], ['exclude', '^browser/renderer_host/tap_suppression_controller.cc'], - ['exclude', '^browser/tab_contents/tab_contents_view_win.cc'], - ['exclude', '^browser/tab_contents/tab_contents_view_win.h'], ['exclude', '^browser/web_contents/web_contents_drag_win.cc'], ['exclude', '^browser/web_contents/web_contents_drag_win.h'], + ['exclude', '^browser/web_contents/web_contents_view_win.cc'], + ['exclude', '^browser/web_contents/web_contents_view_win.h'], ['exclude', '^browser/web_contents/web_drag_dest_win.cc'], ['exclude', '^browser/web_contents/web_drag_dest_win.h'], ['exclude', '^browser/web_contents/web_drag_source_win.cc'], diff --git a/content/public/browser/web_contents_view_delegate.h b/content/public/browser/web_contents_view_delegate.h index 109f1c1..401638e 100644 --- a/content/public/browser/web_contents_view_delegate.h +++ b/content/public/browser/web_contents_view_delegate.h @@ -60,8 +60,8 @@ class CONTENT_EXPORT WebContentsViewDelegate { ui::FocusStoreGtk* focus_store) = 0; // Returns the top widget that contains |view| passed in from WrapView. This - // is exposed through TabContentsViewGtk::GetNativeView() when a wrapper is - // supplied to a TabContentsViewGtk. + // is exposed through WebContentsViewGtk::GetNativeView() when a wrapper is + // supplied to a WebContentsViewGtk. virtual gfx::NativeView GetNativeView() const = 0; // Handles a focus event from the renderer process. diff --git a/tools/valgrind/memcheck/suppressions.txt b/tools/valgrind/memcheck/suppressions.txt index 2dda4f9..394233d 100644 --- a/tools/valgrind/memcheck/suppressions.txt +++ b/tools/valgrind/memcheck/suppressions.txt @@ -5697,7 +5697,7 @@ Memcheck:Unaddressable fun:_ZN4aura6WindowD0Ev fun:_ZN10scoped_ptrIN4aura6WindowEED1Ev - fun:_ZN19TabContentsViewAuraD0Ev + fun:_ZN19WebContentsViewAuraD0Ev fun:_ZN10scoped_ptrIN7content15WebContentsViewEED1Ev fun:_ZN15WebContentsImplD0Ev fun:_ZN10scoped_ptrIN7content11WebContentsEE5resetEPS1_ |