diff options
Diffstat (limited to 'chrome/browser/ui/views')
33 files changed, 87 insertions, 212 deletions
diff --git a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc index 5ae9cc8..35a03bb 100644 --- a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc +++ b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc @@ -39,7 +39,7 @@ #include <objidl.h> #include "base/win/scoped_gdi_object.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #endif #if defined(TOOLKIT_USES_GTK) @@ -606,7 +606,7 @@ void AutocompletePopupContentsView::MakeContentsPath( void AutocompletePopupContentsView::UpdateBlurRegion() { #if defined(OS_WIN) // We only support background blurring on Vista with Aero-Glass enabled. - if (!views::WidgetWin::IsAeroGlassEnabled() || !GetWidget()) + if (!views::NativeWidgetWin::IsAeroGlassEnabled() || !GetWidget()) return; // Provide a blurred background effect within the contents region of the diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc index 912a5b9..e33ebe1 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc @@ -378,8 +378,8 @@ void BookmarkBubbleView::ShowEditor() { HWND parent = GetAncestor(GetWidget()->GetNativeView(), GA_ROOTOWNER); // We're about to show the bookmark editor. When the bookmark editor closes - // we want the browser to become active. WidgetWin::Hide() does a hide in - // a such way that activation isn't changed, which means when we close + // we want the browser to become active. NativeWidgetWin::Hide() does a hide + // in a such way that activation isn't changed, which means when we close // Windows gets confused as to who it should give active status to. We // explicitly hide the bookmark bubble window in such a way that activation // status changes. That way, when the editor closes, activation is properly @@ -387,7 +387,7 @@ void BookmarkBubbleView::ShowEditor() { ShowWindow(GetWidget()->GetNativeView(), SW_HIDE); #elif defined(TOOLKIT_USES_GTK) gfx::NativeWindow parent = GTK_WINDOW( - static_cast<views::WidgetGtk*>(GetWidget()->native_widget())-> + static_cast<views::NativeWidgetGtk*>(GetWidget()->native_widget())-> GetTransientParent()); #endif diff --git a/chrome/browser/ui/views/browser_bubble_gtk.cc b/chrome/browser/ui/views/browser_bubble_gtk.cc index 4339e05..37d7c9d 100644 --- a/chrome/browser/ui/views/browser_bubble_gtk.cc +++ b/chrome/browser/ui/views/browser_bubble_gtk.cc @@ -9,7 +9,7 @@ #include "chrome/browser/ui/views/bubble/border_contents.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "views/widget/root_view.h" -#include "views/widget/widget_gtk.h" +#include "views/widget/native_widget_gtk.h" #if defined(OS_CHROMEOS) #include "chrome/browser/chromeos/wm_ipc.h" @@ -20,10 +20,10 @@ using std::vector; namespace { -class BubbleWidget : public views::WidgetGtk { +class BubbleWidget : public views::NativeWidgetGtk { public: BubbleWidget(BrowserBubble* bubble, const gfx::Insets& content_margins) - : views::WidgetGtk(new views::Widget), + : views::NativeWidgetGtk(new views::Widget), bubble_(bubble), border_contents_(new BorderContents) { border_contents_->Init(); @@ -32,7 +32,7 @@ class BubbleWidget : public views::WidgetGtk { void ShowAndActivate(bool activate) { // TODO: honor activate. - views::WidgetGtk::Show(); + views::NativeWidgetGtk::Show(); } virtual void Close() { @@ -43,7 +43,7 @@ class BubbleWidget : public views::WidgetGtk { if (delegate) delegate->BubbleLostFocus(bubble_, false); } - views::WidgetGtk::Close(); + views::NativeWidgetGtk::Close(); bubble_ = NULL; } @@ -53,7 +53,7 @@ class BubbleWidget : public views::WidgetGtk { if (delegate) delegate->BubbleLostFocus(bubble_, false); } - views::WidgetGtk::Hide(); + views::NativeWidgetGtk::Hide(); } virtual void IsActiveChanged() { @@ -75,7 +75,7 @@ class BubbleWidget : public views::WidgetGtk { virtual gboolean OnFocusIn(GtkWidget* widget, GdkEventFocus* event) { if (bubble_ && bubble_->delegate()) bubble_->delegate()->BubbleGotFocus(bubble_); - return views::WidgetGtk::OnFocusIn(widget, event); + return views::NativeWidgetGtk::OnFocusIn(widget, event); } BorderContents* border_contents() { diff --git a/chrome/browser/ui/views/browser_bubble_win.cc b/chrome/browser/ui/views/browser_bubble_win.cc index ce4b66c..3696019 100644 --- a/chrome/browser/ui/views/browser_bubble_win.cc +++ b/chrome/browser/ui/views/browser_bubble_win.cc @@ -8,13 +8,13 @@ #include "chrome/browser/ui/views/bubble/border_widget_win.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "views/widget/root_view.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #include "views/window/window.h" -class BubbleWidget : public views::WidgetWin { +class BubbleWidget : public views::NativeWidgetWin { public: explicit BubbleWidget(BrowserBubble* bubble) - : views::WidgetWin(new views::Widget), + : views::NativeWidgetWin(new views::Widget), bubble_(bubble), border_widget_(new BorderWidgetWin) { set_window_style(WS_POPUP | WS_CLIPCHILDREN); @@ -27,7 +27,7 @@ class BubbleWidget : public views::WidgetWin { if (activate) ShowWindow(SW_SHOW); else - views::WidgetWin::Show(); + views::NativeWidgetWin::Show(); } void Close() { @@ -39,7 +39,7 @@ class BubbleWidget : public views::WidgetWin { delegate->BubbleLostFocus(bubble_, NULL); } border_widget_->Close(); - views::WidgetWin::Close(); + views::NativeWidgetWin::Close(); bubble_ = NULL; } @@ -49,12 +49,12 @@ class BubbleWidget : public views::WidgetWin { if (delegate) delegate->BubbleLostFocus(bubble_, NULL); } - views::WidgetWin::Hide(); + views::NativeWidgetWin::Hide(); border_widget_->Hide(); } void OnActivate(UINT action, BOOL minimized, HWND window) { - WidgetWin::OnActivate(action, minimized, window); + NativeWidgetWin::OnActivate(action, minimized, window); if (!bubble_) return; @@ -90,7 +90,7 @@ class BubbleWidget : public views::WidgetWin { } virtual void OnSetFocus(HWND focused_window) { - WidgetWin::OnSetFocus(focused_window); + NativeWidgetWin::OnSetFocus(focused_window); if (bubble_ && bubble_->delegate()) bubble_->delegate()->BubbleGotFocus(bubble_); } @@ -107,8 +107,8 @@ class BubbleWidget : public views::WidgetWin { }; void BrowserBubble::InitPopup(const gfx::Insets& content_margins) { - // popup_ is a Widget, but we need to do some WidgetWin stuff first, then - // we'll assign it into popup_. + // popup_ is a Widget, but we need to do some NativeWidgetWin stuff first, + // then we'll assign it into popup_. BubbleWidget* bubble_widget = new BubbleWidget(this); BorderWidgetWin* border_widget = bubble_widget->border_widget(); diff --git a/chrome/browser/ui/views/bubble/border_widget_win.h b/chrome/browser/ui/views/bubble/border_widget_win.h index a6f9256..cbdddcc 100644 --- a/chrome/browser/ui/views/bubble/border_widget_win.h +++ b/chrome/browser/ui/views/bubble/border_widget_win.h @@ -7,7 +7,7 @@ #pragma once #include "chrome/browser/ui/views/bubble/bubble_border.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" class BorderContents; @@ -16,7 +16,7 @@ class BorderContents; // we can use >1-bit alpha shadow images on the borders, which look nicer than // the Windows CS_DROPSHADOW shadows. The info bubble window itself cannot be a // layered window because that prevents it from hosting native child controls. -class BorderWidgetWin : public views::WidgetWin { +class BorderWidgetWin : public views::NativeWidgetWin { public: BorderWidgetWin(); virtual ~BorderWidgetWin() { } @@ -41,7 +41,7 @@ class BorderWidgetWin : public views::WidgetWin { BorderContents* border_contents_; private: - // Overridden from WidgetWin: + // Overridden from NativeWidgetWin: virtual LRESULT OnMouseActivate(UINT message, WPARAM w_param, LPARAM l_param) OVERRIDE; diff --git a/chrome/browser/ui/views/bubble/bubble.cc b/chrome/browser/ui/views/bubble/bubble.cc index b19cbcb..b8fc390 100644 --- a/chrome/browser/ui/views/bubble/bubble.cc +++ b/chrome/browser/ui/views/bubble/bubble.cc @@ -122,9 +122,9 @@ void Bubble::AnimationProgressed(const ui::Animation* animation) { Bubble::Bubble() : #if defined(OS_WIN) - views::WidgetWin(new views::Widget), + views::NativeWidgetWin(new views::Widget), #elif defined(TOOLKIT_USES_GTK) - views::WidgetGtk(new views::Widget), + views::NativeWidgetGtk(new views::Widget), #endif #if defined(TOOLKIT_USES_GTK) border_contents_(NULL), @@ -147,7 +147,7 @@ Bubble::Bubble() #if defined(OS_CHROMEOS) Bubble::Bubble(views::Widget::InitParams::Type type, bool show_while_screen_is_locked) - : views::WidgetGtk(new views::Widget), + : views::NativeWidgetGtk(new views::Widget), border_contents_(NULL), delegate_(NULL), show_status_(kOpen), @@ -345,9 +345,9 @@ void Bubble::DoClose(bool closed_by_escape) { border_->Close(); #endif #if defined(OS_WIN) - WidgetWin::Close(); + NativeWidgetWin::Close(); #elif defined(TOOLKIT_USES_GTK) - WidgetGtk::Close(); + NativeWidgetGtk::Close(); #endif } diff --git a/chrome/browser/ui/views/bubble/bubble.h b/chrome/browser/ui/views/bubble/bubble.h index 72736e3..0c9e587 100644 --- a/chrome/browser/ui/views/bubble/bubble.h +++ b/chrome/browser/ui/views/bubble/bubble.h @@ -12,9 +12,9 @@ #include "views/view.h" #if defined(OS_WIN) -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #elif defined(TOOLKIT_USES_GTK) -#include "views/widget/widget_gtk.h" +#include "views/widget/native_widget_gtk.h" #endif // Bubble is used to display an arbitrary view above all other windows. @@ -71,9 +71,9 @@ class BubbleDelegate { // That way Bubble has no (or very few) ifdefs. class Bubble #if defined(OS_WIN) - : public views::WidgetWin, + : public views::NativeWidgetWin, #elif defined(TOOLKIT_USES_GTK) - : public views::WidgetGtk, + : public views::NativeWidgetGtk, #endif public views::AcceleratorTarget, public ui::AnimationDelegate { @@ -123,7 +123,7 @@ class Bubble fade_away_on_close_ = fade_away_on_close; } - // Overridden from WidgetWin: + // Overridden from NativeWidgetWin: virtual void Close(); // Overridden from ui::AnimationDelegate: @@ -152,10 +152,10 @@ class Bubble virtual BorderContents* CreateBorderContents(); #if defined(OS_WIN) - // Overridden from WidgetWin: + // Overridden from NativeWidgetWin: virtual void OnActivate(UINT action, BOOL minimized, HWND window); #elif defined(TOOLKIT_USES_GTK) - // Overridden from WidgetGtk: + // Overridden from NativeWidgetGtk: virtual void IsActiveChanged(); #endif diff --git a/chrome/browser/ui/views/collected_cookies_win.cc b/chrome/browser/ui/views/collected_cookies_win.cc index 390c257..9c9b79c 100644 --- a/chrome/browser/ui/views/collected_cookies_win.cc +++ b/chrome/browser/ui/views/collected_cookies_win.cc @@ -28,7 +28,6 @@ #include "views/layout/grid_layout.h" #include "views/layout/layout_constants.h" #include "views/widget/root_view.h" -#include "views/widget/widget_win.h" #include "views/window/window.h" namespace browser { @@ -480,9 +479,9 @@ void CollectedCookiesWin::AddContentException(views::TreeView* tree_view, tab_contents_->profile()->GetHostContentSettingsMap(), setting); infobar_->UpdateVisibility(true, setting, origin_node->GetTitle()); gfx::Rect bounds = GetWidget()->GetClientAreaScreenBounds(); - // WidgetWin::GetBounds returns the bounds relative to the parent window, - // while WidgetWin::SetBounds wants screen coordinates. Do the translation - // here until http://crbug.com/52851 is fixed. + // NativeWidgetWin::GetBounds returns the bounds relative to the parent + // window, while NativeWidgetWin::SetBounds wants screen coordinates. Do the + // translation here until http://crbug.com/52851 is fixed. POINT topleft = {bounds.x(), bounds.y()}; MapWindowPoints(HWND_DESKTOP, tab_contents_->GetNativeView(), &topleft, 1); gfx::Size size = GetRootView()->GetPreferredSize(); diff --git a/chrome/browser/ui/views/constrained_html_delegate_gtk.cc b/chrome/browser/ui/views/constrained_html_delegate_gtk.cc index c39a093..cc0588b 100644 --- a/chrome/browser/ui/views/constrained_html_delegate_gtk.cc +++ b/chrome/browser/ui/views/constrained_html_delegate_gtk.cc @@ -12,11 +12,11 @@ #include "chrome/browser/ui/webui/html_dialog_ui.h" #include "content/browser/tab_contents/tab_contents.h" #include "ui/gfx/rect.h" -#include "views/widget/widget_gtk.h" +#include "views/widget/native_widget_gtk.h" // ConstrainedHtmlDelegateGtk works with ConstrainedWindowGtk to present // a TabContents in a ContraintedHtmlUI. -class ConstrainedHtmlDelegateGtk : public views::WidgetGtk, +class ConstrainedHtmlDelegateGtk : public views::NativeWidgetGtk, public ConstrainedHtmlUIDelegate, public ConstrainedWindowDelegate, public HtmlDialogTabContentsDelegate { @@ -70,7 +70,7 @@ class ConstrainedHtmlDelegateGtk : public views::WidgetGtk, ConstrainedHtmlDelegateGtk::ConstrainedHtmlDelegateGtk( Profile* profile, HtmlDialogUIDelegate* delegate) - : views::WidgetGtk(new views::Widget), + : views::NativeWidgetGtk(new views::Widget), HtmlDialogTabContentsDelegate(profile), html_tab_contents_(profile, NULL, MSG_ROUTING_NONE, NULL, NULL), tab_container_(NULL), diff --git a/chrome/browser/ui/views/constrained_html_delegate_win.cc b/chrome/browser/ui/views/constrained_html_delegate_win.cc index 8d4e34c..0f4ab34 100644 --- a/chrome/browser/ui/views/constrained_html_delegate_win.cc +++ b/chrome/browser/ui/views/constrained_html_delegate_win.cc @@ -11,7 +11,6 @@ #include "content/browser/tab_contents/tab_contents.h" #include "ui/gfx/rect.h" #include "views/view.h" -#include "views/widget/widget_win.h" #include "views/window/window_delegate.h" class ConstrainedHtmlDelegateWin : public TabContentsContainer, diff --git a/chrome/browser/ui/views/constrained_window_views.cc b/chrome/browser/ui/views/constrained_window_views.cc index 63e5c09..01d2be5 100644 --- a/chrome/browser/ui/views/constrained_window_views.cc +++ b/chrome/browser/ui/views/constrained_window_views.cc @@ -36,7 +36,7 @@ #include "views/window/window.h" #if defined(OS_WIN) -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #include "views/window/window_win.h" #endif @@ -207,7 +207,7 @@ class ConstrainedWindowFrameView SkColor GetTitleColor() const { return container_->owner()->profile()->IsOffTheRecord() #if defined(OS_WIN) - || !views::WidgetWin::IsAeroGlassEnabled() + || !views::NativeWidgetWin::IsAeroGlassEnabled() #endif ? SK_ColorWHITE : SK_ColorBLACK; } @@ -546,7 +546,7 @@ gfx::Rect ConstrainedWindowFrameView::CalculateClientAreaBounds( } void ConstrainedWindowFrameView::InitWindowResources() { - resources_.reset(views::WidgetWin::IsAeroGlassEnabled() ? + resources_.reset(views::NativeWidgetWin::IsAeroGlassEnabled() ? static_cast<views::WindowResources*>(new VistaWindowResources) : new XPWindowResources); } diff --git a/chrome/browser/ui/views/dropdown_bar_host_win.cc b/chrome/browser/ui/views/dropdown_bar_host_win.cc index 74190fd..92d3ad1 100644 --- a/chrome/browser/ui/views/dropdown_bar_host_win.cc +++ b/chrome/browser/ui/views/dropdown_bar_host_win.cc @@ -11,7 +11,6 @@ #include "content/browser/tab_contents/tab_contents_view.h" #include "ui/base/keycodes/keyboard_code_conversion_win.h" #include "views/controls/scrollbar/native_scroll_bar.h" -#include "views/widget/widget_win.h" NativeWebKeyboardEvent DropdownBarHost::GetKeyboardEvent( const TabContents* contents, diff --git a/chrome/browser/ui/views/extensions/extension_popup.cc b/chrome/browser/ui/views/extensions/extension_popup.cc index 723b4d6..12f65fe 100644 --- a/chrome/browser/ui/views/extensions/extension_popup.cc +++ b/chrome/browser/ui/views/extensions/extension_popup.cc @@ -23,10 +23,6 @@ #include "views/widget/root_view.h" #include "views/window/window.h" -#if defined(TOOLKIT_USES_GTK) -#include "views/widget/widget_gtk.h" -#endif - #if defined(OS_CHROMEOS) #include "chrome/browser/chromeos/wm_ipc.h" #include "third_party/cros/chromeos_wm_ipc_enums.h" diff --git a/chrome/browser/ui/views/find_bar_host_gtk.cc b/chrome/browser/ui/views/find_bar_host_gtk.cc index 4a7cb04..87d3f44 100644 --- a/chrome/browser/ui/views/find_bar_host_gtk.cc +++ b/chrome/browser/ui/views/find_bar_host_gtk.cc @@ -9,7 +9,6 @@ #include "chrome/browser/ui/views/frame/browser_view.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" -#include "views/widget/widget_gtk.h" void FindBarHost::AudibleAlert() { // TODO(davemoore) implement. diff --git a/chrome/browser/ui/views/find_bar_host_win.cc b/chrome/browser/ui/views/find_bar_host_win.cc index f30702c..c542f37 100644 --- a/chrome/browser/ui/views/find_bar_host_win.cc +++ b/chrome/browser/ui/views/find_bar_host_win.cc @@ -11,7 +11,7 @@ #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" #include "views/controls/scrollbar/native_scroll_bar.h" -#include "views/widget/widget_win.h" +#include "views/widget/widget.h" void FindBarHost::AudibleAlert() { MessageBeep(MB_OK); @@ -19,9 +19,7 @@ void FindBarHost::AudibleAlert() { void FindBarHost::GetWidgetPositionNative(gfx::Rect* avoid_overlapping_rect) { RECT frame_rect = {0}, webcontents_rect = {0}; - ::GetWindowRect( - static_cast<views::WidgetWin*>(host()->native_widget())->GetParent(), - &frame_rect); + ::GetWindowRect(::GetParent(host()->GetNativeView()), &frame_rect); ::GetWindowRect( find_bar_controller_-> tab_contents()->tab_contents()->view()->GetNativeView(), diff --git a/chrome/browser/ui/views/first_run_bubble.cc b/chrome/browser/ui/views/first_run_bubble.cc index 2e0a390..d1965de 100644 --- a/chrome/browser/ui/views/first_run_bubble.cc +++ b/chrome/browser/ui/views/first_run_bubble.cc @@ -24,7 +24,7 @@ #include "views/events/event.h" #include "views/focus/focus_manager.h" #include "views/layout/layout_constants.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #include "views/window/window.h" namespace { @@ -357,7 +357,7 @@ gfx::Size FirstRunOEMBubbleView::GetPreferredSize() { // now, we force Vista to show a correctly-sized box by taking account of // the difference in font size calculation. The coefficient should not be // stored in a variable because it's a hack and should go away. - if (views::WidgetWin::IsAeroGlassEnabled()) { + if (views::NativeWidgetWin::IsAeroGlassEnabled()) { size.set_width(static_cast<int>(size.width() * 0.85)); size.set_height(static_cast<int>(size.height() * 0.85)); } diff --git a/chrome/browser/ui/views/fullscreen_exit_bubble.cc b/chrome/browser/ui/views/fullscreen_exit_bubble.cc index 1c18697..62143d0 100644 --- a/chrome/browser/ui/views/fullscreen_exit_bubble.cc +++ b/chrome/browser/ui/views/fullscreen_exit_bubble.cc @@ -4,6 +4,7 @@ #include "chrome/browser/ui/views/fullscreen_exit_bubble.h" +#include "base/message_loop.h" #include "base/utf_string_conversions.h" #include "chrome/app/chrome_command_ids.h" #include "grit/generated_resources.h" @@ -19,9 +20,6 @@ #if defined(OS_WIN) #include "ui/base/l10n/l10n_util_win.h" -#include "views/widget/widget_win.h" -#elif defined(TOOLKIT_USES_GTK) -#include "views/widget/widget_gtk.h" #endif // FullscreenExitView ---------------------------------------------------------- diff --git a/chrome/browser/ui/views/generic_info_view_unittest.cc b/chrome/browser/ui/views/generic_info_view_unittest.cc index 5fe6dc2..7274970 100644 --- a/chrome/browser/ui/views/generic_info_view_unittest.cc +++ b/chrome/browser/ui/views/generic_info_view_unittest.cc @@ -13,10 +13,6 @@ #include "views/widget/root_view.h" #include "views/window/window.h" -#if defined(OS_WIN) -#include "views/widget/widget_win.h" -#endif - // This class is only used on windows for now. #if defined(OS_WIN) diff --git a/chrome/browser/ui/views/handle_web_keyboard_event_gtk.cc b/chrome/browser/ui/views/handle_web_keyboard_event_gtk.cc index d6ec1fc1..57d4116 100644 --- a/chrome/browser/ui/views/handle_web_keyboard_event_gtk.cc +++ b/chrome/browser/ui/views/handle_web_keyboard_event_gtk.cc @@ -5,13 +5,13 @@ #include "chrome/browser/ui/views/handle_web_keyboard_event_gtk.h" #include "content/common/native_web_keyboard_event.h" -#include "views/widget/widget_gtk.h" +#include "views/widget/native_widget_gtk.h" void HandleWebKeyboardEvent(views::Widget* widget, const NativeWebKeyboardEvent& event) { if (widget && event.os_event && !event.skip_in_browser) { views::KeyEvent views_event(reinterpret_cast<GdkEvent*>(event.os_event)); - static_cast<views::WidgetGtk*>(widget->native_widget())-> + static_cast<views::NativeWidgetGtk*>(widget->native_widget())-> HandleKeyboardEvent(views_event); } } diff --git a/chrome/browser/ui/views/notifications/balloon_view.cc b/chrome/browser/ui/views/notifications/balloon_view.cc index 4cf5569..bbef9e6 100644 --- a/chrome/browser/ui/views/notifications/balloon_view.cc +++ b/chrome/browser/ui/views/notifications/balloon_view.cc @@ -36,12 +36,7 @@ #include "views/controls/native/native_view_host.h" #include "views/painter.h" #include "views/widget/root_view.h" -#if defined(OS_WIN) -#include "views/widget/widget_win.h" -#endif -#if defined(TOOLKIT_USES_GTK) -#include "views/widget/widget_gtk.h" -#endif +#include "views/widget/widget.h" using views::Widget; diff --git a/chrome/browser/ui/views/notifications/balloon_view.h b/chrome/browser/ui/views/notifications/balloon_view.h index 9a7753b..4c58326 100644 --- a/chrome/browser/ui/views/notifications/balloon_view.h +++ b/chrome/browser/ui/views/notifications/balloon_view.h @@ -30,7 +30,6 @@ class ButtonListener; class ImageButton; class ImagePainter; class TextButton; -class WidgetWin; class Menu2; } // namespace views diff --git a/chrome/browser/ui/views/notifications/balloon_view_host.cc b/chrome/browser/ui/views/notifications/balloon_view_host.cc index 53f33b8..fc01900 100644 --- a/chrome/browser/ui/views/notifications/balloon_view_host.cc +++ b/chrome/browser/ui/views/notifications/balloon_view_host.cc @@ -18,12 +18,6 @@ #endif #endif #include "views/widget/widget.h" -#if defined(OS_WIN) -#include "views/widget/widget_win.h" -#endif -#if defined(TOOLKIT_USES_GTK) -#include "views/widget/widget_gtk.h" -#endif class BalloonViewHostView : public views::NativeViewHost { public: diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.cc index 7845b75..144728e 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.cc +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.cc @@ -69,7 +69,7 @@ gfx::NativeView GetHiddenTabHostWindow() { widget->Init(params); } - return static_cast<views::WidgetGtk*>(widget->native_widget())-> + return static_cast<views::NativeWidgetGtk*>(widget->native_widget())-> window_contents(); } @@ -80,7 +80,7 @@ gfx::NativeView GetHiddenTabHostWindow() { NativeTabContentsViewGtk::NativeTabContentsViewGtk( internal::NativeTabContentsViewDelegate* delegate) - : views::WidgetGtk(delegate->AsNativeWidgetDelegate()), + : views::NativeWidgetGtk(delegate->AsNativeWidgetDelegate()), delegate_(delegate), ignore_next_char_event_(false), ALLOW_THIS_IN_INITIALIZER_LIST(drag_source_( @@ -101,7 +101,7 @@ void NativeTabContentsViewGtk::AttachConstrainedWindow( AddChild(constrained_window->widget()); gfx::Size requested_size; - views::WidgetGtk::GetRequestedSize(&requested_size); + views::NativeWidgetGtk::GetRequestedSize(&requested_size); PositionConstrainedWindows(requested_size); } @@ -146,7 +146,7 @@ RenderWidgetHostView* NativeTabContentsViewGtk::CreateRenderWidgetHostView( G_CALLBACK(OnMouseScroll), delegate_); // Let widget know that the tab contents has been painted. - views::WidgetGtk::RegisterChildExposeHandler(view->native_view()); + views::NativeWidgetGtk::RegisterChildExposeHandler(view->native_view()); // Renderer target DnD. if (delegate_->GetTabContents()->ShouldAcceptDragAndDrop()) @@ -197,14 +197,14 @@ views::NativeWidget* NativeTabContentsViewGtk::AsNativeWidget() { } //////////////////////////////////////////////////////////////////////////////// -// NativeTabContentsViewGtk, views::WidgetGtk overrides: +// NativeTabContentsViewGtk, views::NativeWidgetGtk overrides: // Called when the mouse moves within the widget. We notify SadTabView if it's // not NULL, else our delegate. gboolean NativeTabContentsViewGtk::OnMotionNotify(GtkWidget* widget, GdkEventMotion* event) { if (delegate_->IsShowingSadTab()) - return views::WidgetGtk::OnMotionNotify(widget, event); + return views::NativeWidgetGtk::OnMotionNotify(widget, event); delegate_->OnNativeTabContentsViewMouseMove(true); return FALSE; @@ -213,7 +213,7 @@ gboolean NativeTabContentsViewGtk::OnMotionNotify(GtkWidget* widget, gboolean NativeTabContentsViewGtk::OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event) { if (delegate_->IsShowingSadTab()) - return views::WidgetGtk::OnLeaveNotify(widget, event); + return views::NativeWidgetGtk::OnLeaveNotify(widget, event); delegate_->OnNativeTabContentsViewMouseMove(false); return FALSE; @@ -222,9 +222,9 @@ gboolean NativeTabContentsViewGtk::OnLeaveNotify(GtkWidget* widget, gboolean NativeTabContentsViewGtk::OnButtonPress(GtkWidget* widget, GdkEventButton* event) { if (delegate_->IsShowingSadTab()) - return views::WidgetGtk::OnButtonPress(widget, event); + return views::NativeWidgetGtk::OnButtonPress(widget, event); last_mouse_down_ = *event; - return views::WidgetGtk::OnButtonPress(widget, event); + return views::NativeWidgetGtk::OnButtonPress(widget, event); } void NativeTabContentsViewGtk::OnSizeAllocate(GtkWidget* widget, @@ -234,12 +234,12 @@ void NativeTabContentsViewGtk::OnSizeAllocate(GtkWidget* widget, if (size != size_) PositionConstrainedWindows(size); size_ = size; - views::WidgetGtk::OnSizeAllocate(widget, allocation); + views::NativeWidgetGtk::OnSizeAllocate(widget, allocation); } void NativeTabContentsViewGtk::OnShow(GtkWidget* widget) { delegate_->OnNativeTabContentsViewShown(); - views::WidgetGtk::OnShow(widget); + views::NativeWidgetGtk::OnShow(widget); } void NativeTabContentsViewGtk::OnHide(GtkWidget* widget) { @@ -248,7 +248,7 @@ void NativeTabContentsViewGtk::OnHide(GtkWidget* widget) { // delegate after it's already deleted. if (delegate_) delegate_->OnNativeTabContentsViewHidden(); - views::WidgetGtk::OnHide(widget); + views::NativeWidgetGtk::OnHide(widget); } //////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.h b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.h index a2eefe5..384a2ea 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.h +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.h @@ -7,14 +7,14 @@ #pragma once #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view.h" -#include "views/widget/widget_gtk.h" +#include "views/widget/native_widget_gtk.h" class ConstrainedWindowGtk; class TabContents; class TabContentsDragSource; class WebDragDestGtk; -class NativeTabContentsViewGtk : public views::WidgetGtk, +class NativeTabContentsViewGtk : public views::NativeWidgetGtk, public NativeTabContentsView { public: explicit NativeTabContentsViewGtk( @@ -44,7 +44,7 @@ class NativeTabContentsViewGtk : public views::WidgetGtk, virtual void SetDragCursor(WebKit::WebDragOperation operation) OVERRIDE; virtual views::NativeWidget* AsNativeWidget() OVERRIDE; - // Overridden from views::WidgetGtk: + // Overridden from views::NativeWidgetGtk: virtual gboolean OnMotionNotify(GtkWidget* widget, GdkEventMotion* event) OVERRIDE; virtual gboolean OnLeaveNotify(GtkWidget* widget, @@ -73,94 +73,7 @@ class NativeTabContentsViewGtk : public views::WidgetGtk, // GTK. scoped_ptr<WebDragDestGtk> drag_dest_; - // Current size. See comment in WidgetGtk as to why this is cached. - gfx::Size size_; - - // Each individual UI for constrained dialogs currently displayed. The - // objects in this vector are owned by the TabContents, not the view. - std::vector<ConstrainedWindowGtk*> constrained_windows_; - - DISALLOW_COPY_AND_ASSIGN(NativeTabContentsViewGtk); -}; - -#endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_VIEW_GTK_H_ - -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_VIEW_GTK_H_ -#define CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_VIEW_GTK_H_ -#pragma once - -#include "chrome/browser/ui/views/tab_contents/native_tab_contents_view.h" -#include "views/widget/widget_gtk.h" - -class ConstrainedWindowGtk; -class TabContents; -class TabContentsDragSource; -class WebDragDestGtk; - -class NativeTabContentsViewGtk : public views::WidgetGtk, - public NativeTabContentsView { - public: - explicit NativeTabContentsViewGtk( - internal::NativeTabContentsViewDelegate* delegate); - virtual ~NativeTabContentsViewGtk(); - - // Unlike Windows, ConstrainedWindows need to collaborate with the - // TabContentsViewGtk to position the dialogs. - void AttachConstrainedWindow(ConstrainedWindowGtk* constrained_window); - void RemoveConstrainedWindow(ConstrainedWindowGtk* constrained_window); - - - private: - // Overridden from NativeTabContentsView: - virtual void InitNativeTabContentsView() OVERRIDE; - virtual void Unparent() OVERRIDE; - virtual RenderWidgetHostView* CreateRenderWidgetHostView( - RenderWidgetHost* render_widget_host) OVERRIDE; - virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE; - virtual void SetPageTitle(const std::wstring& title) OVERRIDE; - virtual void StartDragging(const WebDropData& drop_data, - WebKit::WebDragOperationsMask ops, - const SkBitmap& image, - const gfx::Point& image_offset) OVERRIDE; - virtual void CancelDrag() OVERRIDE; - virtual bool IsDoingDrag() const OVERRIDE; - virtual void SetDragCursor(WebKit::WebDragOperation operation) OVERRIDE; - virtual views::NativeWidget* AsNativeWidget() OVERRIDE; - - // Overridden from views::WidgetGtk: - virtual gboolean OnMotionNotify(GtkWidget* widget, - GdkEventMotion* event) OVERRIDE; - virtual gboolean OnLeaveNotify(GtkWidget* widget, - GdkEventCrossing* event) OVERRIDE; - virtual gboolean OnButtonPress(GtkWidget* widget, - GdkEventButton* event) OVERRIDE; - virtual void OnSizeAllocate(GtkWidget* widget, - GtkAllocation* allocation) OVERRIDE; - virtual void OnShow(GtkWidget* widget) OVERRIDE; - virtual void OnHide(GtkWidget* widget) OVERRIDE; - - void PositionConstrainedWindows(const gfx::Size& view_size); - - internal::NativeTabContentsViewDelegate* delegate_; - - // Whether to ignore the next CHAR keyboard event. - bool ignore_next_char_event_; - - // Handles drags from this TabContentsView. - scoped_ptr<TabContentsDragSource> drag_source_; - - // The event for the last mouse down we handled. We need this for drags. - GdkEventButton last_mouse_down_; - - // The helper object that handles drag destination related interactions with - // GTK. - scoped_ptr<WebDragDestGtk> drag_dest_; - - // Current size. See comment in WidgetGtk as to why this is cached. + // Current size. See comment in NativeWidgetGtk as to why this is cached. gfx::Size size_; // Each individual UI for constrained dialogs currently displayed. The 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 9474fec..f9c6e62 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 @@ -52,7 +52,7 @@ HWND GetHiddenTabHostWindow() { NativeTabContentsViewWin::NativeTabContentsViewWin( internal::NativeTabContentsViewDelegate* delegate) - : views::WidgetWin(delegate->AsNativeWidgetDelegate()), + : views::NativeWidgetWin(delegate->AsNativeWidgetDelegate()), delegate_(delegate) { } @@ -136,7 +136,7 @@ views::NativeWidget* NativeTabContentsViewWin::AsNativeWidget() { } //////////////////////////////////////////////////////////////////////////////// -// NativeTabContentsViewWin, views::WidgetWin overrides: +// NativeTabContentsViewWin, views::NativeWidgetWin overrides: void NativeTabContentsViewWin::OnDestroy() { if (drop_target_.get()) { @@ -144,7 +144,7 @@ void NativeTabContentsViewWin::OnDestroy() { drop_target_ = NULL; } - WidgetWin::OnDestroy(); + NativeWidgetWin::OnDestroy(); } void NativeTabContentsViewWin::OnHScroll(int scroll_type, @@ -157,7 +157,7 @@ LRESULT NativeTabContentsViewWin::OnMouseRange(UINT msg, WPARAM w_param, LPARAM l_param) { if (delegate_->IsShowingSadTab()) - return WidgetWin::OnMouseRange(msg, w_param, l_param); + return NativeWidgetWin::OnMouseRange(msg, w_param, l_param); switch (msg) { case WM_LBUTTONDOWN: @@ -226,7 +226,7 @@ void NativeTabContentsViewWin::OnWindowPosChanged(WINDOWPOS* window_pos) { gfx::Size(window_pos->cx, window_pos->cy)); } } - WidgetWin::OnWindowPosChanged(window_pos); + NativeWidgetWin::OnWindowPosChanged(window_pos); } void NativeTabContentsViewWin::OnSize(UINT param, const CSize& size) { diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.h b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.h index 6b1f195..611775d 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.h +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.h @@ -7,13 +7,13 @@ #pragma once #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" class WebDropTarget; class TabContents; class TabContentsDragWin; -class NativeTabContentsViewWin : public views::WidgetWin, +class NativeTabContentsViewWin : public views::NativeWidgetWin, public NativeTabContentsView { public: explicit NativeTabContentsViewWin( @@ -43,7 +43,7 @@ class NativeTabContentsViewWin : public views::WidgetWin, virtual void SetDragCursor(WebKit::WebDragOperation operation) OVERRIDE; virtual views::NativeWidget* AsNativeWidget() OVERRIDE; - // Overridden from views::WidgetWin: + // Overridden from views::NativeWidgetWin: virtual void OnDestroy() OVERRIDE; virtual void OnHScroll(int scroll_type, short position, diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_view_touch.h b/chrome/browser/ui/views/tab_contents/tab_contents_view_touch.h index 6e4b986..a28489c 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_view_touch.h +++ b/chrome/browser/ui/views/tab_contents/tab_contents_view_touch.h @@ -118,7 +118,7 @@ class TabContentsViewTouch : public TabContentsView, public views::View { // The event for the last mouse down we handled. We need this for drags. GdkEventButton last_mouse_down_; - // Current size. See comment in WidgetGtk as to why this is cached. + // Current size. See comment in NativeWidgetGtk as to why this is cached. gfx::Size size_; // Each individual UI for constrained dialogs currently displayed. The diff --git a/chrome/browser/ui/views/tabs/base_tab_strip.cc b/chrome/browser/ui/views/tabs/base_tab_strip.cc index ad3df63..c5dc7db 100644 --- a/chrome/browser/ui/views/tabs/base_tab_strip.cc +++ b/chrome/browser/ui/views/tabs/base_tab_strip.cc @@ -13,7 +13,8 @@ #include "views/window/window.h" #if defined(OS_WIN) -#include "views/widget/widget_win.h" +// GET_X_LPARAM, et al. +#include <windowsx.h> #endif namespace { diff --git a/chrome/browser/ui/views/tabs/dragged_tab_controller.cc b/chrome/browser/ui/views/tabs/dragged_tab_controller.cc index 0045a8b..9f9cf5e 100644 --- a/chrome/browser/ui/views/tabs/dragged_tab_controller.cc +++ b/chrome/browser/ui/views/tabs/dragged_tab_controller.cc @@ -39,10 +39,6 @@ #include "views/widget/widget.h" #include "views/window/window.h" -#if defined(OS_WIN) -#include "views/widget/widget_win.h" -#endif - #if defined(TOOLKIT_USES_GTK) #include <gdk/gdk.h> // NOLINT #include <gdk/gdkkeysyms.h> // NOLINT diff --git a/chrome/browser/ui/views/tabs/dragged_tab_view.cc b/chrome/browser/ui/views/tabs/dragged_tab_view.cc index ce763ba..4689239 100644 --- a/chrome/browser/ui/views/tabs/dragged_tab_view.cc +++ b/chrome/browser/ui/views/tabs/dragged_tab_view.cc @@ -11,9 +11,9 @@ #include "views/widget/widget.h" #if defined(OS_WIN) -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #elif defined(TOOLKIT_USES_GTK) -#include "views/widget/widget_gtk.h" +#include "views/widget/native_widget_gtk.h" #endif static const int kTransparentAlpha = 200; @@ -48,7 +48,7 @@ DraggedTabView::DraggedTabView(const std::vector<views::View*>& renderers, container_->Init(params); container_->SetContentsView(this); #if defined(OS_WIN) - static_cast<views::WidgetWin*>(container_->native_widget())-> + static_cast<views::NativeWidgetWin*>(container_->native_widget())-> set_can_update_layered_window(false); BOOL drag; diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc index 6c014cc..db7f5f4 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.cc +++ b/chrome/browser/ui/views/tabs/tab_strip.cc @@ -32,9 +32,6 @@ #if defined(OS_WIN) #include "views/widget/monitor_win.h" -#include "views/widget/widget_win.h" -#elif defined(TOOLKIT_USES_GTK) -#include "views/widget/widget_gtk.h" #endif #undef min diff --git a/chrome/browser/ui/views/tabs/tab_strip.h b/chrome/browser/ui/views/tabs/tab_strip.h index f818415..0ccf2fd 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.h +++ b/chrome/browser/ui/views/tabs/tab_strip.h @@ -19,11 +19,6 @@ class Tab; namespace views { class ImageView; -#if defined(TOOLKIT_USES_GTK) -class WidgetGtk; -#elif defined(OS_WIN) -class WidgetWin; -#endif } /////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc index adc3786b..a249272 100644 --- a/chrome/browser/ui/views/toolbar_view.cc +++ b/chrome/browser/ui/views/toolbar_view.cc @@ -640,8 +640,9 @@ bool ToolbarView::ShouldShowIncompatibilityWarning() { int ToolbarView::PopupTopSpacing() const { // TODO(beng): For some reason GetWindow() returns NULL here in some // unidentified circumstances on ChromeOS. This means GetWidget() - // succeeded but we were (probably) unable to locate a WidgetGtk* - // on it using NativeWidget::GetNativeWidgetForNativeView. + // succeeded but we were (probably) unable to locate a + // NativeWidgetGtk* on it using + // NativeWidget::GetNativeWidgetForNativeView. // I am throwing in a NULL check for now to stop the hurt, but // it's possible the crash may just show up somewhere else. const views::Window* window = GetWindow(); |