diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-20 22:05:12 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-20 22:05:12 +0000 |
commit | e69bce3dd3e31039bc1072ae2aa63485d094ecd0 (patch) | |
tree | 7767051d7c655a481664596160aace7eb59fd419 /chrome | |
parent | 77bc673bf31c32bfdcb1bf139c3a58eace23e3ea (diff) | |
download | chromium_src-e69bce3dd3e31039bc1072ae2aa63485d094ecd0.zip chromium_src-e69bce3dd3e31039bc1072ae2aa63485d094ecd0.tar.gz chromium_src-e69bce3dd3e31039bc1072ae2aa63485d094ecd0.tar.bz2 |
Rename WebContentsView* to TabContentsView* in preparation for merging
TabContents and WebContents.
This also removes the Destroy method from the print manager's header file. I
removed the impl in a previous change but forgot the header.
Review URL: http://codereview.chromium.org/90004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14063 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
21 files changed, 189 insertions, 193 deletions
diff --git a/chrome/browser/extensions/extension_view.cc b/chrome/browser/extensions/extension_view.cc index 4b3104d..8fe6baa 100755 --- a/chrome/browser/extensions/extension_view.cc +++ b/chrome/browser/extensions/extension_view.cc @@ -143,7 +143,7 @@ void ExtensionView::ShowCreatedWidget(int route_id, RenderWidgetHostView* widget_host_view = delegate_view_helper_.GetCreatedWidget(route_id); browser_->RenderWidgetShowing(); - // TODO(erikkay): These two lines could be refactored with WebContentsView. + // TODO(erikkay): These two lines could be refactored with TabContentsView. widget_host_view->InitAsPopup(render_view_host()->view(), initial_pos); widget_host_view->GetRenderWidgetHost()->Init(); diff --git a/chrome/browser/printing/print_view_manager.h b/chrome/browser/printing/print_view_manager.h index 698c714..918b99b 100644 --- a/chrome/browser/printing/print_view_manager.h +++ b/chrome/browser/printing/print_view_manager.h @@ -27,10 +27,6 @@ class PrintViewManager : public NotificationObserver, PrintViewManager(WebContents& owner); virtual ~PrintViewManager(); - // Destroys the "Print..." dialog, makes sure the pages are finished rendering - // and release the print job. - void Destroy(); - // Cancels the print job. void Stop(); diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc index 32f3ab6..771d4be 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc @@ -42,7 +42,7 @@ class TestSafeBrowsingBlockingPage : public SafeBrowsingBlockingPage { } // Overriden from InterstitialPage. Don't create a view. - virtual WebContentsView* CreateWebContentsView() { + virtual TabContentsView* CreateTabContentsView() { return NULL; } }; diff --git a/chrome/browser/tab_contents/interstitial_page.cc b/chrome/browser/tab_contents/interstitial_page.cc index 1ffff17..b7c24b2 100644 --- a/chrome/browser/tab_contents/interstitial_page.cc +++ b/chrome/browser/tab_contents/interstitial_page.cc @@ -174,7 +174,7 @@ void InterstitialPage::Show() { DCHECK(!render_view_host_); render_view_host_ = CreateRenderViewHost(); - CreateWebContentsView(); + CreateTabContentsView(); std::string data_url = "data:text/html;charset=utf-8," + EscapePath(GetHTMLContents()); @@ -257,8 +257,8 @@ RenderViewHost* InterstitialPage::CreateRenderViewHost() { return render_view_host; } -WebContentsView* InterstitialPage::CreateWebContentsView() { - WebContentsView* web_contents_view = tab()->view(); +TabContentsView* InterstitialPage::CreateTabContentsView() { + TabContentsView* web_contents_view = tab()->view(); RenderWidgetHostView* view = web_contents_view->CreateViewForWidget(render_view_host_); render_view_host_->set_view(view); diff --git a/chrome/browser/tab_contents/interstitial_page.h b/chrome/browser/tab_contents/interstitial_page.h index 3d66193..1c42520 100644 --- a/chrome/browser/tab_contents/interstitial_page.h +++ b/chrome/browser/tab_contents/interstitial_page.h @@ -16,7 +16,7 @@ class MessageLoop; class NavigationEntry; class WebContents; -class WebContentsView; +class TabContentsView; // This class is a base class for interstitial pages, pages that show some // informative message asking for user validation before reaching the target @@ -116,9 +116,9 @@ class InterstitialPage : public NotificationObserver, // Overriden in unit tests. virtual RenderViewHost* CreateRenderViewHost(); - // Creates the WebContentsView that shows the interstitial RVH. + // Creates the TabContentsView that shows the interstitial RVH. // Overriden in unit tests. - virtual WebContentsView* CreateWebContentsView(); + virtual TabContentsView* CreateTabContentsView(); private: // AutomationProvider needs access to Proceed and DontProceed to simulate diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc index 9268850..5dd3c17 100644 --- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc +++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc @@ -23,13 +23,13 @@ void RenderViewHostDelegateViewHelper::CreateNewWindow(int route_id, base::WaitableEvent* modal_dialog_event, Profile* profile, SiteInstance* site) { // Create the new web contents. This will automatically create the new - // WebContentsView. In the future, we may want to create the view separately. + // TabContentsView. In the future, we may want to create the view separately. WebContents* new_contents = new WebContents(profile, site, route_id, modal_dialog_event); - WebContentsView* new_view = new_contents->view(); + TabContentsView* new_view = new_contents->view(); // TODO(brettw) it seems bogus that we have to call this function on the // newly created object and give it one of its own member variables. diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 226ce5b..c084afa 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -352,7 +352,7 @@ void TabContents::DidMoveOrResize(ConstrainedWindow* window) { } #if defined(OS_WIN) -// TODO(brettw) This should be on the WebContentsView. +// TODO(brettw) This should be on the TabContentsView. void TabContents::RepositionSupressedPopupsToFit(const gfx::Size& new_size) { // TODO(erg): There's no way to detect whether scroll bars are // visible, so for beta, we're just going to assume that the diff --git a/chrome/browser/tab_contents/web_contents.cc b/chrome/browser/tab_contents/web_contents.cc index 8592522..0aa3863 100644 --- a/chrome/browser/tab_contents/web_contents.cc +++ b/chrome/browser/tab_contents/web_contents.cc @@ -204,7 +204,7 @@ WebContents::WebContents(Profile* profile, int routing_id, base::WaitableEvent* modal_dialog_event) : TabContents(profile), - view_(WebContentsView::Create(this)), + view_(TabContentsView::Create(this)), ALLOW_THIS_IN_INITIALIZER_LIST(render_manager_(this, this)), printing_(*this), notify_disconnection_(false), @@ -1575,7 +1575,7 @@ void WebContents::BeforeUnloadFiredFromRenderManager( } void WebContents::UpdateRenderViewSizeForRenderManager() { - // TODO(brettw) this is a hack. See WebContentsView::SizeContents. + // TODO(brettw) this is a hack. See TabContentsView::SizeContents. view_->SizeContents(view_->GetContainerSize()); } diff --git a/chrome/browser/tab_contents/web_contents.h b/chrome/browser/tab_contents/web_contents.h index 9128868..5840924 100644 --- a/chrome/browser/tab_contents/web_contents.h +++ b/chrome/browser/tab_contents/web_contents.h @@ -44,7 +44,7 @@ class RenderWidgetHost; struct ThumbnailScore; struct ViewHostMsg_FrameNavigate_Params; struct ViewHostMsg_DidPrintPage_Params; -class WebContentsView; +class TabContentsView; namespace base { class WaitableEvent; @@ -100,8 +100,8 @@ class WebContents : public TabContents, return render_manager_.current_host(); } - // The WebContentsView will never change and is guaranteed non-NULL. - WebContentsView* view() const { + // The TabContentsView will never change and is guaranteed non-NULL. + TabContentsView* view() const { return view_.get(); } @@ -474,13 +474,13 @@ class WebContents : public TabContents, friend class TestWebContents; // Temporary until the view/contents separation is complete. - friend class WebContentsView; + friend class TabContentsView; #if defined(OS_WIN) - friend class WebContentsViewWin; + friend class TabContentsViewWin; #elif defined(OS_MACOSX) - friend class WebContentsViewMac; + friend class TabContentsViewMac; #elif defined(OS_LINUX) - friend class WebContentsViewGtk; + friend class TabContentsViewGtk; #endif // So InterstitialPage can access SetIsLoading. @@ -586,7 +586,7 @@ class WebContents : public TabContents, // Data ---------------------------------------------------------------------- // The corresponding view. - scoped_ptr<WebContentsView> view_; + scoped_ptr<TabContentsView> view_; // Manages creation and swapping of render views. RenderViewHostManager render_manager_; diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc index 207a724..5c91259 100644 --- a/chrome/browser/tab_contents/web_contents_unittest.cc +++ b/chrome/browser/tab_contents/web_contents_unittest.cc @@ -150,7 +150,7 @@ class TestInterstitialPage : public InterstitialPage { this, MSG_ROUTING_NONE, NULL); } - virtual WebContentsView* CreateWebContentsView() { return NULL; } + virtual TabContentsView* CreateTabContentsView() { return NULL; } virtual void CommandReceived(const std::string& command) { diff --git a/chrome/browser/tab_contents/web_contents_view.cc b/chrome/browser/tab_contents/web_contents_view.cc index 2a7a3d9..df61486 100644 --- a/chrome/browser/tab_contents/web_contents_view.cc +++ b/chrome/browser/tab_contents/web_contents_view.cc @@ -10,29 +10,29 @@ #include "chrome/browser/tab_contents/tab_contents_delegate.h" #include "chrome/browser/tab_contents/web_contents.h" -WebContentsView::WebContentsView(WebContents* web_contents) +TabContentsView::TabContentsView(WebContents* web_contents) : web_contents_(web_contents) { } -void WebContentsView::CreateView() { +void TabContentsView::CreateView() { } -void WebContentsView::RenderWidgetHostDestroyed(RenderWidgetHost* host) { +void TabContentsView::RenderWidgetHostDestroyed(RenderWidgetHost* host) { delegate_view_helper_.RenderWidgetHostDestroyed(host); } -void WebContentsView::CreateNewWindow(int route_id, +void TabContentsView::CreateNewWindow(int route_id, base::WaitableEvent* modal_dialog_event) { delegate_view_helper_.CreateNewWindow(route_id, modal_dialog_event, web_contents_->profile(), web_contents_->GetSiteInstance()); } -void WebContentsView::CreateNewWidget(int route_id, bool activatable) { +void TabContentsView::CreateNewWidget(int route_id, bool activatable) { CreateNewWidgetInternal(route_id, activatable); } -void WebContentsView::ShowCreatedWindow(int route_id, +void TabContentsView::ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture) { @@ -43,20 +43,20 @@ void WebContentsView::ShowCreatedWindow(int route_id, } } -void WebContentsView::ShowCreatedWidget(int route_id, +void TabContentsView::ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos) { RenderWidgetHostView* widget_host_view = delegate_view_helper_.GetCreatedWidget(route_id); ShowCreatedWidgetInternal(widget_host_view, initial_pos); } -RenderWidgetHostView* WebContentsView::CreateNewWidgetInternal( +RenderWidgetHostView* TabContentsView::CreateNewWidgetInternal( int route_id, bool activatable) { return delegate_view_helper_.CreateNewWidget(route_id, activatable, web_contents()->render_view_host()->process()); } -void WebContentsView::ShowCreatedWidgetInternal( +void TabContentsView::ShowCreatedWidgetInternal( RenderWidgetHostView* widget_host_view, const gfx::Rect& initial_pos) { if (web_contents_->delegate()) web_contents_->delegate()->RenderWidgetShowing(); diff --git a/chrome/browser/tab_contents/web_contents_view.h b/chrome/browser/tab_contents/web_contents_view.h index 6f57690..875a6f6 100644 --- a/chrome/browser/tab_contents/web_contents_view.h +++ b/chrome/browser/tab_contents/web_contents_view.h @@ -26,22 +26,22 @@ namespace base { class WaitableEvent; } -// The WebContentsView is an interface that is implemented by the platform- +// The TabContentsView is an interface that is implemented by the platform- // dependent web contents views. The WebContents uses this interface to talk to // them. View-related messages will also get forwarded directly to this class // from RenderViewHost via RenderViewHostDelegate::View. // // It contains a small amount of logic with respect to creating new sub-view // that should be the same for all platforms. -class WebContentsView : public RenderViewHostDelegate::View { +class TabContentsView : public RenderViewHostDelegate::View { public: - explicit WebContentsView(WebContents* web_contents); - virtual ~WebContentsView() {} + explicit TabContentsView(WebContents* web_contents); + virtual ~TabContentsView() {} - // Creates the appropriate type of WebContentsView for the current system. + // Creates the appropriate type of TabContentsView for the current system. // The return value is a new heap allocated view with ownership passing to // the caller. - static WebContentsView* Create(WebContents* web_contents); + static TabContentsView* Create(WebContents* web_contents); WebContents* web_contents() const { return web_contents_; } @@ -129,7 +129,7 @@ class WebContentsView : public RenderViewHostDelegate::View { virtual void SetChildSize(RenderWidgetHostView* rwh_view) = 0; protected: - WebContentsView() {} // Abstract interface. + TabContentsView() {} // Abstract interface. // Internal functions used to support the CreateNewWidget() method. If a // platform requires plugging into widget creation at a lower level then a @@ -174,7 +174,7 @@ class WebContentsView : public RenderViewHostDelegate::View { typedef std::map<int, RenderWidgetHostView*> PendingWidgetViews; PendingWidgetViews pending_widget_views_; - DISALLOW_COPY_AND_ASSIGN(WebContentsView); + DISALLOW_COPY_AND_ASSIGN(TabContentsView); }; #endif // CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_VIEW_H_ diff --git a/chrome/browser/tab_contents/web_contents_view_gtk.cc b/chrome/browser/tab_contents/web_contents_view_gtk.cc index 96c95f3..d6d5f12 100644 --- a/chrome/browser/tab_contents/web_contents_view_gtk.cc +++ b/chrome/browser/tab_contents/web_contents_view_gtk.cc @@ -56,25 +56,25 @@ gboolean OnMouseMove(GtkWidget* widget, GdkEventMotion* event, } // namespace // static -WebContentsView* WebContentsView::Create(WebContents* web_contents) { - return new WebContentsViewGtk(web_contents); +TabContentsView* TabContentsView::Create(WebContents* web_contents) { + return new TabContentsViewGtk(web_contents); } -WebContentsViewGtk::WebContentsViewGtk(WebContents* web_contents) - : WebContentsView(web_contents), +TabContentsViewGtk::TabContentsViewGtk(WebContents* web_contents) + : TabContentsView(web_contents), vbox_(gtk_vbox_new(FALSE, 0)), content_view_(NULL) { } -WebContentsViewGtk::~WebContentsViewGtk() { +TabContentsViewGtk::~TabContentsViewGtk() { vbox_.Destroy(); } -void WebContentsViewGtk::CreateView() { +void TabContentsViewGtk::CreateView() { NOTIMPLEMENTED(); } -RenderWidgetHostView* WebContentsViewGtk::CreateViewForWidget( +RenderWidgetHostView* TabContentsViewGtk::CreateViewForWidget( RenderWidgetHost* render_widget_host) { if (render_widget_host->view()) { // During testing, the view will already be set up in most cases to the @@ -104,20 +104,20 @@ RenderWidgetHostView* WebContentsViewGtk::CreateViewForWidget( return view; } -gfx::NativeView WebContentsViewGtk::GetNativeView() const { +gfx::NativeView TabContentsViewGtk::GetNativeView() const { return vbox_.get(); } -gfx::NativeView WebContentsViewGtk::GetContentNativeView() const { +gfx::NativeView TabContentsViewGtk::GetContentNativeView() const { return content_view_; } -gfx::NativeWindow WebContentsViewGtk::GetTopLevelNativeWindow() const { +gfx::NativeWindow TabContentsViewGtk::GetTopLevelNativeWindow() const { GtkWidget* window = gtk_widget_get_ancestor(GetNativeView(), GTK_TYPE_WINDOW); return window ? GTK_WINDOW(window) : NULL; } -void WebContentsViewGtk::GetContainerBounds(gfx::Rect* out) const { +void TabContentsViewGtk::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 @@ -126,83 +126,83 @@ void WebContentsViewGtk::GetContainerBounds(gfx::Rect* out) const { vbox_.get()->allocation.width, vbox_.get()->allocation.height); } -void WebContentsViewGtk::OnContentsDestroy() { +void TabContentsViewGtk::OnContentsDestroy() { // TODO(estade): Windows uses this function cancel pending drag-n-drop drags. // We don't have drags yet, so do nothing for now. } -void WebContentsViewGtk::SetPageTitle(const std::wstring& title) { +void TabContentsViewGtk::SetPageTitle(const std::wstring& title) { // Set the window name to include the page title so it's easier to spot // when debugging (e.g. via xwininfo -tree). if (content_view_ && content_view_->window) gdk_window_set_title(content_view_->window, WideToUTF8(title).c_str()); } -void WebContentsViewGtk::Invalidate() { +void TabContentsViewGtk::Invalidate() { NOTIMPLEMENTED(); } -void WebContentsViewGtk::SizeContents(const gfx::Size& size) { +void TabContentsViewGtk::SizeContents(const gfx::Size& size) { NOTIMPLEMENTED(); } -void WebContentsViewGtk::FindInPage(const Browser& browser, +void TabContentsViewGtk::FindInPage(const Browser& browser, bool find_next, bool forward_direction) { NOTIMPLEMENTED(); } -void WebContentsViewGtk::HideFindBar(bool end_session) { +void TabContentsViewGtk::HideFindBar(bool end_session) { NOTIMPLEMENTED(); } -void WebContentsViewGtk::ReparentFindWindow(Browser* new_browser) const { +void TabContentsViewGtk::ReparentFindWindow(Browser* new_browser) const { NOTIMPLEMENTED(); } -bool WebContentsViewGtk::GetFindBarWindowInfo(gfx::Point* position, +bool TabContentsViewGtk::GetFindBarWindowInfo(gfx::Point* position, bool* fully_visible) const { NOTIMPLEMENTED(); return false; } -void WebContentsViewGtk::Focus() { +void TabContentsViewGtk::Focus() { } -void WebContentsViewGtk::SetInitialFocus() { +void TabContentsViewGtk::SetInitialFocus() { if (web_contents()->FocusLocationBarByDefault()) web_contents()->delegate()->SetFocusToLocationBar(); else gtk_widget_grab_focus(content_view_); } -void WebContentsViewGtk::StoreFocus() { +void TabContentsViewGtk::StoreFocus() { NOTIMPLEMENTED(); } -void WebContentsViewGtk::RestoreFocus() { +void TabContentsViewGtk::RestoreFocus() { // TODO(estade): implement this function. // For now just assume we are viewing the tab for the first time. SetInitialFocus(); NOTIMPLEMENTED() << " -- need to restore the focus position on this page."; } -void WebContentsViewGtk::SetChildSize(RenderWidgetHostView* rwh_view) { +void TabContentsViewGtk::SetChildSize(RenderWidgetHostView* rwh_view) { // Packing the gtk widget in a container will cause a configure-event to be // sent to the widget. gtk_box_pack_start(GTK_BOX(vbox_.get()), content_view_, TRUE, TRUE, 0); } -void WebContentsViewGtk::UpdateDragCursor(bool is_drop_target) { +void TabContentsViewGtk::UpdateDragCursor(bool is_drop_target) { NOTIMPLEMENTED(); } // This is called when we the renderer asks us to take focus back (i.e., it has // iterated past the last focusable element on the page). -void WebContentsViewGtk::TakeFocus(bool reverse) { +void TabContentsViewGtk::TakeFocus(bool reverse) { web_contents()->delegate()->SetFocusToLocationBar(); } -void WebContentsViewGtk::HandleKeyboardEvent( +void TabContentsViewGtk::HandleKeyboardEvent( const NativeWebKeyboardEvent& event) { // This may be an accelerator. Try to pass it on to our browser window // to handle. @@ -223,7 +223,7 @@ void WebContentsViewGtk::HandleKeyboardEvent( static_cast<GdkModifierType>(event.os_event->state)); } -void WebContentsViewGtk::OnFindReply(int request_id, +void TabContentsViewGtk::OnFindReply(int request_id, int number_of_matches, const gfx::Rect& selection_rect, int active_match_ordinal, @@ -231,13 +231,13 @@ void WebContentsViewGtk::OnFindReply(int request_id, NOTIMPLEMENTED(); } -void WebContentsViewGtk::ShowContextMenu(const ContextMenuParams& params) { +void TabContentsViewGtk::ShowContextMenu(const ContextMenuParams& params) { context_menu_.reset(new RenderViewContextMenuGtk(web_contents(), params, last_mouse_down_time_)); context_menu_->Popup(); } -void WebContentsViewGtk::StartDragging(const WebDropData& drop_data) { +void TabContentsViewGtk::StartDragging(const WebDropData& drop_data) { NOTIMPLEMENTED(); // Until we have d'n'd implemented, just immediately pretend we're @@ -248,8 +248,8 @@ void WebContentsViewGtk::StartDragging(const WebDropData& drop_data) { web_contents()->render_view_host()->DragSourceSystemDragEnded(); } -gboolean WebContentsViewGtk::OnMouseDown(GtkWidget* widget, - GdkEventButton* event, WebContentsViewGtk* view) { +gboolean TabContentsViewGtk::OnMouseDown(GtkWidget* widget, + GdkEventButton* event, TabContentsViewGtk* view) { view->last_mouse_down_time_ = event->time; return FALSE; } diff --git a/chrome/browser/tab_contents/web_contents_view_gtk.h b/chrome/browser/tab_contents/web_contents_view_gtk.h index 6b3707b..773a032 100644 --- a/chrome/browser/tab_contents/web_contents_view_gtk.h +++ b/chrome/browser/tab_contents/web_contents_view_gtk.h @@ -11,15 +11,15 @@ class RenderViewContextMenuGtk; -class WebContentsViewGtk : public WebContentsView { +class TabContentsViewGtk : public TabContentsView { public: // The corresponding WebContents 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. - explicit WebContentsViewGtk(WebContents* web_contents); - virtual ~WebContentsViewGtk(); + explicit TabContentsViewGtk(WebContents* web_contents); + virtual ~TabContentsViewGtk(); - // WebContentsView implementation -------------------------------------------- + // TabContentsView implementation -------------------------------------------- virtual void CreateView(); virtual RenderWidgetHostView* CreateViewForWidget( @@ -60,7 +60,7 @@ class WebContentsViewGtk : public WebContentsView { private: // We keep track of the timestamp of the latest mousedown event. static gboolean OnMouseDown(GtkWidget* widget, - GdkEventButton* event, WebContentsViewGtk* view); + GdkEventButton* event, TabContentsViewGtk* view); // The native widget for the tab. OwnedWidgetGtk vbox_; @@ -76,7 +76,7 @@ class WebContentsViewGtk : public WebContentsView { // show context menus. guint32 last_mouse_down_time_; - DISALLOW_COPY_AND_ASSIGN(WebContentsViewGtk); + DISALLOW_COPY_AND_ASSIGN(TabContentsViewGtk); }; #endif // CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_VIEW_GTK_H_ diff --git a/chrome/browser/tab_contents/web_contents_view_mac.h b/chrome/browser/tab_contents/web_contents_view_mac.h index dde763a..9819fd5 100644 --- a/chrome/browser/tab_contents/web_contents_view_mac.h +++ b/chrome/browser/tab_contents/web_contents_view_mac.h @@ -16,27 +16,27 @@ class FindBarMac; @class SadTabView; -class WebContentsViewMac; +class TabContentsViewMac; -@interface WebContentsViewCocoa : BaseView { +@interface TabContentsViewCocoa : BaseView { @private - WebContentsViewMac* webContentsView_; // WEAK; owns us + TabContentsViewMac* TabContentsView_; // WEAK; owns us } @end -// Mac-specific implementation of the WebContentsView. It owns an NSView that +// Mac-specific implementation of the TabContentsView. It owns an NSView that // contains all of the contents of the tab and associated child views. -class WebContentsViewMac : public WebContentsView, +class TabContentsViewMac : public TabContentsView, public NotificationObserver { public: // The corresponding WebContents 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. - explicit WebContentsViewMac(WebContents* web_contents); - virtual ~WebContentsViewMac(); + explicit TabContentsViewMac(WebContents* web_contents); + virtual ~TabContentsViewMac(); - // WebContentsView implementation -------------------------------------------- + // TabContentsView implementation -------------------------------------------- virtual void CreateView(); virtual RenderWidgetHostView* CreateViewForWidget( @@ -86,7 +86,7 @@ class WebContentsViewMac : public WebContentsView, // --------------------------------------------------------------------------- // The Cocoa NSView that lives in the view hierarchy. - scoped_nsobject<WebContentsViewCocoa> cocoa_view_; + scoped_nsobject<TabContentsViewCocoa> cocoa_view_; // For find in page. This may be NULL if there is no find bar, and if it is // non-NULL, it may or may not be visible. @@ -99,7 +99,7 @@ class WebContentsViewMac : public WebContentsView, // visible. scoped_nsobject<SadTabView> sad_tab_; - DISALLOW_COPY_AND_ASSIGN(WebContentsViewMac); + DISALLOW_COPY_AND_ASSIGN(TabContentsViewMac); }; #endif // CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_VIEW_MAC_H_ diff --git a/chrome/browser/tab_contents/web_contents_view_mac.mm b/chrome/browser/tab_contents/web_contents_view_mac.mm index fd76cd5..76b8056 100644 --- a/chrome/browser/tab_contents/web_contents_view_mac.mm +++ b/chrome/browser/tab_contents/web_contents_view_mac.mm @@ -15,34 +15,34 @@ #include "chrome/common/temp_scaffolding_stubs.h" -@interface WebContentsViewCocoa (Private) -- (id)initWithWebContentsViewMac:(WebContentsViewMac*)w; +@interface TabContentsViewCocoa (Private) +- (id)initWithTabContentsViewMac:(TabContentsViewMac*)w; - (void)processKeyboardEvent:(NSEvent*)event; @end // static -WebContentsView* WebContentsView::Create(WebContents* web_contents) { - return new WebContentsViewMac(web_contents); +TabContentsView* TabContentsView::Create(WebContents* web_contents) { + return new TabContentsViewMac(web_contents); } -WebContentsViewMac::WebContentsViewMac(WebContents* web_contents) - : WebContentsView(web_contents) { +TabContentsViewMac::TabContentsViewMac(WebContents* web_contents) + : TabContentsView(web_contents) { registrar_.Add(this, NotificationType::WEB_CONTENTS_CONNECTED, Source<WebContents>(web_contents)); registrar_.Add(this, NotificationType::WEB_CONTENTS_DISCONNECTED, Source<WebContents>(web_contents)); } -WebContentsViewMac::~WebContentsViewMac() { +TabContentsViewMac::~TabContentsViewMac() { } -void WebContentsViewMac::CreateView() { - WebContentsViewCocoa* view = - [[WebContentsViewCocoa alloc] initWithWebContentsViewMac:this]; +void TabContentsViewMac::CreateView() { + TabContentsViewCocoa* view = + [[TabContentsViewCocoa alloc] initWithTabContentsViewMac:this]; cocoa_view_.reset(view); } -RenderWidgetHostView* WebContentsViewMac::CreateViewForWidget( +RenderWidgetHostView* TabContentsViewMac::CreateViewForWidget( RenderWidgetHost* render_widget_host) { DCHECK(!render_widget_host->view()); RenderWidgetHostViewMac* view = @@ -58,25 +58,25 @@ RenderWidgetHostView* WebContentsViewMac::CreateViewForWidget( return view; } -gfx::NativeView WebContentsViewMac::GetNativeView() const { +gfx::NativeView TabContentsViewMac::GetNativeView() const { return cocoa_view_.get(); } -gfx::NativeView WebContentsViewMac::GetContentNativeView() const { +gfx::NativeView TabContentsViewMac::GetContentNativeView() const { if (!web_contents()->render_widget_host_view()) return NULL; return web_contents()->render_widget_host_view()->GetPluginNativeView(); } -gfx::NativeWindow WebContentsViewMac::GetTopLevelNativeWindow() const { +gfx::NativeWindow TabContentsViewMac::GetTopLevelNativeWindow() const { return [cocoa_view_.get() window]; } -void WebContentsViewMac::GetContainerBounds(gfx::Rect* out) const { +void TabContentsViewMac::GetContainerBounds(gfx::Rect* out) const { *out = [cocoa_view_.get() NSRectToRect:[cocoa_view_.get() bounds]]; } -void WebContentsViewMac::StartDragging(const WebDropData& drop_data) { +void TabContentsViewMac::StartDragging(const WebDropData& drop_data) { NOTIMPLEMENTED(); // Until we have d'n'd implemented, just immediately pretend we're @@ -87,26 +87,26 @@ void WebContentsViewMac::StartDragging(const WebDropData& drop_data) { web_contents()->render_view_host()->DragSourceSystemDragEnded(); } -void WebContentsViewMac::OnContentsDestroy() { +void TabContentsViewMac::OnContentsDestroy() { // TODO(avi):Close the find bar if any. if (find_bar_.get()) find_bar_->Close(); } -void WebContentsViewMac::SetPageTitle(const std::wstring& title) { +void TabContentsViewMac::SetPageTitle(const std::wstring& title) { // Meaningless on the Mac; widgets don't have a "title" attribute } -void WebContentsViewMac::Invalidate() { +void TabContentsViewMac::Invalidate() { [cocoa_view_.get() setNeedsDisplay:YES]; } -void WebContentsViewMac::SizeContents(const gfx::Size& size) { +void TabContentsViewMac::SizeContents(const gfx::Size& size) { // TODO(brettw) this is a hack and should be removed. See web_contents_view.h. NOTIMPLEMENTED(); // Leaving the hack unimplemented. } -void WebContentsViewMac::FindInPage(const Browser& browser, +void TabContentsViewMac::FindInPage(const Browser& browser, bool find_next, bool forward_direction) { if (!find_bar_.get()) { // We want the Chrome top-level (Frame) window. @@ -121,7 +121,7 @@ void WebContentsViewMac::FindInPage(const Browser& browser, find_bar_->StartFinding(forward_direction); } -void WebContentsViewMac::HideFindBar(bool end_session) { +void TabContentsViewMac::HideFindBar(bool end_session) { if (find_bar_.get()) { if (end_session) find_bar_->EndFindSession(); @@ -130,7 +130,7 @@ void WebContentsViewMac::HideFindBar(bool end_session) { } } -bool WebContentsViewMac::GetFindBarWindowInfo(gfx::Point* position, +bool TabContentsViewMac::GetFindBarWindowInfo(gfx::Point* position, bool* fully_visible) const { if (!find_bar_.get() || [find_bar_->GetView() isHidden]) { @@ -145,39 +145,39 @@ bool WebContentsViewMac::GetFindBarWindowInfo(gfx::Point* position, return true; } -void WebContentsViewMac::Focus() { +void TabContentsViewMac::Focus() { } -void WebContentsViewMac::SetInitialFocus() { +void TabContentsViewMac::SetInitialFocus() { // TODO(port) } -void WebContentsViewMac::StoreFocus() { +void TabContentsViewMac::StoreFocus() { // TODO(port) } -void WebContentsViewMac::RestoreFocus() { +void TabContentsViewMac::RestoreFocus() { // TODO(port) } -void WebContentsViewMac::SetChildSize(RenderWidgetHostView* rwh_view) { +void TabContentsViewMac::SetChildSize(RenderWidgetHostView* rwh_view) { rwh_view->SetSize(GetContainerSize()); } -void WebContentsViewMac::UpdateDragCursor(bool is_drop_target) { +void TabContentsViewMac::UpdateDragCursor(bool is_drop_target) { NOTIMPLEMENTED(); } -void WebContentsViewMac::TakeFocus(bool reverse) { +void TabContentsViewMac::TakeFocus(bool reverse) { [cocoa_view_.get() becomeFirstResponder]; } -void WebContentsViewMac::HandleKeyboardEvent( +void TabContentsViewMac::HandleKeyboardEvent( const NativeWebKeyboardEvent& event) { [cocoa_view_.get() processKeyboardEvent:event.os_event]; } -void WebContentsViewMac::OnFindReply(int request_id, +void TabContentsViewMac::OnFindReply(int request_id, int number_of_matches, const gfx::Rect& selection_rect, int active_match_ordinal, @@ -188,19 +188,19 @@ void WebContentsViewMac::OnFindReply(int request_id, } } -void WebContentsViewMac::ShowContextMenu(const ContextMenuParams& params) { +void TabContentsViewMac::ShowContextMenu(const ContextMenuParams& params) { RenderViewContextMenuMac menu(web_contents(), params, GetNativeView()); } -RenderWidgetHostView* WebContentsViewMac::CreateNewWidgetInternal( +RenderWidgetHostView* TabContentsViewMac::CreateNewWidgetInternal( int route_id, bool activatable) { // A RenderWidgetHostViewMac has lifetime scoped to the view. We'll retain it // to allow it to survive the trip without being hosted. RenderWidgetHostView* widget_view = - WebContentsView::CreateNewWidgetInternal(route_id, activatable); + TabContentsView::CreateNewWidgetInternal(route_id, activatable); RenderWidgetHostViewMac* widget_view_mac = static_cast<RenderWidgetHostViewMac*>(widget_view); [widget_view_mac->native_view() retain]; @@ -208,10 +208,10 @@ RenderWidgetHostView* WebContentsViewMac::CreateNewWidgetInternal( return widget_view; } -void WebContentsViewMac::ShowCreatedWidgetInternal( +void TabContentsViewMac::ShowCreatedWidgetInternal( RenderWidgetHostView* widget_host_view, const gfx::Rect& initial_pos) { - WebContentsView::ShowCreatedWidgetInternal(widget_host_view, initial_pos); + TabContentsView::ShowCreatedWidgetInternal(widget_host_view, initial_pos); // A RenderWidgetHostViewMac has lifetime scoped to the view. Now that it's // properly embedded (or purposefully ignored) we can release the retain we @@ -221,7 +221,7 @@ void WebContentsViewMac::ShowCreatedWidgetInternal( [widget_view_mac->native_view() release]; } -void WebContentsViewMac::Observe(NotificationType type, +void TabContentsViewMac::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { switch (type.value) { @@ -247,12 +247,12 @@ void WebContentsViewMac::Observe(NotificationType type, } } -@implementation WebContentsViewCocoa +@implementation TabContentsViewCocoa -- (id)initWithWebContentsViewMac:(WebContentsViewMac*)w { +- (id)initWithTabContentsViewMac:(TabContentsViewMac*)w { self = [super initWithFrame:NSZeroRect]; if (self != nil) { - webContentsView_ = w; + TabContentsView_ = w; } return self; } @@ -265,13 +265,13 @@ void WebContentsViewMac::Observe(NotificationType type, } - (void)mouseEvent:(NSEvent *)theEvent { - if (webContentsView_->web_contents()->delegate()) { + if (TabContentsView_->web_contents()->delegate()) { if ([theEvent type] == NSMouseMoved) - webContentsView_->web_contents()->delegate()-> - ContentsMouseEvent(webContentsView_->web_contents(), true); + TabContentsView_->web_contents()->delegate()-> + ContentsMouseEvent(TabContentsView_->web_contents(), true); if ([theEvent type] == NSMouseExited) - webContentsView_->web_contents()->delegate()-> - ContentsMouseEvent(webContentsView_->web_contents(), false); + TabContentsView_->web_contents()->delegate()-> + ContentsMouseEvent(TabContentsView_->web_contents(), false); } } @@ -280,15 +280,15 @@ void WebContentsViewMac::Observe(NotificationType type, // WebCore. - (void)cut:(id)sender { - webContentsView_->web_contents()->Cut(); + TabContentsView_->web_contents()->Cut(); } - (void)copy:(id)sender { - webContentsView_->web_contents()->Copy(); + TabContentsView_->web_contents()->Copy(); } - (void)paste:(id)sender { - webContentsView_->web_contents()->Paste(); + TabContentsView_->web_contents()->Paste(); } // Tons of stuff goes here, where we grab events going on in Cocoaland and send diff --git a/chrome/browser/tab_contents/web_contents_view_win.cc b/chrome/browser/tab_contents/web_contents_view_win.cc index 102addb..c2ab996 100644 --- a/chrome/browser/tab_contents/web_contents_view_win.cc +++ b/chrome/browser/tab_contents/web_contents_view_win.cc @@ -47,18 +47,18 @@ BOOL CALLBACK DetachPluginWindowsCallback(HWND window, LPARAM param) { } // namespace // static -WebContentsView* WebContentsView::Create(WebContents* web_contents) { - return new WebContentsViewWin(web_contents); +TabContentsView* TabContentsView::Create(WebContents* web_contents) { + return new TabContentsViewWin(web_contents); } -WebContentsViewWin::WebContentsViewWin(WebContents* web_contents) - : WebContentsView(web_contents), +TabContentsViewWin::TabContentsViewWin(WebContents* web_contents) + : TabContentsView(web_contents), ignore_next_char_event_(false) { last_focused_view_storage_id_ = views::ViewStorage::GetSharedInstance()->CreateStorageID(); } -WebContentsViewWin::~WebContentsViewWin() { +TabContentsViewWin::~TabContentsViewWin() { // Makes sure to remove any stored view we may still have in the ViewStorage. // // It is possible the view went away before us, so we only do this if the @@ -68,7 +68,7 @@ WebContentsViewWin::~WebContentsViewWin() { view_storage->RemoveView(last_focused_view_storage_id_); } -void WebContentsViewWin::CreateView() { +void TabContentsViewWin::CreateView() { set_delete_on_destroy(false); // Since we create these windows parented to the desktop window initially, we // don't want to create them initially visible. @@ -80,7 +80,7 @@ void WebContentsViewWin::CreateView() { drop_target_ = new WebDropTarget(GetNativeView(), web_contents()); } -RenderWidgetHostView* WebContentsViewWin::CreateViewForWidget( +RenderWidgetHostView* TabContentsViewWin::CreateViewForWidget( RenderWidgetHost* render_widget_host) { if (render_widget_host->view()) { // During testing, the view will already be set up in most cases to the @@ -99,25 +99,25 @@ RenderWidgetHostView* WebContentsViewWin::CreateViewForWidget( return view; } -gfx::NativeView WebContentsViewWin::GetNativeView() const { +gfx::NativeView TabContentsViewWin::GetNativeView() const { return WidgetWin::GetNativeView(); } -gfx::NativeView WebContentsViewWin::GetContentNativeView() const { +gfx::NativeView TabContentsViewWin::GetContentNativeView() const { if (!web_contents()->render_widget_host_view()) return NULL; return web_contents()->render_widget_host_view()->GetPluginNativeView(); } -gfx::NativeWindow WebContentsViewWin::GetTopLevelNativeWindow() const { +gfx::NativeWindow TabContentsViewWin::GetTopLevelNativeWindow() const { return ::GetAncestor(GetNativeView(), GA_ROOT); } -void WebContentsViewWin::GetContainerBounds(gfx::Rect* out) const { +void TabContentsViewWin::GetContainerBounds(gfx::Rect* out) const { GetBounds(out, false); } -void WebContentsViewWin::StartDragging(const WebDropData& drop_data) { +void TabContentsViewWin::StartDragging(const WebDropData& drop_data) { scoped_refptr<OSExchangeData> data(new OSExchangeData); // TODO(tc): Generate an appropriate drag image. @@ -177,7 +177,7 @@ void WebContentsViewWin::StartDragging(const WebDropData& drop_data) { web_contents()->render_view_host()->DragSourceSystemDragEnded(); } -void WebContentsViewWin::OnContentsDestroy() { +void TabContentsViewWin::OnContentsDestroy() { // TODO(brettw) this seems like maybe it can be moved into OnDestroy and this // function can be deleted? If you're adding more here, consider whether it // can be moved into OnDestroy which is a Windows message handler as the @@ -199,14 +199,14 @@ void WebContentsViewWin::OnContentsDestroy() { EnumChildWindows(GetNativeView(), DetachPluginWindowsCallback, NULL); } -void WebContentsViewWin::OnDestroy() { +void TabContentsViewWin::OnDestroy() { if (drop_target_.get()) { RevokeDragDrop(GetNativeView()); drop_target_ = NULL; } } -void WebContentsViewWin::SetPageTitle(const std::wstring& title) { +void TabContentsViewWin::SetPageTitle(const std::wstring& title) { if (GetNativeView()) { // It's possible to get this after the hwnd has been destroyed. ::SetWindowText(GetNativeView(), title.c_str()); @@ -218,18 +218,18 @@ void WebContentsViewWin::SetPageTitle(const std::wstring& title) { } } -void WebContentsViewWin::Invalidate() { +void TabContentsViewWin::Invalidate() { // Note that it's possible to get this message after the window was destroyed. if (::IsWindow(GetNativeView())) InvalidateRect(GetNativeView(), NULL, FALSE); } -void WebContentsViewWin::SizeContents(const gfx::Size& size) { +void TabContentsViewWin::SizeContents(const gfx::Size& size) { // TODO(brettw) this is a hack and should be removed. See web_contents_view.h. WasSized(size); } -void WebContentsViewWin::Focus() { +void TabContentsViewWin::Focus() { HWND container_hwnd = GetNativeView(); if (!container_hwnd) return; @@ -244,14 +244,14 @@ void WebContentsViewWin::Focus() { v->RequestFocus(); } -void WebContentsViewWin::SetInitialFocus() { +void TabContentsViewWin::SetInitialFocus() { if (web_contents()->FocusLocationBarByDefault()) web_contents()->delegate()->SetFocusToLocationBar(); else ::SetFocus(GetNativeView()); } -void WebContentsViewWin::StoreFocus() { +void TabContentsViewWin::StoreFocus() { views::ViewStorage* view_storage = views::ViewStorage::GetSharedInstance(); if (view_storage->RetrieveView(last_focused_view_storage_id_) != NULL) @@ -281,7 +281,7 @@ void WebContentsViewWin::StoreFocus() { } } -void WebContentsViewWin::RestoreFocus() { +void TabContentsViewWin::RestoreFocus() { views::ViewStorage* view_storage = views::ViewStorage::GetSharedInstance(); views::View* last_focused_view = view_storage->RetrieveView(last_focused_view_storage_id_); @@ -310,15 +310,15 @@ void WebContentsViewWin::RestoreFocus() { } } -void WebContentsViewWin::SetChildSize(RenderWidgetHostView* rwh_view) { +void TabContentsViewWin::SetChildSize(RenderWidgetHostView* rwh_view) { rwh_view->SetSize(GetContainerSize()); } -void WebContentsViewWin::UpdateDragCursor(bool is_drop_target) { +void TabContentsViewWin::UpdateDragCursor(bool is_drop_target) { drop_target_->set_is_drop_target(is_drop_target); } -void WebContentsViewWin::TakeFocus(bool reverse) { +void TabContentsViewWin::TakeFocus(bool reverse) { views::FocusManager* focus_manager = views::FocusManager::GetFocusManager(GetNativeView()); @@ -328,7 +328,7 @@ void WebContentsViewWin::TakeFocus(bool reverse) { focus_manager->AdvanceFocus(reverse); } -void WebContentsViewWin::HandleKeyboardEvent( +void TabContentsViewWin::HandleKeyboardEvent( const NativeWebKeyboardEvent& event) { // Previous calls to TranslateMessage can generate CHAR events as well as // RAW_KEY_DOWN events, even if the latter triggered an accelerator. In these @@ -379,7 +379,7 @@ void WebContentsViewWin::HandleKeyboardEvent( event.os_event.lParam); } -void WebContentsViewWin::ShowContextMenu(const ContextMenuParams& params) { +void TabContentsViewWin::ShowContextMenu(const ContextMenuParams& params) { RenderViewContextMenuWin menu(web_contents(), params, GetNativeView()); @@ -395,12 +395,12 @@ void WebContentsViewWin::ShowContextMenu(const ContextMenuParams& params) { MessageLoop::current()->SetNestableTasksAllowed(old_state); } -void WebContentsViewWin::OnHScroll(int scroll_type, short position, +void TabContentsViewWin::OnHScroll(int scroll_type, short position, HWND scrollbar) { ScrollCommon(WM_HSCROLL, scroll_type, position, scrollbar); } -void WebContentsViewWin::OnMouseLeave() { +void TabContentsViewWin::OnMouseLeave() { // Let our delegate know that the mouse moved (useful for resetting status // bubble state). if (web_contents()->delegate()) @@ -408,7 +408,7 @@ void WebContentsViewWin::OnMouseLeave() { SetMsgHandled(FALSE); } -LRESULT WebContentsViewWin::OnMouseRange(UINT msg, +LRESULT TabContentsViewWin::OnMouseRange(UINT msg, WPARAM w_param, LPARAM l_param) { switch (msg) { case WM_LBUTTONDOWN: @@ -437,7 +437,7 @@ LRESULT WebContentsViewWin::OnMouseRange(UINT msg, return 0; } -void WebContentsViewWin::OnPaint(HDC junk_dc) { +void TabContentsViewWin::OnPaint(HDC junk_dc) { if (web_contents()->render_view_host() && !web_contents()->render_view_host()->IsRenderViewLive()) { if (!sad_tab_.get()) @@ -460,7 +460,7 @@ void WebContentsViewWin::OnPaint(HDC junk_dc) { // A message is reflected here from view(). // Return non-zero to indicate that it is handled here. // Return 0 to allow view() to further process it. -LRESULT WebContentsViewWin::OnReflectedMessage(UINT msg, WPARAM w_param, +LRESULT TabContentsViewWin::OnReflectedMessage(UINT msg, WPARAM w_param, LPARAM l_param) { MSG* message = reinterpret_cast<MSG*>(l_param); switch (message->message) { @@ -482,7 +482,7 @@ LRESULT WebContentsViewWin::OnReflectedMessage(UINT msg, WPARAM w_param, return 0; } -void WebContentsViewWin::OnSetFocus(HWND window) { +void TabContentsViewWin::OnSetFocus(HWND window) { // TODO(jcampan): figure out why removing this prevents tabs opened in the // background from properly taking focus. // We NULL-check the render_view_host_ here because Windows can send us @@ -495,12 +495,12 @@ void WebContentsViewWin::OnSetFocus(HWND window) { } } -void WebContentsViewWin::OnVScroll(int scroll_type, short position, +void TabContentsViewWin::OnVScroll(int scroll_type, short position, HWND scrollbar) { ScrollCommon(WM_VSCROLL, scroll_type, position, scrollbar); } -void WebContentsViewWin::OnWindowPosChanged(WINDOWPOS* window_pos) { +void TabContentsViewWin::OnWindowPosChanged(WINDOWPOS* window_pos) { if (window_pos->flags & SWP_HIDEWINDOW) { WasHidden(); } else { @@ -518,7 +518,7 @@ void WebContentsViewWin::OnWindowPosChanged(WINDOWPOS* window_pos) { } } -void WebContentsViewWin::OnSize(UINT param, const CSize& size) { +void TabContentsViewWin::OnSize(UINT param, const CSize& size) { WidgetWin::OnSize(param, size); // Hack for thinkpad touchpad driver. @@ -536,19 +536,19 @@ void WebContentsViewWin::OnSize(UINT param, const CSize& size) { ::SetScrollInfo(GetNativeView(), SB_VERT, &si, FALSE); } -LRESULT WebContentsViewWin::OnNCCalcSize(BOOL w_param, LPARAM l_param) { +LRESULT TabContentsViewWin::OnNCCalcSize(BOOL w_param, LPARAM l_param) { // Hack for thinkpad mouse wheel driver. We have set the fake scroll bars // to receive scroll messages from thinkpad touchpad driver. Suppress // painting of scrollbars by returning 0 size for them. return 0; } -void WebContentsViewWin::OnNCPaint(HRGN rgn) { +void TabContentsViewWin::OnNCPaint(HRGN rgn) { // Suppress default WM_NCPAINT handling. We don't need to do anything // here since the view will draw everything correctly. } -void WebContentsViewWin::ScrollCommon(UINT message, int scroll_type, +void TabContentsViewWin::ScrollCommon(UINT message, int scroll_type, short position, HWND scrollbar) { // This window can receive scroll events as a result of the ThinkPad's // Trackpad scroll wheel emulation. @@ -561,15 +561,15 @@ void WebContentsViewWin::ScrollCommon(UINT message, int scroll_type, } } -void WebContentsViewWin::WasHidden() { +void TabContentsViewWin::WasHidden() { web_contents()->HideContents(); } -void WebContentsViewWin::WasShown() { +void TabContentsViewWin::WasShown() { web_contents()->ShowContents(); } -void WebContentsViewWin::WasSized(const gfx::Size& size) { +void TabContentsViewWin::WasSized(const gfx::Size& size) { if (web_contents()->interstitial_page()) web_contents()->interstitial_page()->SetSize(size); if (web_contents()->render_widget_host_view()) @@ -579,7 +579,7 @@ void WebContentsViewWin::WasSized(const gfx::Size& size) { web_contents()->RepositionSupressedPopupsToFit(size); } -bool WebContentsViewWin::ScrollZoom(int scroll_type) { +bool TabContentsViewWin::ScrollZoom(int scroll_type) { // If ctrl is held, zoom the UI. There are three issues with this: // 1) Should the event be eaten or forwarded to content? We eat the event, // which is like Firefox and unlike IE. @@ -610,7 +610,7 @@ bool WebContentsViewWin::ScrollZoom(int scroll_type) { return false; } -void WebContentsViewWin::WheelZoom(int distance) { +void TabContentsViewWin::WheelZoom(int distance) { if (web_contents()->delegate()) { bool zoom_in = distance > 0; web_contents()->delegate()->ContentsZoomChange(zoom_in); diff --git a/chrome/browser/tab_contents/web_contents_view_win.h b/chrome/browser/tab_contents/web_contents_view_win.h index 960747c..08b8310 100644 --- a/chrome/browser/tab_contents/web_contents_view_win.h +++ b/chrome/browser/tab_contents/web_contents_view_win.h @@ -15,18 +15,18 @@ struct WebDropData; class WebDropTarget; -// Windows-specific implementation of the WebContentsView. It is a HWND that +// Windows-specific implementation of the TabContentsView. It is a HWND that // contains all of the contents of the tab and associated child views. -class WebContentsViewWin : public WebContentsView, +class TabContentsViewWin : public TabContentsView, public views::WidgetWin { public: // The corresponding WebContents 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. - explicit WebContentsViewWin(WebContents* web_contents); - virtual ~WebContentsViewWin(); + explicit TabContentsViewWin(WebContents* web_contents); + virtual ~TabContentsViewWin(); - // WebContentsView implementation -------------------------------------------- + // TabContentsView implementation -------------------------------------------- virtual void CreateView(); virtual RenderWidgetHostView* CreateViewForWidget( @@ -102,7 +102,7 @@ class WebContentsViewWin : public WebContentsView, // The id used in the ViewStorage to store the last focused view. int last_focused_view_storage_id_; - DISALLOW_COPY_AND_ASSIGN(WebContentsViewWin); + DISALLOW_COPY_AND_ASSIGN(TabContentsViewWin); }; #endif // CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_VIEW_WIN_H_ diff --git a/chrome/browser/views/find_bar_view.h b/chrome/browser/views/find_bar_view.h index 3ea4542..970c21b 100644 --- a/chrome/browser/views/find_bar_view.h +++ b/chrome/browser/views/find_bar_view.h @@ -98,7 +98,7 @@ class FindBarView : public views::View, }; // Manages the OS-specific view for the find bar and acts as an intermediary - // between us and the WebContentsView. + // between us and the TabContentsView. FindBarWin* container_; // The controls in the window. diff --git a/chrome/browser/views/find_bar_win.cc b/chrome/browser/views/find_bar_win.cc index 69d2417..af07227 100644 --- a/chrome/browser/views/find_bar_win.cc +++ b/chrome/browser/views/find_bar_win.cc @@ -502,7 +502,7 @@ void FindBarWin::SetFocusChangeListener(HWND parent_hwnd) { void FindBarWin::RestoreSavedFocus() { if (focus_tracker_.get() == NULL) { - // TODO(brettw) Focus() should be on WebContentsView. + // TODO(brettw) Focus() should be on TabContentsView. find_bar_controller_->web_contents()->Focus(); } else { focus_tracker_->FocusLastFocusedExternalView(); diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h index 1da1d57..4d5200b 100644 --- a/chrome/common/temp_scaffolding_stubs.h +++ b/chrome/common/temp_scaffolding_stubs.h @@ -437,11 +437,11 @@ class HtmlDialogContents { #if defined(OS_MACOSX) -class WebContentsView; +class TabContentsView; class FindBarMac { public: - FindBarMac(WebContentsView*, gfx::NativeWindow) { } + FindBarMac(TabContentsView*, gfx::NativeWindow) { } void Show() { } void Close() { } void StartFinding(bool&) { } |