diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-19 14:43:12 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-19 14:43:12 +0000 |
commit | 2fc6672f21decd142da98665de2a0330b2e0ac57 (patch) | |
tree | 52246ce158462b88cd4cc8cad667eb28a039e2b3 /views/window | |
parent | e8491289e4313d396ea9e1522209c1305d60a227 (diff) | |
download | chromium_src-2fc6672f21decd142da98665de2a0330b2e0ac57.zip chromium_src-2fc6672f21decd142da98665de2a0330b2e0ac57.tar.gz chromium_src-2fc6672f21decd142da98665de2a0330b2e0ac57.tar.bz2 |
Rename WidgetWin/Gtk -> NativeWidgetWin/Gtk.
BUG=72040
TEST=none
TBR=sky
Review URL: http://codereview.chromium.org/7039050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85910 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/window')
-rw-r--r-- | views/window/native_frame_view.cc | 6 | ||||
-rw-r--r-- | views/window/window_gtk.cc | 28 | ||||
-rw-r--r-- | views/window/window_gtk.h | 6 | ||||
-rw-r--r-- | views/window/window_win.cc | 44 | ||||
-rw-r--r-- | views/window/window_win.h | 15 |
5 files changed, 50 insertions, 49 deletions
diff --git a/views/window/native_frame_view.cc b/views/window/native_frame_view.cc index c78d6d1..55906ba 100644 --- a/views/window/native_frame_view.cc +++ b/views/window/native_frame_view.cc @@ -4,7 +4,7 @@ #include "views/window/native_frame_view.h" -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #include "views/window/native_window.h" #include "views/window/window.h" @@ -31,8 +31,8 @@ gfx::Rect NativeFrameView::GetBoundsForClientView() const { gfx::Rect NativeFrameView::GetWindowBoundsForClientBounds( const gfx::Rect& client_bounds) const { RECT rect = client_bounds.ToRECT(); - WidgetWin* widget_win = - static_cast<WidgetWin*>(frame_->native_window()->AsNativeWidget()); + NativeWidgetWin* widget_win = + static_cast<NativeWidgetWin*>(frame_->native_window()->AsNativeWidget()); AdjustWindowRectEx(&rect, widget_win->window_style(), FALSE, widget_win->window_ex_style()); return gfx::Rect(rect); diff --git a/views/window/window_gtk.cc b/views/window/window_gtk.cc index 5d72ed8..af2770b 100644 --- a/views/window/window_gtk.cc +++ b/views/window/window_gtk.cc @@ -80,7 +80,7 @@ GdkCursorType HitTestCodeToGdkCursorType(int hittest_code) { namespace views { WindowGtk::WindowGtk(internal::NativeWindowDelegate* delegate) - : WidgetGtk(delegate->AsNativeWidgetDelegate()), + : NativeWidgetGtk(delegate->AsNativeWidgetDelegate()), delegate_(delegate), window_state_(GDK_WINDOW_STATE_WITHDRAWN), window_closed_(false) { @@ -91,7 +91,7 @@ WindowGtk::~WindowGtk() { } //////////////////////////////////////////////////////////////////////////////// -// WindowGtk, WidgetGtk overrides: +// WindowGtk, NativeWidgetGtk overrides: gboolean WindowGtk::OnButtonPress(GtkWidget* widget, GdkEventButton* event) { GdkEventButton transformed_event = *event; @@ -103,9 +103,9 @@ gboolean WindowGtk::OnButtonPress(GtkWidget* widget, GdkEventButton* event) { case HTCAPTION: { // Start dragging if the mouse event is a single click and *not* a right // click. If it is a right click, then pass it through to - // WidgetGtk::OnButtonPress so that View class can show ContextMenu upon a - // mouse release event. We only start drag on single clicks as we get a - // crash in Gtk on double/triple clicks. + // NativeWidgetGtk::OnButtonPress so that View class can show ContextMenu + // upon a mouse release event. We only start drag on single clicks as we + // get a crash in Gtk on double/triple clicks. if (event->type == GDK_BUTTON_PRESS && !mouse_event.IsOnlyRightMouseButton()) { gfx::Point screen_point(event->x, event->y); @@ -140,7 +140,7 @@ gboolean WindowGtk::OnButtonPress(GtkWidget* widget, GdkEventButton* event) { // Everything else falls into standard client event handling... break; } - return WidgetGtk::OnButtonPress(widget, event); + return NativeWidgetGtk::OnButtonPress(widget, event); } gboolean WindowGtk::OnConfigureEvent(GtkWidget* widget, @@ -162,11 +162,11 @@ gboolean WindowGtk::OnMotionNotify(GtkWidget* widget, GdkEventMotion* event) { gdk_window_set_cursor(widget->window, gfx::GetCursor(cursor_type)); } - return WidgetGtk::OnMotionNotify(widget, event); + return NativeWidgetGtk::OnMotionNotify(widget, event); } void WindowGtk::OnSizeAllocate(GtkWidget* widget, GtkAllocation* allocation) { - WidgetGtk::OnSizeAllocate(widget, allocation); + NativeWidgetGtk::OnSizeAllocate(widget, allocation); // The Window's NonClientView may provide a custom shape for the Window. gfx::Path window_mask; @@ -192,16 +192,16 @@ gboolean WindowGtk::OnWindowStateEvent(GtkWidget* widget, gboolean WindowGtk::OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event) { gdk_window_set_cursor(widget->window, gfx::GetCursor(GDK_LEFT_PTR)); - return WidgetGtk::OnLeaveNotify(widget, event); + return NativeWidgetGtk::OnLeaveNotify(widget, event); } void WindowGtk::IsActiveChanged() { - WidgetGtk::IsActiveChanged(); + NativeWidgetGtk::IsActiveChanged(); delegate_->OnNativeWindowActivationChanged(IsActive()); } void WindowGtk::InitNativeWidget(const Widget::InitParams& params) { - WidgetGtk::InitNativeWidget(params); + NativeWidgetGtk::InitNativeWidget(params); g_signal_connect(G_OBJECT(GetNativeWindow()), "configure-event", G_CALLBACK(CallConfigureEvent), this); @@ -297,7 +297,7 @@ const Window* WindowGtk::GetWindow() const { void WindowGtk::SetWindowBounds(const gfx::Rect& bounds, gfx::NativeWindow other_window) { // TODO: need to deal with other_window. - WidgetGtk::SetBounds(bounds); + NativeWidgetGtk::SetBounds(bounds); } void WindowGtk::HideWindow() { @@ -330,7 +330,7 @@ void WindowGtk::Restore() { } bool WindowGtk::IsActive() const { - return WidgetGtk::IsActive(); + return NativeWidgetGtk::IsActive(); } bool WindowGtk::IsVisible() const { @@ -419,7 +419,7 @@ void WindowGtk::SaveWindowPosition() { void WindowGtk::OnDestroy(GtkWidget* widget) { delegate_->OnNativeWindowDestroying(); - WidgetGtk::OnDestroy(widget); + NativeWidgetGtk::OnDestroy(widget); delegate_->OnNativeWindowDestroyed(); } diff --git a/views/window/window_gtk.h b/views/window/window_gtk.h index b235349..15a0c08 100644 --- a/views/window/window_gtk.h +++ b/views/window/window_gtk.h @@ -7,7 +7,7 @@ #pragma once #include "base/basictypes.h" -#include "views/widget/widget_gtk.h" +#include "views/widget/native_widget_gtk.h" #include "views/window/native_window.h" #include "views/window/window.h" @@ -25,7 +25,7 @@ class Client; class WindowDelegate; // Window implementation for GTK. -class WindowGtk : public WidgetGtk, public NativeWindow { +class WindowGtk : public NativeWidgetGtk, public NativeWindow { public: explicit WindowGtk(internal::NativeWindowDelegate* delegate); virtual ~WindowGtk(); @@ -33,7 +33,7 @@ class WindowGtk : public WidgetGtk, public NativeWindow { virtual Window* GetWindow() OVERRIDE; virtual const Window* GetWindow() const OVERRIDE; - // Overridden from WidgetGtk: + // Overridden from NativeWidgetGtk: virtual gboolean OnButtonPress(GtkWidget* widget, GdkEventButton* event); virtual gboolean OnConfigureEvent(GtkWidget* widget, GdkEventConfigure* event); diff --git a/views/window/window_win.cc b/views/window/window_win.cc index f50cefa..bdae725 100644 --- a/views/window/window_win.cc +++ b/views/window/window_win.cc @@ -234,7 +234,7 @@ class WindowWin::ScopedRedrawLock { // WindowWin, public: WindowWin::WindowWin(internal::NativeWindowDelegate* delegate) - : WidgetWin(delegate->AsNativeWidgetDelegate()), + : NativeWidgetWin(delegate->AsNativeWidgetDelegate()), delegate_(delegate), focus_on_creation_(true), restored_enabled_(false), @@ -308,7 +308,7 @@ gfx::Font WindowWin::GetWindowTitleFont() { gfx::Insets WindowWin::GetClientAreaInsets() const { // Returning an empty Insets object causes the default handling in - // WidgetWin::OnNCCalcSize() to be invoked. + // NativeWidgetWin::OnNCCalcSize() to be invoked. if (GetWindow()->ShouldUseNativeFrame()) return gfx::Insets(); @@ -338,7 +338,7 @@ int WindowWin::GetShowState() const { } /////////////////////////////////////////////////////////////////////////////// -// WindowWin, WidgetWin overrides: +// WindowWin, NativeWidgetWin overrides: void WindowWin::InitNativeWidget(const Widget::InitParams& params) { if (window_style() == 0) @@ -349,7 +349,7 @@ void WindowWin::InitNativeWidget(const Widget::InitParams& params) { GetMonitorAndRects(params.bounds.ToRECT(), &last_monitor_, &last_monitor_rect_, &last_work_area_); - WidgetWin::InitNativeWidget(params); + NativeWidgetWin::InitNativeWidget(params); } void WindowWin::OnActivateApp(BOOL active, DWORD thread_id) { @@ -368,7 +368,7 @@ LRESULT WindowWin::OnAppCommand(HWND window, short app_command, WORD device, // We treat APPCOMMAND ids as an extension of our command namespace, and just // let the delegate figure out what to do... return GetWindow()->window_delegate()->ExecuteWindowsCommand(app_command) || - WidgetWin::OnAppCommand(window, app_command, device, keystate); + NativeWidgetWin::OnAppCommand(window, app_command, device, keystate); } void WindowWin::OnClose() { @@ -380,14 +380,14 @@ void WindowWin::OnCommand(UINT notification_code, int command_id, HWND window) { // should ignore it. if (notification_code > 1 || GetWindow()->window_delegate()->ExecuteWindowsCommand(command_id)) { - WidgetWin::OnCommand(notification_code, command_id, window); + NativeWidgetWin::OnCommand(notification_code, command_id, window); } } void WindowWin::OnDestroy() { delegate_->OnNativeWindowDestroying(); RestoreEnabledIfNecessary(); - WidgetWin::OnDestroy(); + NativeWidgetWin::OnDestroy(); } LRESULT WindowWin::OnDwmCompositionChanged(UINT msg, WPARAM w_param, @@ -403,32 +403,32 @@ LRESULT WindowWin::OnDwmCompositionChanged(UINT msg, WPARAM w_param, } void WindowWin::OnEnterSizeMove() { - WidgetWin::OnEnterSizeMove(); + NativeWidgetWin::OnEnterSizeMove(); delegate_->OnNativeWindowBeginUserBoundsChange(); } void WindowWin::OnExitSizeMove() { - WidgetWin::OnExitSizeMove(); + NativeWidgetWin::OnExitSizeMove(); delegate_->OnNativeWindowEndUserBoundsChange(); } void WindowWin::OnFinalMessage(HWND window) { delegate_->OnNativeWindowDestroyed(); - WidgetWin::OnFinalMessage(window); + NativeWidgetWin::OnFinalMessage(window); } void WindowWin::OnGetMinMaxInfo(MINMAXINFO* minmax_info) { gfx::Size min_window_size(delegate_->GetMinimumSize()); minmax_info->ptMinTrackSize.x = min_window_size.width(); minmax_info->ptMinTrackSize.y = min_window_size.height(); - WidgetWin::OnGetMinMaxInfo(minmax_info); + NativeWidgetWin::OnGetMinMaxInfo(minmax_info); } void WindowWin::OnInitMenu(HMENU menu) { // We only need to manually enable the system menu if we're not using a native // frame. if (GetWindow()->ShouldUseNativeFrame()) - WidgetWin::OnInitMenu(menu); + NativeWidgetWin::OnInitMenu(menu); bool is_fullscreen = IsFullscreen(); bool is_minimized = IsMinimized(); @@ -512,18 +512,18 @@ LRESULT WindowWin::OnMouseRange(UINT message, WPARAM w_param, LPARAM l_param) { can't be enabled. if (message == WM_NCLBUTTONDOWN) { // WindowWin::OnNCLButtonDown set the message as unhandled. This normally - // means WidgetWin::ProcessWindowMessage will pass it to + // means NativeWidgetWin::ProcessWindowMessage will pass it to // DefWindowProc. Sadly, DefWindowProc for WM_NCLBUTTONDOWN does weird // non-client painting, so we need to call it directly here inside a // scoped update lock. ScopedRedrawLock lock(this); - WidgetWin::OnMouseRange(message, w_param, l_param); + NativeWidgetWin::OnMouseRange(message, w_param, l_param); DefWindowProc(GetNativeView(), WM_NCLBUTTONDOWN, w_param, l_param); SetMsgHandled(TRUE); } */ - WidgetWin::OnMouseRange(message, w_param, l_param); + NativeWidgetWin::OnMouseRange(message, w_param, l_param); return 0; } @@ -578,7 +578,7 @@ LRESULT WindowWin::OnNCCalcSize(BOOL mode, LPARAM l_param) { // custom width, but in fullscreen mode we want a custom width of 0. gfx::Insets insets = GetClientAreaInsets(); if (insets.empty() && !IsFullscreen()) - return WidgetWin::OnNCCalcSize(mode, l_param); + return NativeWidgetWin::OnNCCalcSize(mode, l_param); RECT* client_rect = mode ? &reinterpret_cast<NCCALCSIZE_PARAMS*>(l_param)->rgrc[0] : @@ -673,7 +673,7 @@ LRESULT WindowWin::OnNCHitTest(const CPoint& point) { // Otherwise, we let Windows do all the native frame non-client handling for // us. - return WidgetWin::OnNCHitTest(point); + return NativeWidgetWin::OnNCHitTest(point); } namespace { @@ -710,7 +710,7 @@ void WindowWin::OnNCPaint(HRGN rgn) { // It's required to avoid some native painting artifacts from appearing when // the window is resized. if (GetWindow()->ShouldUseNativeFrame()) { - WidgetWin::OnNCPaint(rgn); + NativeWidgetWin::OnNCPaint(rgn); return; } @@ -834,7 +834,7 @@ void WindowWin::OnSettingChange(UINT flags, const wchar_t* section) { SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_NOOWNERZORDER); SetMsgHandled(TRUE); } else { - WidgetWin::OnSettingChange(flags, section); + NativeWidgetWin::OnSettingChange(flags, section); } } @@ -962,11 +962,11 @@ void WindowWin::OnWindowPosChanging(WINDOWPOS* window_pos) { } } - WidgetWin::OnWindowPosChanging(window_pos); + NativeWidgetWin::OnWindowPosChanging(window_pos); } void WindowWin::Close() { - WidgetWin::Close(); + NativeWidgetWin::Close(); // If the user activates another app after opening us, then comes back and // closes us, we want our owner to gain activation. But only if the owner @@ -1315,7 +1315,7 @@ gfx::NativeWindow WindowWin::GetNativeWindow() const { } bool WindowWin::ShouldUseNativeFrame() const { - return WidgetWin::IsAeroGlassEnabled(); + return NativeWidgetWin::IsAeroGlassEnabled(); } void WindowWin::FrameTypeChanged() { diff --git a/views/window/window_win.h b/views/window/window_win.h index c829e13..286c3a0 100644 --- a/views/window/window_win.h +++ b/views/window/window_win.h @@ -6,7 +6,7 @@ #define VIEWS_WINDOW_WINDOW_WIN_H_ #pragma once -#include "views/widget/widget_win.h" +#include "views/widget/native_widget_win.h" #include "views/window/native_window.h" #include "views/window/window.h" @@ -32,15 +32,16 @@ void EnsureRectIsVisibleInRect(const gfx::Rect& parent_rect, class Client; class WindowDelegate; -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // // WindowWin // -// A WindowWin is a WidgetWin that has a caption and a border. The frame is -// rendered by the operating system. +// A WindowWin is a NativeWidgetWin that encapsulates a window with a frame. +// The frame may or may not be rendered by the operating system. The window may +// or may not be top level. // -/////////////////////////////////////////////////////////////////////////////// -class WindowWin : public WidgetWin, +//////////////////////////////////////////////////////////////////////////////// +class WindowWin : public NativeWidgetWin, public NativeWindow { public: explicit WindowWin(internal::NativeWindowDelegate* delegate); @@ -85,7 +86,7 @@ class WindowWin : public WidgetWin, // show state from the shortcut starutp info). virtual int GetShowState() const; - // Overridden from WidgetWin: + // Overridden from NativeWidgetWin: virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE; virtual void OnActivateApp(BOOL active, DWORD thread_id) OVERRIDE; virtual LRESULT OnAppCommand(HWND window, |