diff options
31 files changed, 279 insertions, 271 deletions
diff --git a/chrome/browser/chromeos/frame/browser_frame_chromeos.cc b/chrome/browser/chromeos/frame/browser_frame_chromeos.cc index 690956a..876f67f4 100644 --- a/chrome/browser/chromeos/frame/browser_frame_chromeos.cc +++ b/chrome/browser/chromeos/frame/browser_frame_chromeos.cc @@ -40,10 +40,11 @@ void BrowserFrameChromeos::InitBrowserFrame() { bool BrowserFrameChromeos::IsMaximized() const { if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeosFrame)) - return WindowGtk::IsMaximized(); + return NativeWindowGtk::IsMaximized(); bool is_popup_or_panel = browser_view()->IsBrowserTypePopup() || browser_view()->IsBrowserTypePanel(); - return !IsFullscreen() && (!is_popup_or_panel || WindowGtk::IsMaximized()); + return !IsFullscreen() && + (!is_popup_or_panel || NativeWindowGtk::IsMaximized()); } } // namespace chromeos diff --git a/chrome/browser/chromeos/frame/browser_frame_chromeos.h b/chrome/browser/chromeos/frame/browser_frame_chromeos.h index abfbef4..22f33f2 100644 --- a/chrome/browser/chromeos/frame/browser_frame_chromeos.h +++ b/chrome/browser/chromeos/frame/browser_frame_chromeos.h @@ -18,7 +18,7 @@ class BrowserFrameChromeos : public BrowserFrameGtk { // BrowserFrameGtk overrides. virtual void InitBrowserFrame(); - // views::WindowGtk overrides. + // views::NativeWindowGtk overrides. virtual bool IsMaximized() const; private: diff --git a/chrome/browser/chromeos/frame/bubble_window.cc b/chrome/browser/chromeos/frame/bubble_window.cc index 4b1ff08..a0ddb6e 100644 --- a/chrome/browser/chromeos/frame/bubble_window.cc +++ b/chrome/browser/chromeos/frame/bubble_window.cc @@ -31,12 +31,12 @@ namespace chromeos { const SkColor BubbleWindow::kBackgroundColor = SK_ColorWHITE; BubbleWindow::BubbleWindow(views::Window* window) - : views::WindowGtk::WindowGtk(window) { + : views::NativeWindowGtk(window) { MakeTransparent(); } void BubbleWindow::InitNativeWidget(const views::Widget::InitParams& params) { - views::WindowGtk::InitNativeWidget(params); + views::NativeWindowGtk::InitNativeWidget(params); // Turn on double buffering so that the hosted GtkWidgets does not // flash as in http://crosbug.com/9065. diff --git a/chrome/browser/chromeos/frame/bubble_window.h b/chrome/browser/chromeos/frame/bubble_window.h index 070e745..621e41f 100644 --- a/chrome/browser/chromeos/frame/bubble_window.h +++ b/chrome/browser/chromeos/frame/bubble_window.h @@ -7,7 +7,7 @@ #pragma once #include "third_party/skia/include/core/SkColor.h" -#include "views/window/window_gtk.h" +#include "views/window/native_window_gtk.h" namespace gfx { class Rect; @@ -21,7 +21,7 @@ class WindowDelegate; namespace chromeos { // A window that uses BubbleFrameView as its frame. -class BubbleWindow : public views::WindowGtk { +class BubbleWindow : public views::NativeWindowGtk { public: enum Style { STYLE_GENERIC = 0, // Default style. @@ -40,7 +40,7 @@ class BubbleWindow : public views::WindowGtk { protected: explicit BubbleWindow(views::Window* window); - // Overidden from views::WindowGtk: + // Overidden from views::NativeWindowGtk: virtual void InitNativeWidget( const views::Widget::InitParams& params) OVERRIDE; diff --git a/chrome/browser/chromeos/login/screen_locker_browsertest.cc b/chrome/browser/chromeos/login/screen_locker_browsertest.cc index 01de11e..f143511 100644 --- a/chrome/browser/chromeos/login/screen_locker_browsertest.cc +++ b/chrome/browser/chromeos/login/screen_locker_browsertest.cc @@ -24,7 +24,6 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "views/controls/textfield/textfield.h" -#include "views/window/window_gtk.h" namespace { diff --git a/chrome/browser/ui/views/constrained_window_views.cc b/chrome/browser/ui/views/constrained_window_views.cc index 01d2be5..fa6fd7f 100644 --- a/chrome/browser/ui/views/constrained_window_views.cc +++ b/chrome/browser/ui/views/constrained_window_views.cc @@ -37,7 +37,7 @@ #if defined(OS_WIN) #include "views/widget/native_widget_win.h" -#include "views/window/window_win.h" +#include "views/window/native_window_win.h" #endif using base::TimeDelta; @@ -556,7 +556,7 @@ void ConstrainedWindowFrameView::InitClass() { static bool initialized = false; if (!initialized) { #if defined(OS_WIN) - title_font_ = new gfx::Font(views::WindowWin::GetWindowTitleFont()); + title_font_ = new gfx::Font(views::NativeWindowWin::GetWindowTitleFont()); #endif initialized = true; } diff --git a/chrome/browser/ui/views/frame/browser_frame.cc b/chrome/browser/ui/views/frame/browser_frame.cc index cc30358..5e6ad1d 100644 --- a/chrome/browser/ui/views/frame/browser_frame.cc +++ b/chrome/browser/ui/views/frame/browser_frame.cc @@ -128,10 +128,10 @@ void BrowserFrame::OnNativeWindowActivationChanged(bool active) { if (active) { // When running under remote desktop, if the remote desktop client is not // active on the users desktop, then none of the windows contained in the - // remote desktop will be activated. However, WindowWin::Activate will - // still bring this browser window to the foreground. We explicitly set - // ourselves as the last active browser window to ensure that we get treated - // as such by the rest of Chrome. + // remote desktop will be activated. However, NativeWindowWin::Activate() + // will still bring this browser window to the foreground. We explicitly + // set ourselves as the last active browser window to ensure that we get + // treated as such by the rest of Chrome. BrowserList::SetLastActive(browser_view_->browser()); } Window::OnNativeWindowActivationChanged(active); diff --git a/chrome/browser/ui/views/frame/browser_frame_gtk.cc b/chrome/browser/ui/views/frame/browser_frame_gtk.cc index dd1cee8..0583a01 100644 --- a/chrome/browser/ui/views/frame/browser_frame_gtk.cc +++ b/chrome/browser/ui/views/frame/browser_frame_gtk.cc @@ -25,7 +25,7 @@ const gfx::Font& BrowserFrame::GetTitleFont() { BrowserFrameGtk::BrowserFrameGtk(BrowserFrame* browser_frame, BrowserView* browser_view) - : views::WindowGtk(browser_frame), + : views::NativeWindowGtk(browser_frame), browser_view_(browser_view) { // Don't focus anything on creation, selecting a tab will set the focus. set_focus_on_creation(false); @@ -59,12 +59,12 @@ void BrowserFrameGtk::TabStripDisplayModeChanged() { } //////////////////////////////////////////////////////////////////////////////// -// BrowserFrameGtk, WindowGtk overrides : +// BrowserFrameGtk, NativeWindowGtk overrides: gboolean BrowserFrameGtk::OnWindowStateEvent(GtkWidget* widget, GdkEventWindowState* event) { bool was_full_screen = IsFullscreen(); - gboolean result = views::WindowGtk::OnWindowStateEvent(widget, event); + gboolean result = views::NativeWindowGtk::OnWindowStateEvent(widget, event); if ((!IsVisible() || IsMinimized()) && browser_view_->GetStatusBubble()) { // The window is effectively hidden. We have to hide the status bubble as // unlike windows gtk has no notion of child windows that are hidden along @@ -79,7 +79,7 @@ gboolean BrowserFrameGtk::OnWindowStateEvent(GtkWidget* widget, gboolean BrowserFrameGtk::OnConfigureEvent(GtkWidget* widget, GdkEventConfigure* event) { browser_view_->WindowMoved(); - return views::WindowGtk::OnConfigureEvent(widget, event); + return views::NativeWindowGtk::OnConfigureEvent(widget, event); } diff --git a/chrome/browser/ui/views/frame/browser_frame_gtk.h b/chrome/browser/ui/views/frame/browser_frame_gtk.h index a499496..e1f0514 100644 --- a/chrome/browser/ui/views/frame/browser_frame_gtk.h +++ b/chrome/browser/ui/views/frame/browser_frame_gtk.h @@ -9,12 +9,12 @@ #include "base/basictypes.h" #include "chrome/browser/ui/views/frame/browser_frame.h" #include "chrome/browser/ui/views/frame/native_browser_frame.h" -#include "views/window/window_gtk.h" +#include "views/window/native_window_gtk.h" class BrowserNonClientFrameView; class BrowserRootView; -class BrowserFrameGtk : public views::WindowGtk, +class BrowserFrameGtk : public views::NativeWindowGtk, public NativeBrowserFrame { public: // Normally you will create this class by calling BrowserFrame::Create. @@ -29,7 +29,7 @@ class BrowserFrameGtk : public views::WindowGtk, virtual int GetMinimizeButtonOffset() const OVERRIDE; virtual void TabStripDisplayModeChanged() OVERRIDE; - // Overridden from views::WindowGtk: + // Overridden from views::NativeWindowGtk: virtual gboolean OnWindowStateEvent(GtkWidget* widget, GdkEventWindowState* event); virtual gboolean OnConfigureEvent(GtkWidget* widget, diff --git a/chrome/browser/ui/views/frame/browser_frame_win.cc b/chrome/browser/ui/views/frame/browser_frame_win.cc index 808cd39a3..cfba2d1 100644 --- a/chrome/browser/ui/views/frame/browser_frame_win.cc +++ b/chrome/browser/ui/views/frame/browser_frame_win.cc @@ -33,7 +33,7 @@ static int explicit_show_state = -1; BrowserFrameWin::BrowserFrameWin(BrowserFrame* browser_frame, BrowserView* browser_view) - : views::WindowWin(browser_frame), + : views::NativeWindowWin(browser_frame), browser_view_(browser_view), browser_frame_(browser_frame) { // Don't focus anything on creation, selecting a tab will set the focus. @@ -49,7 +49,7 @@ void BrowserFrameWin::SetShowState(int state) { } /////////////////////////////////////////////////////////////////////////////// -// BrowserFrameWin, views::WindowWin overrides: +// BrowserFrameWin, views::NativeWindowWin overrides: int BrowserFrameWin::GetShowState() const { if (explicit_show_state != -1) @@ -67,7 +67,7 @@ gfx::Insets BrowserFrameWin::GetClientAreaInsets() const { // frame. if (!GetWindow()->ShouldUseNativeFrame() || !browser_view_->IsBrowserTypeNormal()) { - return WindowWin::GetClientAreaInsets(); + return NativeWindowWin::GetClientAreaInsets(); } int border_thickness = GetSystemMetrics(SM_CXSIZEFRAME); @@ -84,7 +84,7 @@ void BrowserFrameWin::UpdateFrameAfterFrameChange() { // We need to update the glass region on or off before the base class adjusts // the window region. UpdateDWMFrame(); - WindowWin::UpdateFrameAfterFrameChange(); + NativeWindowWin::UpdateFrameAfterFrameChange(); } void BrowserFrameWin::OnEndSession(BOOL ending, UINT logoff) { @@ -97,7 +97,7 @@ void BrowserFrameWin::OnInitMenuPopup(HMENU menu, UINT position, } void BrowserFrameWin::OnWindowPosChanged(WINDOWPOS* window_pos) { - WindowWin::OnWindowPosChanged(window_pos); + NativeWindowWin::OnWindowPosChanged(window_pos); UpdateDWMFrame(); // Windows lies to us about the position of the minimize button before a @@ -117,7 +117,7 @@ void BrowserFrameWin::OnWindowPosChanged(WINDOWPOS* window_pos) { void BrowserFrameWin::OnScreenReaderDetected() { BrowserAccessibilityState::GetInstance()->OnScreenReaderDetected(); - WindowWin::OnScreenReaderDetected(); + NativeWindowWin::OnScreenReaderDetected(); } bool BrowserFrameWin::ShouldUseNativeFrame() const { @@ -129,7 +129,7 @@ bool BrowserFrameWin::ShouldUseNativeFrame() const { // theme is active for normal browser windows, we don't want to use the custom // frame for popups/apps. if (!browser_view_->IsBrowserTypeNormal() && - WindowWin::ShouldUseNativeFrame()) { + NativeWindowWin::ShouldUseNativeFrame()) { return true; } @@ -204,7 +204,7 @@ void BrowserFrameWin::UpdateDWMFrame() { // static const gfx::Font& BrowserFrame::GetTitleFont() { static gfx::Font* title_font = - new gfx::Font(views::WindowWin::GetWindowTitleFont()); + new gfx::Font(views::NativeWindowWin::GetWindowTitleFont()); return *title_font; } diff --git a/chrome/browser/ui/views/frame/browser_frame_win.h b/chrome/browser/ui/views/frame/browser_frame_win.h index 499b15c..56391aeb 100644 --- a/chrome/browser/ui/views/frame/browser_frame_win.h +++ b/chrome/browser/ui/views/frame/browser_frame_win.h @@ -9,17 +9,17 @@ #include "base/basictypes.h" #include "chrome/browser/ui/views/frame/browser_frame.h" #include "chrome/browser/ui/views/frame/native_browser_frame.h" -#include "views/window/window_win.h" +#include "views/window/native_window_win.h" class BrowserView; -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // BrowserFrameWin // -// BrowserFrame is a WindowWin subclass that provides the window frame for the -// Chrome browser window. +// BrowserFrame is a NativeWindowWin subclass that provides the window frame +// for the Chrome browser window. // -class BrowserFrameWin : public views::WindowWin, +class BrowserFrameWin : public views::NativeWindowWin, public NativeBrowserFrame { public: BrowserFrameWin(BrowserFrame* browser_frame, BrowserView* browser_view); @@ -33,7 +33,7 @@ class BrowserFrameWin : public views::WindowWin, static void SetShowState(int state); protected: - // Overridden from views::WindowWin: + // Overridden from views::NativeWindowWin: virtual int GetShowState() const OVERRIDE; virtual gfx::Insets GetClientAreaInsets() const OVERRIDE; virtual void UpdateFrameAfterFrameChange() OVERRIDE; diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index 25651b6..cfa881f 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -94,6 +94,7 @@ #include "views/focus/external_focus_tracker.h" #include "views/focus/view_storage.h" #include "views/layout/grid_layout.h" +#include "views/widget/native_widget.h" #include "views/widget/root_view.h" #include "views/window/dialog_delegate.h" #include "views/window/window.h" @@ -103,11 +104,10 @@ #include "chrome/browser/jumplist_win.h" #include "ui/base/message_box_win.h" #include "ui/base/view_prop.h" -#include "views/window/window_win.h" +#include "views/window/native_window_win.h" #elif defined(TOOLKIT_USES_GTK) #include "chrome/browser/ui/views/accelerator_table_gtk.h" #include "views/window/hit_test.h" -#include "views/window/window_gtk.h" #if !defined(TOUCH_UI) #include "chrome/browser/ui/views/handle_web_keyboard_event_gtk.h" #endif @@ -288,7 +288,7 @@ class ResizeCorner : public views::View { } private: - // Returns the WindowWin we're displayed in. Returns NULL if we're not + // Returns the NativeWindowWin we're displayed in. Returns NULL if we're not // currently in a window. views::Window* GetWindow() { views::Widget* widget = GetWidget(); @@ -2254,7 +2254,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen) { #endif } #if defined(OS_WIN) - static_cast<views::WindowWin*>(frame_->native_window())->PushForceHidden(); + static_cast<views::NativeWindowWin*>(frame_->native_window())-> + PushForceHidden(); #endif // Notify bookmark bar, so it can set itself to the appropriate drawing state. @@ -2290,12 +2291,13 @@ void BrowserView::ProcessFullscreen(bool fullscreen) { #endif } - // Undo our anti-jankiness hacks and force the window to relayout now that + // Undo our anti-jankiness hacks and force the window to re-layout now that // it's in its final position. ignore_layout_ = false; Layout(); #if defined(OS_WIN) - static_cast<views::WindowWin*>(frame_->native_window())->PopForceHidden(); + static_cast<views::NativeWindowWin*>(frame_->native_window())-> + PopForceHidden(); #endif } diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc index 7a67dd0..17f789b 100644 --- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc +++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc @@ -1056,9 +1056,10 @@ void OpaqueBrowserFrameView::LayoutWindowControls() { close_button_size.height()); #if defined(OS_CHROMEOS) - // LayoutWindowControls could be triggered from WindowGtk::UpdateWindowTitle, - // which could happen when user navigates in fullscreen mode. And because - // BrowserFrameChromeos::IsMaximized return false for fullscreen mode, we + // LayoutWindowControls could be triggered from + // NativeWindowGtk::UpdateWindowTitle(), which could happen when user + // navigates in fullscreen mode. And because + // BrowserFrameChromeos::IsMaximized() return false for fullscreen mode, we // explicitly test fullscreen mode here and make it use the same code path // as maximized mode. // TODO(oshima): Optimize the relayout logic to defer the frame view's diff --git a/chrome/browser/ui/views/html_dialog_view.cc b/chrome/browser/ui/views/html_dialog_view.cc index 55f4148..d373846 100644 --- a/chrome/browser/ui/views/html_dialog_view.cc +++ b/chrome/browser/ui/views/html_dialog_view.cc @@ -17,7 +17,7 @@ #include "views/window/window.h" #if defined(TOOLKIT_USES_GTK) -#include "views/window/window_gtk.h" +#include "views/window/native_window_gtk.h" #endif namespace browser { @@ -193,8 +193,8 @@ void HtmlDialogView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { DefWindowProc(event.os_event.hwnd, event.os_event.message, event.os_event.wParam, event.os_event.lParam); #elif defined(TOOLKIT_USES_GTK) - views::WindowGtk* window_gtk = - static_cast<views::WindowGtk*>(window()->native_window()); + views::NativeWindowGtk* window_gtk = + static_cast<views::NativeWindowGtk*>(window()->native_window()); if (event.os_event && !event.skip_in_browser) { views::KeyEvent views_event(reinterpret_cast<GdkEvent*>(event.os_event)); window_gtk->HandleKeyboardEvent(views_event); diff --git a/chrome/browser/ui/views/keyboard_overlay_dialog_view.cc b/chrome/browser/ui/views/keyboard_overlay_dialog_view.cc index d2b4075..7da848c 100644 --- a/chrome/browser/ui/views/keyboard_overlay_dialog_view.cc +++ b/chrome/browser/ui/views/keyboard_overlay_dialog_view.cc @@ -20,10 +20,6 @@ #include "views/widget/widget.h" #include "views/window/window.h" -#if defined(TOOLKIT_USES_GTK) -#include "views/window/window_gtk.h" -#endif - namespace { struct Accelerator { ui::KeyboardCode keycode; diff --git a/chrome/browser/ui/views/native_constrained_window_win.cc b/chrome/browser/ui/views/native_constrained_window_win.cc index 134e87b..7ae1e34 100644 --- a/chrome/browser/ui/views/native_constrained_window_win.cc +++ b/chrome/browser/ui/views/native_constrained_window_win.cc @@ -4,7 +4,7 @@ #include "chrome/browser/ui/views/constrained_window_views.h" -#include "views/window/window_win.h" +#include "views/window/native_window_win.h" namespace { bool IsNonClientHitTestCode(UINT hittest) { @@ -13,10 +13,10 @@ bool IsNonClientHitTestCode(UINT hittest) { } class NativeConstrainedWindowWin : public NativeConstrainedWindow, - public views::WindowWin { + public views::NativeWindowWin { public: explicit NativeConstrainedWindowWin(NativeConstrainedWindowDelegate* delegate) - : views::WindowWin(delegate->AsNativeWindowDelegate()), + : views::NativeWindowWin(delegate->AsNativeWindowDelegate()), delegate_(delegate) { } @@ -29,17 +29,17 @@ class NativeConstrainedWindowWin : public NativeConstrainedWindow, return this; } - // Overridden from views::WindowWin: + // Overridden from views::NativeWindowWin: virtual void OnFinalMessage(HWND window) OVERRIDE { delegate_->OnNativeConstrainedWindowDestroyed(); - WindowWin::OnFinalMessage(window); + NativeWindowWin::OnFinalMessage(window); } virtual LRESULT OnMouseActivate(UINT message, WPARAM w_param, LPARAM l_param) OVERRIDE { if (IsNonClientHitTestCode(static_cast<UINT>(LOWORD(l_param)))) delegate_->OnNativeConstrainedWindowMouseActivate(); - return WindowWin::OnMouseActivate(message, w_param, l_param); + return NativeWindowWin::OnMouseActivate(message, w_param, l_param); } NativeConstrainedWindowDelegate* delegate_; diff --git a/views/controls/table/table_view_unittest.cc b/views/controls/table/table_view_unittest.cc index 8e05a07..572ace2 100644 --- a/views/controls/table/table_view_unittest.cc +++ b/views/controls/table/table_view_unittest.cc @@ -20,12 +20,8 @@ #include "ui/base/models/table_model_observer.h" #include "views/controls/table/table_view.h" #include "views/controls/table/table_view2.h" +#include "views/window/window.h" #include "views/window/window_delegate.h" -#if defined(OS_WIN) -#include "views/window/window_win.h" -#else -#include "views/window/window_gtk.h" -#endif using ui::TableModel; using ui::TableModelObserver; // TODO(beng): remove these diff --git a/views/focus/accelerator_handler_gtk_unittest.cc b/views/focus/accelerator_handler_gtk_unittest.cc index bfe53a9..3996e77 100644 --- a/views/focus/accelerator_handler_gtk_unittest.cc +++ b/views/focus/accelerator_handler_gtk_unittest.cc @@ -7,8 +7,9 @@ #include "testing/gtest/include/gtest/gtest.h" #include "ui/gfx/rect.h" #include "views/focus/accelerator_handler.h" +#include "views/focus/focus_manager.h" #include "views/view.h" -#include "views/window/window_gtk.h" +#include "views/window/window.h" #include "views/window/window_delegate.h" namespace views { diff --git a/views/focus/focus_manager_gtk.cc b/views/focus/focus_manager_gtk.cc index 98438c4..399ddc4 100644 --- a/views/focus/focus_manager_gtk.cc +++ b/views/focus/focus_manager_gtk.cc @@ -8,7 +8,6 @@ #include "base/logging.h" #include "views/widget/native_widget_gtk.h" -#include "views/window/window_gtk.h" namespace views { diff --git a/views/focus/focus_manager_unittest.cc b/views/focus/focus_manager_unittest.cc index c215c72..d8122c2 100644 --- a/views/focus/focus_manager_unittest.cc +++ b/views/focus/focus_manager_unittest.cc @@ -1677,7 +1677,7 @@ class FocusManagerDtorTest : public FocusManagerTest { } virtual ~WindowDtorTracked() { - dtor_tracker_->push_back("WindowGtkDtorTracked"); + dtor_tracker_->push_back("WindowDtorTracked"); } FocusManagerDtorTracked* tracked_focus_manager_; @@ -1686,7 +1686,7 @@ class FocusManagerDtorTest : public FocusManagerTest { public: virtual void SetUp() { - // Create WindowGtkDtorTracked that uses FocusManagerDtorTracked. + // Create WindowDtorTracked that uses FocusManagerDtorTracked. window_ = new WindowDtorTracked(this, &dtor_tracker_); ASSERT_TRUE(GetFocusManager() == static_cast<WindowDtorTracked*>( window_)->tracked_focus_manager_); diff --git a/views/views.gyp b/views/views.gyp index f0bb326..baa9e72 100644 --- a/views/views.gyp +++ b/views/views.gyp @@ -380,6 +380,10 @@ 'window/native_frame_view.h', 'window/native_window.h', 'window/native_window_delegate.h', + 'window/native_window_gtk.cc', + 'window/native_window_gtk.h', + 'window/native_window_win.cc', + 'window/native_window_win.h', 'window/non_client_view.cc', 'window/non_client_view.h', 'window/window.cc', @@ -387,12 +391,8 @@ 'window/window_delegate.h', 'window/window_delegate.cc', 'window/window_resources.h', - 'window/window_gtk.cc', - 'window/window_gtk.h', 'window/window_shape.cc', 'window/window_shape.h', - 'window/window_win.cc', - 'window/window_win.h', ], 'include_dirs': [ '<(DEPTH)/third_party/wtl/include', @@ -514,7 +514,7 @@ 'widget/native_widget_test_utils_win.cc', 'widget/native_widget_unittest.cc', 'widget/native_widget_win_unittest.cc', - 'window/window_win_unittest.cc', + 'window/native_window_win_unittest.cc', '<(SHARED_INTERMEDIATE_DIR)/app/app_resources/app_resources.rc', ], diff --git a/views/widget/native_widget_gtk.cc b/views/widget/native_widget_gtk.cc index 1dc4f0f..92ddd11 100644 --- a/views/widget/native_widget_gtk.cc +++ b/views/widget/native_widget_gtk.cc @@ -34,7 +34,7 @@ #include "views/widget/root_view.h" #include "views/widget/tooltip_manager_gtk.h" #include "views/widget/widget_delegate.h" -#include "views/window/window_gtk.h" +#include "views/window/native_window_gtk.h" #if defined(TOUCH_UI) #if defined(HAVE_XINPUT2) @@ -1477,7 +1477,7 @@ Window* NativeWidgetGtk::GetWindowImpl(GtkWidget* widget) { NativeWidgetGtk* widget_gtk = static_cast<NativeWidgetGtk*>( NativeWidget::GetNativeWidgetForNativeView(parent)); if (widget_gtk && widget_gtk->is_window_) - return static_cast<WindowGtk*>(widget_gtk)->GetWindow(); + return static_cast<NativeWindowGtk*>(widget_gtk)->GetWindow(); parent = gtk_widget_get_parent(parent); } return NULL; diff --git a/views/widget/native_widget_gtk.h b/views/widget/native_widget_gtk.h index 7d75e12..fb54b45 100644 --- a/views/widget/native_widget_gtk.h +++ b/views/widget/native_widget_gtk.h @@ -34,7 +34,6 @@ class DropTargetGtk; class InputMethod; class TooltipManagerGtk; class View; -class WindowGtk; namespace internal { class NativeWidgetDelegate; @@ -255,7 +254,7 @@ class NativeWidgetGtk : public NativeWidget, // when a window holding grab is closed without releasing grab. virtual void HandleXGrabBroke(); - // Are we a subclass of WindowGtk? + // Are we a subclass of NativeWindowGtk? bool is_window_; private: diff --git a/views/widget/native_widget_win.cc b/views/widget/native_widget_win.cc index 4a0899d..50f4cca 100644 --- a/views/widget/native_widget_win.cc +++ b/views/widget/native_widget_win.cc @@ -35,7 +35,7 @@ #include "views/widget/native_widget_delegate.h" #include "views/widget/root_view.h" #include "views/widget/widget_delegate.h" -#include "views/window/window_win.h" +#include "views/window/native_window_win.h" #pragma comment(lib, "dwmapi.lib") @@ -1008,7 +1008,7 @@ Window* NativeWidgetWin::GetWindowImpl(HWND hwnd) { NativeWidgetWin* widget = reinterpret_cast<NativeWidgetWin*>(ui::GetWindowUserData(parent)); if (widget && widget->is_window_) - return static_cast<WindowWin*>(widget)->GetWindow(); + return static_cast<NativeWindowWin*>(widget)->GetWindow(); parent = ::GetParent(parent); } return NULL; diff --git a/views/widget/native_widget_win.h b/views/widget/native_widget_win.h index 72152fc..53adfd1 100644 --- a/views/widget/native_widget_win.h +++ b/views/widget/native_widget_win.h @@ -394,7 +394,7 @@ class NativeWidgetWin : public ui::WindowImpl, scoped_refptr<DropTargetWin> drop_target_; - // Are a subclass of WindowWin? + // Are a subclass of NativeWindowWin? bool is_window_; const gfx::Rect& invalid_rect() const { return invalid_rect_; } diff --git a/views/window/custom_frame_view.cc b/views/window/custom_frame_view.cc index 305eae1..c526bf8 100644 --- a/views/window/custom_frame_view.cc +++ b/views/window/custom_frame_view.cc @@ -21,7 +21,7 @@ #endif #if defined(OS_WIN) -#include "views/window/window_win.h" +#include "views/window/native_window_win.h" #endif namespace views { @@ -568,7 +568,7 @@ void CustomFrameView::InitClass() { static bool initialized = false; if (!initialized) { #if defined(OS_WIN) - title_font_ = new gfx::Font(WindowWin::GetWindowTitleFont()); + title_font_ = new gfx::Font(NativeWindowWin::GetWindowTitleFont()); #elif defined(OS_LINUX) // TODO(ben): need to resolve what font this is. title_font_ = new gfx::Font(); diff --git a/views/window/window_gtk.cc b/views/window/native_window_gtk.cc index af2770b..1afa346 100644 --- a/views/window/window_gtk.cc +++ b/views/window/native_window_gtk.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "views/window/window_gtk.h" +#include "views/window/native_window_gtk.h" #include "base/i18n/rtl.h" #include "base/utf_string_conversions.h" @@ -79,7 +79,7 @@ GdkCursorType HitTestCodeToGdkCursorType(int hittest_code) { namespace views { -WindowGtk::WindowGtk(internal::NativeWindowDelegate* delegate) +NativeWindowGtk::NativeWindowGtk(internal::NativeWindowDelegate* delegate) : NativeWidgetGtk(delegate->AsNativeWidgetDelegate()), delegate_(delegate), window_state_(GDK_WINDOW_STATE_WITHDRAWN), @@ -87,13 +87,14 @@ WindowGtk::WindowGtk(internal::NativeWindowDelegate* delegate) is_window_ = true; } -WindowGtk::~WindowGtk() { +NativeWindowGtk::~NativeWindowGtk() { } //////////////////////////////////////////////////////////////////////////////// -// WindowGtk, NativeWidgetGtk overrides: +// NativeWindowGtk, NativeWidgetGtk overrides: -gboolean WindowGtk::OnButtonPress(GtkWidget* widget, GdkEventButton* event) { +gboolean NativeWindowGtk::OnButtonPress(GtkWidget* widget, + GdkEventButton* event) { GdkEventButton transformed_event = *event; MouseEvent mouse_event(TransformEvent(&transformed_event)); @@ -143,13 +144,14 @@ gboolean WindowGtk::OnButtonPress(GtkWidget* widget, GdkEventButton* event) { return NativeWidgetGtk::OnButtonPress(widget, event); } -gboolean WindowGtk::OnConfigureEvent(GtkWidget* widget, - GdkEventConfigure* event) { +gboolean NativeWindowGtk::OnConfigureEvent(GtkWidget* widget, + GdkEventConfigure* event) { SaveWindowPosition(); return FALSE; } -gboolean WindowGtk::OnMotionNotify(GtkWidget* widget, GdkEventMotion* event) { +gboolean NativeWindowGtk::OnMotionNotify(GtkWidget* widget, + GdkEventMotion* event) { GdkEventMotion transformed_event = *event; TransformEvent(&transformed_event); gfx::Point translated_location(transformed_event.x, transformed_event.y); @@ -165,7 +167,8 @@ gboolean WindowGtk::OnMotionNotify(GtkWidget* widget, GdkEventMotion* event) { return NativeWidgetGtk::OnMotionNotify(widget, event); } -void WindowGtk::OnSizeAllocate(GtkWidget* widget, GtkAllocation* allocation) { +void NativeWindowGtk::OnSizeAllocate(GtkWidget* widget, + GtkAllocation* allocation) { NativeWidgetGtk::OnSizeAllocate(widget, allocation); // The Window's NonClientView may provide a custom shape for the Window. @@ -181,26 +184,27 @@ void WindowGtk::OnSizeAllocate(GtkWidget* widget, GtkAllocation* allocation) { SaveWindowPosition(); } -gboolean WindowGtk::OnWindowStateEvent(GtkWidget* widget, - GdkEventWindowState* event) { +gboolean NativeWindowGtk::OnWindowStateEvent(GtkWidget* widget, + GdkEventWindowState* event) { window_state_ = event->new_window_state; if (!(window_state_ & GDK_WINDOW_STATE_WITHDRAWN)) SaveWindowPosition(); return FALSE; } -gboolean WindowGtk::OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event) { +gboolean NativeWindowGtk::OnLeaveNotify(GtkWidget* widget, + GdkEventCrossing* event) { gdk_window_set_cursor(widget->window, gfx::GetCursor(GDK_LEFT_PTR)); return NativeWidgetGtk::OnLeaveNotify(widget, event); } -void WindowGtk::IsActiveChanged() { +void NativeWindowGtk::IsActiveChanged() { NativeWidgetGtk::IsActiveChanged(); delegate_->OnNativeWindowActivationChanged(IsActive()); } -void WindowGtk::InitNativeWidget(const Widget::InitParams& params) { +void NativeWindowGtk::InitNativeWidget(const Widget::InitParams& params) { NativeWidgetGtk::InitNativeWidget(params); g_signal_connect(G_OBJECT(GetNativeWindow()), "configure-event", @@ -210,33 +214,33 @@ void WindowGtk::InitNativeWidget(const Widget::InitParams& params) { } //////////////////////////////////////////////////////////////////////////////// -// WindowGtk, NativeWindow implementation: +// NativeWindowGtk, NativeWindow implementation: -NativeWidget* WindowGtk::AsNativeWidget() { +NativeWidget* NativeWindowGtk::AsNativeWidget() { return this; } -const NativeWidget* WindowGtk::AsNativeWidget() const { +const NativeWidget* NativeWindowGtk::AsNativeWidget() const { return this; } -gfx::Rect WindowGtk::GetRestoredBounds() const { +gfx::Rect NativeWindowGtk::GetRestoredBounds() const { // We currently don't support tiling, so this doesn't matter. return GetWindowScreenBounds(); } -void WindowGtk::ShowNativeWindow(ShowState state) { +void NativeWindowGtk::ShowNativeWindow(ShowState state) { // No concept of maximization (yet) on ChromeOS. if (state == NativeWindow::SHOW_INACTIVE) gtk_window_set_focus_on_map(GetNativeWindow(), false); gtk_widget_show(GetNativeView()); } -void WindowGtk::BecomeModal() { +void NativeWindowGtk::BecomeModal() { gtk_window_set_modal(GetNativeWindow(), true); } -void WindowGtk::CenterWindow(const gfx::Size& size) { +void NativeWindowGtk::CenterWindow(const gfx::Size& size) { gfx::Rect center_rect; GtkWindow* parent = gtk_window_get_transient_for(GetNativeWindow()); @@ -259,68 +263,68 @@ void WindowGtk::CenterWindow(const gfx::Size& size) { SetWindowBounds(bounds, NULL); } -void WindowGtk::GetWindowBoundsAndMaximizedState(gfx::Rect* bounds, - bool* maximized) const { +void NativeWindowGtk::GetWindowBoundsAndMaximizedState(gfx::Rect* bounds, + bool* maximized) const { // Do nothing for now. ChromeOS isn't yet saving window placement. } -void WindowGtk::EnableClose(bool enable) { +void NativeWindowGtk::EnableClose(bool enable) { gtk_window_set_deletable(GetNativeWindow(), enable); } -void WindowGtk::SetWindowTitle(const std::wstring& title) { +void NativeWindowGtk::SetWindowTitle(const std::wstring& title) { // We don't have a window title on ChromeOS (right now). } -void WindowGtk::SetWindowIcons(const SkBitmap& window_icon, - const SkBitmap& app_icon) { +void NativeWindowGtk::SetWindowIcons(const SkBitmap& window_icon, + const SkBitmap& app_icon) { // We don't have window icons on ChromeOS. } -void WindowGtk::SetAccessibleName(const std::wstring& name) { +void NativeWindowGtk::SetAccessibleName(const std::wstring& name) { } -void WindowGtk::SetAccessibleRole(ui::AccessibilityTypes::Role role) { +void NativeWindowGtk::SetAccessibleRole(ui::AccessibilityTypes::Role role) { } -void WindowGtk::SetAccessibleState(ui::AccessibilityTypes::State state) { +void NativeWindowGtk::SetAccessibleState(ui::AccessibilityTypes::State state) { } -Window* WindowGtk::GetWindow() { +Window* NativeWindowGtk::GetWindow() { return delegate_->AsWindow(); } -const Window* WindowGtk::GetWindow() const { +const Window* NativeWindowGtk::GetWindow() const { return delegate_->AsWindow(); } -void WindowGtk::SetWindowBounds(const gfx::Rect& bounds, +void NativeWindowGtk::SetWindowBounds(const gfx::Rect& bounds, gfx::NativeWindow other_window) { // TODO: need to deal with other_window. NativeWidgetGtk::SetBounds(bounds); } -void WindowGtk::HideWindow() { +void NativeWindowGtk::HideWindow() { GetWindow()->Hide(); } -void WindowGtk::Activate() { +void NativeWindowGtk::Activate() { gtk_window_present(GTK_WINDOW(GetNativeView())); } -void WindowGtk::Deactivate() { +void NativeWindowGtk::Deactivate() { gdk_window_lower(GTK_WIDGET(GetNativeView())->window); } -void WindowGtk::Maximize() { +void NativeWindowGtk::Maximize() { gtk_window_maximize(GetNativeWindow()); } -void WindowGtk::Minimize() { +void NativeWindowGtk::Minimize() { gtk_window_iconify(GetNativeWindow()); } -void WindowGtk::Restore() { +void NativeWindowGtk::Restore() { if (IsMaximized()) gtk_window_unmaximize(GetNativeWindow()); else if (IsMinimized()) @@ -329,60 +333,60 @@ void WindowGtk::Restore() { SetFullscreen(false); } -bool WindowGtk::IsActive() const { +bool NativeWindowGtk::IsActive() const { return NativeWidgetGtk::IsActive(); } -bool WindowGtk::IsVisible() const { +bool NativeWindowGtk::IsVisible() const { return GTK_WIDGET_VISIBLE(GetNativeView()); } -bool WindowGtk::IsMaximized() const { +bool NativeWindowGtk::IsMaximized() const { return window_state_ & GDK_WINDOW_STATE_MAXIMIZED; } -bool WindowGtk::IsMinimized() const { +bool NativeWindowGtk::IsMinimized() const { return window_state_ & GDK_WINDOW_STATE_ICONIFIED; } -void WindowGtk::SetFullscreen(bool fullscreen) { +void NativeWindowGtk::SetFullscreen(bool fullscreen) { if (fullscreen) gtk_window_fullscreen(GetNativeWindow()); else gtk_window_unfullscreen(GetNativeWindow()); } -bool WindowGtk::IsFullscreen() const { +bool NativeWindowGtk::IsFullscreen() const { return window_state_ & GDK_WINDOW_STATE_FULLSCREEN; } -void WindowGtk::SetUseDragFrame(bool use_drag_frame) { +void NativeWindowGtk::SetUseDragFrame(bool use_drag_frame) { NOTIMPLEMENTED(); } -NonClientFrameView* WindowGtk::CreateFrameViewForWindow() { +NonClientFrameView* NativeWindowGtk::CreateFrameViewForWindow() { return new CustomFrameView(delegate_->AsWindow()); } -void WindowGtk::SetAlwaysOnTop(bool always_on_top) { +void NativeWindowGtk::SetAlwaysOnTop(bool always_on_top) { gtk_window_set_keep_above(GetNativeWindow(), always_on_top); } -void WindowGtk::UpdateFrameAfterFrameChange() { +void NativeWindowGtk::UpdateFrameAfterFrameChange() { // We currently don't support different frame types on Gtk, so we don't // need to implement this. NOTIMPLEMENTED(); } -gfx::NativeWindow WindowGtk::GetNativeWindow() const { +gfx::NativeWindow NativeWindowGtk::GetNativeWindow() const { return GTK_WINDOW(GetNativeView()); } -bool WindowGtk::ShouldUseNativeFrame() const { +bool NativeWindowGtk::ShouldUseNativeFrame() const { return false; } -void WindowGtk::FrameTypeChanged() { +void NativeWindowGtk::FrameTypeChanged() { // This is called when the Theme has changed, so forward the event to the root // widget. GetWidget()->ThemeChanged(); @@ -390,23 +394,23 @@ void WindowGtk::FrameTypeChanged() { } //////////////////////////////////////////////////////////////////////////////// -// WindowGtk, private: +// NativeWindowGtk, private: // static -gboolean WindowGtk::CallConfigureEvent(GtkWidget* widget, - GdkEventConfigure* event, - WindowGtk* window_gtk) { +gboolean NativeWindowGtk::CallConfigureEvent(GtkWidget* widget, + GdkEventConfigure* event, + NativeWindowGtk* window_gtk) { return window_gtk->OnConfigureEvent(widget, event); } // static -gboolean WindowGtk::CallWindowStateEvent(GtkWidget* widget, - GdkEventWindowState* event, - WindowGtk* window_gtk) { +gboolean NativeWindowGtk::CallWindowStateEvent(GtkWidget* widget, + GdkEventWindowState* event, + NativeWindowGtk* window_gtk) { return window_gtk->OnWindowStateEvent(widget, event); } -void WindowGtk::SaveWindowPosition() { +void NativeWindowGtk::SaveWindowPosition() { // The delegate may have gone away on us. if (!GetWindow()->window_delegate()) return; @@ -417,7 +421,7 @@ void WindowGtk::SaveWindowPosition() { maximized); } -void WindowGtk::OnDestroy(GtkWidget* widget) { +void NativeWindowGtk::OnDestroy(GtkWidget* widget) { delegate_->OnNativeWindowDestroying(); NativeWidgetGtk::OnDestroy(widget); delegate_->OnNativeWindowDestroyed(); @@ -429,7 +433,7 @@ void WindowGtk::OnDestroy(GtkWidget* widget) { // static NativeWindow* NativeWindow::CreateNativeWindow( internal::NativeWindowDelegate* delegate) { - return new WindowGtk(delegate); + return new NativeWindowGtk(delegate); } } // namespace views diff --git a/views/window/window_gtk.h b/views/window/native_window_gtk.h index 15a0c08..f45380e 100644 --- a/views/window/window_gtk.h +++ b/views/window/native_window_gtk.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef VIEWS_WINDOW_WINDOW_GTK_H_ -#define VIEWS_WINDOW_WINDOW_GTK_H_ +#ifndef VIEWS_WINDOW_NATIVE_WINDOW_GTK_H_ +#define VIEWS_WINDOW_NATIVE_WINDOW_GTK_H_ #pragma once #include "base/basictypes.h" @@ -24,11 +24,11 @@ class NativeWindowDelegate; class Client; class WindowDelegate; -// Window implementation for GTK. -class WindowGtk : public NativeWidgetGtk, public NativeWindow { +// Window implementation for Gtk. +class NativeWindowGtk : public NativeWidgetGtk, public NativeWindow { public: - explicit WindowGtk(internal::NativeWindowDelegate* delegate); - virtual ~WindowGtk(); + explicit NativeWindowGtk(internal::NativeWindowDelegate* delegate); + virtual ~NativeWindowGtk(); virtual Window* GetWindow() OVERRIDE; virtual const Window* GetWindow() const OVERRIDE; @@ -93,10 +93,10 @@ class WindowGtk : public NativeWidgetGtk, public NativeWindow { private: static gboolean CallConfigureEvent(GtkWidget* widget, GdkEventConfigure* event, - WindowGtk* window_gtk); + NativeWindowGtk* window_gtk); static gboolean CallWindowStateEvent(GtkWidget* widget, GdkEventWindowState* event, - WindowGtk* window_gtk); + NativeWindowGtk* window_gtk); // Asks the delegate if any to save the window's location and size. void SaveWindowPosition(); @@ -119,9 +119,9 @@ class WindowGtk : public NativeWidgetGtk, public NativeWindow { // Set to true if the window is in the process of closing. bool window_closed_; - DISALLOW_COPY_AND_ASSIGN(WindowGtk); + DISALLOW_COPY_AND_ASSIGN(NativeWindowGtk); }; } // namespace views -#endif // VIEWS_WINDOW_WINDOW_GTK_H_ +#endif // VIEWS_WINDOW_NATIVE_WINDOW_GTK_H_ diff --git a/views/window/window_win.cc b/views/window/native_window_win.cc index bdae725..487aa0d 100644 --- a/views/window/window_win.cc +++ b/views/window/native_window_win.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "views/window/window_win.h" +#include "views/window/native_window_win.h" #include <dwmapi.h> #include <shellapi.h> @@ -215,9 +215,9 @@ void EnsureRectIsVisibleInRect(const gfx::Rect& parent_rect, // // I would love to hear Raymond Chen's explanation for all this. And maybe a // list of other messages that this applies to ;-) -class WindowWin::ScopedRedrawLock { +class NativeWindowWin::ScopedRedrawLock { public: - explicit ScopedRedrawLock(WindowWin* window) : window_(window) { + explicit ScopedRedrawLock(NativeWindowWin* window) : window_(window) { window_->LockUpdates(); } @@ -227,13 +227,13 @@ class WindowWin::ScopedRedrawLock { private: // The window having its style changed. - WindowWin* window_; + NativeWindowWin* window_; }; //////////////////////////////////////////////////////////////////////////////// -// WindowWin, public: +// NativeWindowWin, public: -WindowWin::WindowWin(internal::NativeWindowDelegate* delegate) +NativeWindowWin::NativeWindowWin(internal::NativeWindowDelegate* delegate) : NativeWidgetWin(delegate->AsNativeWidgetDelegate()), delegate_(delegate), focus_on_creation_(true), @@ -256,10 +256,10 @@ WindowWin::WindowWin(internal::NativeWindowDelegate* delegate) -WindowWin::~WindowWin() { +NativeWindowWin::~NativeWindowWin() { } -void WindowWin::Show(int show_state) { +void NativeWindowWin::Show(int show_state) { ShowWindow(show_state); // When launched from certain programs like bash and Windows Live Messenger, // show_state is set to SW_HIDE, so we need to correct that condition. We @@ -282,12 +282,12 @@ void WindowWin::Show(int show_state) { SetInitialFocus(); } -void WindowWin::PushForceHidden() { +void NativeWindowWin::PushForceHidden() { if (force_hidden_count_++ == 0) Hide(); } -void WindowWin::PopForceHidden() { +void NativeWindowWin::PopForceHidden() { if (--force_hidden_count_ <= 0) { force_hidden_count_ = 0; ShowWindow(SW_SHOW); @@ -295,7 +295,7 @@ void WindowWin::PopForceHidden() { } // static -gfx::Font WindowWin::GetWindowTitleFont() { +gfx::Font NativeWindowWin::GetWindowTitleFont() { NONCLIENTMETRICS ncm; base::win::GetNonClientMetrics(&ncm); l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); @@ -304,9 +304,9 @@ gfx::Font WindowWin::GetWindowTitleFont() { } /////////////////////////////////////////////////////////////////////////////// -// WindowWin, protected: +// NativeWindowWin, protected: -gfx::Insets WindowWin::GetClientAreaInsets() const { +gfx::Insets NativeWindowWin::GetClientAreaInsets() const { // Returning an empty Insets object causes the default handling in // NativeWidgetWin::OnNCCalcSize() to be invoked. if (GetWindow()->ShouldUseNativeFrame()) @@ -333,14 +333,14 @@ gfx::Insets WindowWin::GetClientAreaInsets() const { return gfx::Insets(0, 0, IsFullscreen() ? 0 : 1, 0); } -int WindowWin::GetShowState() const { +int NativeWindowWin::GetShowState() const { return SW_SHOWNORMAL; } /////////////////////////////////////////////////////////////////////////////// -// WindowWin, NativeWidgetWin overrides: +// NativeWindowWin, NativeWidgetWin overrides: -void WindowWin::InitNativeWidget(const Widget::InitParams& params) { +void NativeWindowWin::InitNativeWidget(const Widget::InitParams& params) { if (window_style() == 0) set_window_style(CalculateWindowStyle()); if (window_ex_style() == 0) @@ -352,7 +352,7 @@ void WindowWin::InitNativeWidget(const Widget::InitParams& params) { NativeWidgetWin::InitNativeWidget(params); } -void WindowWin::OnActivateApp(BOOL active, DWORD thread_id) { +void NativeWindowWin::OnActivateApp(BOOL active, DWORD thread_id) { if (!active && thread_id != GetCurrentThreadId()) { // Another application was activated, we should reset any state that // disables inactive rendering now. @@ -363,19 +363,23 @@ void WindowWin::OnActivateApp(BOOL active, DWORD thread_id) { } } -LRESULT WindowWin::OnAppCommand(HWND window, short app_command, WORD device, - int keystate) { +LRESULT NativeWindowWin::OnAppCommand(HWND window, + short app_command, + WORD device, + int keystate) { // 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) || NativeWidgetWin::OnAppCommand(window, app_command, device, keystate); } -void WindowWin::OnClose() { +void NativeWindowWin::OnClose() { GetWindow()->Close(); } -void WindowWin::OnCommand(UINT notification_code, int command_id, HWND window) { +void NativeWindowWin::OnCommand(UINT notification_code, + int command_id, + HWND window) { // If the notification code is > 1 it means it is control specific and we // should ignore it. if (notification_code > 1 || @@ -384,14 +388,15 @@ void WindowWin::OnCommand(UINT notification_code, int command_id, HWND window) { } } -void WindowWin::OnDestroy() { +void NativeWindowWin::OnDestroy() { delegate_->OnNativeWindowDestroying(); RestoreEnabledIfNecessary(); NativeWidgetWin::OnDestroy(); } -LRESULT WindowWin::OnDwmCompositionChanged(UINT msg, WPARAM w_param, - LPARAM l_param) { +LRESULT NativeWindowWin::OnDwmCompositionChanged(UINT msg, + WPARAM w_param, + LPARAM l_param) { // For some reason, we need to hide the window while we're changing the frame // type only when we're changing it in response to WM_DWMCOMPOSITIONCHANGED. // If we don't, the client area will be filled with black. I'm suspecting @@ -402,29 +407,29 @@ LRESULT WindowWin::OnDwmCompositionChanged(UINT msg, WPARAM w_param, return 0; } -void WindowWin::OnEnterSizeMove() { +void NativeWindowWin::OnEnterSizeMove() { NativeWidgetWin::OnEnterSizeMove(); delegate_->OnNativeWindowBeginUserBoundsChange(); } -void WindowWin::OnExitSizeMove() { +void NativeWindowWin::OnExitSizeMove() { NativeWidgetWin::OnExitSizeMove(); delegate_->OnNativeWindowEndUserBoundsChange(); } -void WindowWin::OnFinalMessage(HWND window) { +void NativeWindowWin::OnFinalMessage(HWND window) { delegate_->OnNativeWindowDestroyed(); NativeWidgetWin::OnFinalMessage(window); } -void WindowWin::OnGetMinMaxInfo(MINMAXINFO* minmax_info) { +void NativeWindowWin::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(); NativeWidgetWin::OnGetMinMaxInfo(minmax_info); } -void WindowWin::OnInitMenu(HMENU menu) { +void NativeWindowWin::OnInitMenu(HMENU menu) { // We only need to manually enable the system menu if we're not using a native // frame. if (GetWindow()->ShouldUseNativeFrame()) @@ -448,12 +453,15 @@ void WindowWin::OnInitMenu(HMENU menu) { !is_minimized); } -LRESULT WindowWin::OnMouseActivate(UINT message, WPARAM w_param, - LPARAM l_param) { +LRESULT NativeWindowWin::OnMouseActivate(UINT message, + WPARAM w_param, + LPARAM l_param) { return delegate_->CanActivate() ? MA_ACTIVATE : MA_NOACTIVATEANDEAT; } -LRESULT WindowWin::OnMouseRange(UINT message, WPARAM w_param, LPARAM l_param) { +LRESULT NativeWindowWin::OnMouseRange(UINT message, + WPARAM w_param, + LPARAM l_param) { if (message == WM_RBUTTONUP && is_right_mouse_pressed_on_caption_) { is_right_mouse_pressed_on_caption_ = false; ReleaseCapture(); @@ -511,8 +519,8 @@ LRESULT WindowWin::OnMouseRange(UINT message, WPARAM w_param, LPARAM l_param) { causes mouse-releases to the non-client area to be eaten, so it can't be enabled. if (message == WM_NCLBUTTONDOWN) { - // WindowWin::OnNCLButtonDown set the message as unhandled. This normally - // means NativeWidgetWin::ProcessWindowMessage will pass it to + // NativeWindowWin::OnNCLButtonDown set the message as un-handled. This + // normally 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. @@ -539,7 +547,7 @@ BOOL CALLBACK EnumChildWindowsForRedraw(HWND hwnd, LPARAM lparam) { } } // namespace -LRESULT WindowWin::OnNCActivate(BOOL active) { +LRESULT NativeWindowWin::OnNCActivate(BOOL active) { if (!delegate_->CanActivate()) return TRUE; @@ -572,7 +580,7 @@ LRESULT WindowWin::OnNCActivate(BOOL active) { return CallDefaultNCActivateHandler(inactive_rendering_disabled || active); } -LRESULT WindowWin::OnNCCalcSize(BOOL mode, LPARAM l_param) { +LRESULT NativeWindowWin::OnNCCalcSize(BOOL mode, LPARAM l_param) { // We only override the default handling if we need to specify a custom // non-client edge width. Note that in most cases "no insets" means no // custom width, but in fullscreen mode we want a custom width of 0. @@ -652,7 +660,7 @@ LRESULT WindowWin::OnNCCalcSize(BOOL mode, LPARAM l_param) { return mode ? WVR_REDRAW : 0; } -LRESULT WindowWin::OnNCHitTest(const CPoint& point) { +LRESULT NativeWindowWin::OnNCHitTest(const CPoint& point) { // If the DWM is rendering the window controls, we need to give the DWM's // default window procedure first chance to handle hit testing. if (GetWindow()->ShouldUseNativeFrame()) { @@ -705,7 +713,7 @@ static BOOL CALLBACK ClipDCToChild(HWND window, LPARAM param) { } } // namespace -void WindowWin::OnNCPaint(HRGN rgn) { +void NativeWindowWin::OnNCPaint(HRGN rgn) { // We only do non-client painting if we're not using the native frame. // It's required to avoid some native painting artifacts from appearing when // the window is resized. @@ -788,45 +796,47 @@ void WindowWin::OnNCPaint(HRGN rgn) { SetMsgHandled(!GetWindow()->ShouldUseNativeFrame()); } -LRESULT WindowWin::OnNCUAHDrawCaption(UINT msg, WPARAM w_param, - LPARAM l_param) { +LRESULT NativeWindowWin::OnNCUAHDrawCaption(UINT msg, + WPARAM w_param, + LPARAM l_param) { // See comment in widget_win.h at the definition of WM_NCUAHDRAWCAPTION for // an explanation about why we need to handle this message. SetMsgHandled(!GetWindow()->ShouldUseNativeFrame()); return 0; } -LRESULT WindowWin::OnNCUAHDrawFrame(UINT msg, WPARAM w_param, - LPARAM l_param) { +LRESULT NativeWindowWin::OnNCUAHDrawFrame(UINT msg, + WPARAM w_param, + LPARAM l_param) { // See comment in widget_win.h at the definition of WM_NCUAHDRAWCAPTION for // an explanation about why we need to handle this message. SetMsgHandled(!GetWindow()->ShouldUseNativeFrame()); return 0; } -LRESULT WindowWin::OnSetCursor(UINT msg, - WPARAM w_param, - LPARAM l_param) { +LRESULT NativeWindowWin::OnSetCursor(UINT msg, + WPARAM w_param, + LPARAM l_param) { // This shouldn't hurt even if we're using the native frame. ScopedRedrawLock lock(this); return DefWindowProc(GetNativeView(), msg, w_param, l_param); } -LRESULT WindowWin::OnSetIcon(UINT size_type, HICON new_icon) { +LRESULT NativeWindowWin::OnSetIcon(UINT size_type, HICON new_icon) { // This shouldn't hurt even if we're using the native frame. ScopedRedrawLock lock(this); return DefWindowProc(GetNativeView(), WM_SETICON, size_type, reinterpret_cast<LPARAM>(new_icon)); } -LRESULT WindowWin::OnSetText(const wchar_t* text) { +LRESULT NativeWindowWin::OnSetText(const wchar_t* text) { // This shouldn't hurt even if we're using the native frame. ScopedRedrawLock lock(this); return DefWindowProc(GetNativeView(), WM_SETTEXT, NULL, reinterpret_cast<LPARAM>(text)); } -void WindowWin::OnSettingChange(UINT flags, const wchar_t* section) { +void NativeWindowWin::OnSettingChange(UINT flags, const wchar_t* section) { if (!GetParent() && (flags == SPI_SETWORKAREA)) { // Fire a dummy SetWindowPos() call, so we'll trip the code in // OnWindowPosChanging() below that notices work area changes. @@ -838,7 +848,7 @@ void WindowWin::OnSettingChange(UINT flags, const wchar_t* section) { } } -void WindowWin::OnSize(UINT size_param, const CSize& new_size) { +void NativeWindowWin::OnSize(UINT size_param, const CSize& new_size) { delegate_->OnNativeWindowBoundsChanged(); RedrawWindow(GetNativeView(), NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN); @@ -847,7 +857,7 @@ void WindowWin::OnSize(UINT size_param, const CSize& new_size) { ResetWindowRegion(false); } -void WindowWin::OnSysCommand(UINT notification_code, CPoint click) { +void NativeWindowWin::OnSysCommand(UINT notification_code, CPoint click) { // Windows uses the 4 lower order bits of |notification_code| for type- // specific information so we must exclude this when comparing. static const int sc_mask = 0xFFF0; @@ -894,7 +904,7 @@ void WindowWin::OnSysCommand(UINT notification_code, CPoint click) { } } -void WindowWin::OnWindowPosChanging(WINDOWPOS* window_pos) { +void NativeWindowWin::OnWindowPosChanging(WINDOWPOS* window_pos) { if (force_hidden_count_) { // Prevent the window from being made visible if we've been asked to do so. // See comment in header as to why we might want this. @@ -954,7 +964,7 @@ void WindowWin::OnWindowPosChanging(WINDOWPOS* window_pos) { DCHECK(ignore_pos_changes_factory_.empty()); MessageLoop::current()->PostTask(FROM_HERE, ignore_pos_changes_factory_.NewRunnableMethod( - &WindowWin::StopIgnoringPosChanges)); + &NativeWindowWin::StopIgnoringPosChanges)); } last_monitor_ = monitor; last_monitor_rect_ = monitor_rect; @@ -965,7 +975,7 @@ void WindowWin::OnWindowPosChanging(WINDOWPOS* window_pos) { NativeWidgetWin::OnWindowPosChanging(window_pos); } -void WindowWin::Close() { +void NativeWindowWin::Close() { NativeWidgetWin::Close(); // If the user activates another app after opening us, then comes back and @@ -985,7 +995,7 @@ void WindowWin::Close() { } } -void WindowWin::SetInitialFocus() { +void NativeWindowWin::SetInitialFocus() { if (!focus_on_creation_) return; @@ -1000,25 +1010,25 @@ void WindowWin::SetInitialFocus() { } //////////////////////////////////////////////////////////////////////////////// -// WindowWin, NativeWindow implementation: +// NativeWindowWin, NativeWindow implementation: -Window* WindowWin::GetWindow() { +Window* NativeWindowWin::GetWindow() { return delegate_->AsWindow(); } -const Window* WindowWin::GetWindow() const { +const Window* NativeWindowWin::GetWindow() const { return delegate_->AsWindow(); } -NativeWidget* WindowWin::AsNativeWidget() { +NativeWidget* NativeWindowWin::AsNativeWidget() { return this; } -const NativeWidget* WindowWin::AsNativeWidget() const { +const NativeWidget* NativeWindowWin::AsNativeWidget() const { return this; } -gfx::Rect WindowWin::GetRestoredBounds() const { +gfx::Rect NativeWindowWin::GetRestoredBounds() const { // If we're in fullscreen mode, we've changed the normal bounds to the monitor // rect, so return the saved bounds instead. if (IsFullscreen()) @@ -1029,7 +1039,7 @@ gfx::Rect WindowWin::GetRestoredBounds() const { return bounds; } -void WindowWin::ShowNativeWindow(ShowState state) { +void NativeWindowWin::ShowNativeWindow(ShowState state) { DWORD native_show_state; switch (state) { case SHOW_INACTIVE: @@ -1045,7 +1055,7 @@ void WindowWin::ShowNativeWindow(ShowState state) { Show(native_show_state); } -void WindowWin::BecomeModal() { +void NativeWindowWin::BecomeModal() { // We implement modality by crawling up the hierarchy of windows starting // at the owner, disabling all of them so that they don't receive input // messages. @@ -1056,15 +1066,15 @@ void WindowWin::BecomeModal() { } } -void WindowWin::CenterWindow(const gfx::Size& size) { +void NativeWindowWin::CenterWindow(const gfx::Size& size) { HWND parent = GetParent(); if (!IsWindow()) parent = GetOwner(GetNativeView()); ui::CenterAndSizeWindow(parent, GetNativeView(), size, false); } -void WindowWin::GetWindowBoundsAndMaximizedState(gfx::Rect* bounds, - bool* maximized) const { +void NativeWindowWin::GetWindowBoundsAndMaximizedState(gfx::Rect* bounds, + bool* maximized) const { WINDOWPLACEMENT wp; wp.length = sizeof(wp); const bool succeeded = !!GetWindowPlacement(GetNativeView(), &wp); @@ -1086,20 +1096,20 @@ void WindowWin::GetWindowBoundsAndMaximizedState(gfx::Rect* bounds, *maximized = (wp.showCmd == SW_SHOWMAXIMIZED); } -void WindowWin::EnableClose(bool enable) { +void NativeWindowWin::EnableClose(bool enable) { // Disable the native frame's close button regardless of whether or not the // native frame is in use, since this also affects the system menu. EnableMenuItem(GetSystemMenu(GetNativeView(), false), SC_CLOSE, enable); SendFrameChanged(GetNativeView()); } -void WindowWin::SetWindowTitle(const std::wstring& title) { +void NativeWindowWin::SetWindowTitle(const std::wstring& title) { SetWindowText(GetNativeView(), title.c_str()); SetAccessibleName(title); } -void WindowWin::SetWindowIcons(const SkBitmap& window_icon, - const SkBitmap& app_icon) { +void NativeWindowWin::SetWindowIcons(const SkBitmap& window_icon, + const SkBitmap& app_icon) { if (!window_icon.isNull()) { HICON windows_icon = IconUtil::CreateHICONFromSkBitmap(window_icon); // We need to make sure to destroy the previous icon, otherwise we'll leak @@ -1120,7 +1130,7 @@ void WindowWin::SetWindowIcons(const SkBitmap& window_icon, } } -void WindowWin::SetAccessibleName(const std::wstring& name) { +void NativeWindowWin::SetAccessibleName(const std::wstring& name) { base::win::ScopedComPtr<IAccPropServices> pAccPropServices; HRESULT hr = CoCreateInstance(CLSID_AccPropServices, NULL, CLSCTX_SERVER, IID_IAccPropServices, reinterpret_cast<void**>(&pAccPropServices)); @@ -1133,7 +1143,7 @@ void WindowWin::SetAccessibleName(const std::wstring& name) { } } -void WindowWin::SetAccessibleRole(ui::AccessibilityTypes::Role role) { +void NativeWindowWin::SetAccessibleRole(ui::AccessibilityTypes::Role role) { base::win::ScopedComPtr<IAccPropServices> pAccPropServices; HRESULT hr = CoCreateInstance(CLSID_AccPropServices, NULL, CLSCTX_SERVER, IID_IAccPropServices, reinterpret_cast<void**>(&pAccPropServices)); @@ -1148,7 +1158,7 @@ void WindowWin::SetAccessibleRole(ui::AccessibilityTypes::Role role) { } } -void WindowWin::SetAccessibleState(ui::AccessibilityTypes::State state) { +void NativeWindowWin::SetAccessibleState(ui::AccessibilityTypes::State state) { base::win::ScopedComPtr<IAccPropServices> pAccPropServices; HRESULT hr = CoCreateInstance(CLSID_AccPropServices, NULL, CLSCTX_SERVER, IID_IAccPropServices, reinterpret_cast<void**>(&pAccPropServices)); @@ -1162,18 +1172,18 @@ void WindowWin::SetAccessibleState(ui::AccessibilityTypes::State state) { } } -void WindowWin::SetWindowBounds(const gfx::Rect& bounds, - gfx::NativeWindow other_window) { +void NativeWindowWin::SetWindowBounds(const gfx::Rect& bounds, + gfx::NativeWindow other_window) { SetChildBounds(GetNativeView(), GetParent(), other_window, bounds, kMonitorEdgePadding, 0); } -void WindowWin::HideWindow() { +void NativeWindowWin::HideWindow() { // We can just call the function implemented by the widget. Hide(); } -void WindowWin::Activate() { +void NativeWindowWin::Activate() { if (IsMinimized()) ::ShowWindow(GetNativeView(), SW_RESTORE); ::SetWindowPos(GetNativeView(), HWND_TOP, 0, 0, 0, 0, @@ -1181,41 +1191,41 @@ void WindowWin::Activate() { SetForegroundWindow(GetNativeView()); } -void WindowWin::Deactivate() { +void NativeWindowWin::Deactivate() { HWND hwnd = ::GetNextWindow(GetNativeView(), GW_HWNDNEXT); if (hwnd) ::SetForegroundWindow(hwnd); } -void WindowWin::Maximize() { +void NativeWindowWin::Maximize() { ExecuteSystemMenuCommand(SC_MAXIMIZE); } -void WindowWin::Minimize() { +void NativeWindowWin::Minimize() { ExecuteSystemMenuCommand(SC_MINIMIZE); } -void WindowWin::Restore() { +void NativeWindowWin::Restore() { ExecuteSystemMenuCommand(SC_RESTORE); } -bool WindowWin::IsActive() const { +bool NativeWindowWin::IsActive() const { return is_active_; } -bool WindowWin::IsVisible() const { +bool NativeWindowWin::IsVisible() const { return !!::IsWindowVisible(GetNativeView()); } -bool WindowWin::IsMaximized() const { +bool NativeWindowWin::IsMaximized() const { return !!::IsZoomed(GetNativeView()); } -bool WindowWin::IsMinimized() const { +bool NativeWindowWin::IsMinimized() const { return !!::IsIconic(GetNativeView()); } -void WindowWin::SetFullscreen(bool fullscreen) { +void NativeWindowWin::SetFullscreen(bool fullscreen) { if (fullscreen_ == fullscreen) return; // Nothing to do. @@ -1272,16 +1282,16 @@ void WindowWin::SetFullscreen(bool fullscreen) { PopForceHidden(); } -bool WindowWin::IsFullscreen() const { +bool NativeWindowWin::IsFullscreen() const { return fullscreen_; } -void WindowWin::SetAlwaysOnTop(bool always_on_top) { +void NativeWindowWin::SetAlwaysOnTop(bool always_on_top) { ::SetWindowPos(GetNativeView(), always_on_top ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); } -void WindowWin::SetUseDragFrame(bool use_drag_frame) { +void NativeWindowWin::SetUseDragFrame(bool use_drag_frame) { if (use_drag_frame) { // Make the frame slightly transparent during the drag operation. drag_frame_saved_window_style_ = GetWindowLong(GWL_STYLE); @@ -1299,26 +1309,26 @@ void WindowWin::SetUseDragFrame(bool use_drag_frame) { } } -NonClientFrameView* WindowWin::CreateFrameViewForWindow() { +NonClientFrameView* NativeWindowWin::CreateFrameViewForWindow() { if (GetWindow()->ShouldUseNativeFrame()) return new NativeFrameView(GetWindow()); return new CustomFrameView(GetWindow()); } -void WindowWin::UpdateFrameAfterFrameChange() { +void NativeWindowWin::UpdateFrameAfterFrameChange() { // We've either gained or lost a custom window region, so reset it now. ResetWindowRegion(true); } -gfx::NativeWindow WindowWin::GetNativeWindow() const { +gfx::NativeWindow NativeWindowWin::GetNativeWindow() const { return GetNativeView(); } -bool WindowWin::ShouldUseNativeFrame() const { +bool NativeWindowWin::ShouldUseNativeFrame() const { return NativeWidgetWin::IsAeroGlassEnabled(); } -void WindowWin::FrameTypeChanged() { +void NativeWindowWin::FrameTypeChanged() { // Called when the frame type could possibly be changing (theme change or // DWM composition change). if (base::win::GetVersion() >= base::win::VERSION_VISTA) { @@ -1348,9 +1358,9 @@ void WindowWin::FrameTypeChanged() { } //////////////////////////////////////////////////////////////////////////////// -// WindowWin, private: +// NativeWindowWin, private: -void WindowWin::RestoreEnabledIfNecessary() { +void NativeWindowWin::RestoreEnabledIfNecessary() { if (delegate_->IsModal() && !restored_enabled_) { restored_enabled_ = true; // If we were run modally, we need to undo the disabled-ness we inflicted on @@ -1363,7 +1373,7 @@ void WindowWin::RestoreEnabledIfNecessary() { } } -DWORD WindowWin::CalculateWindowStyle() { +DWORD NativeWindowWin::CalculateWindowStyle() { DWORD window_styles = WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_SYSMENU | WS_CAPTION; bool can_resize = GetWindow()->window_delegate()->CanResize(); @@ -1384,22 +1394,22 @@ DWORD WindowWin::CalculateWindowStyle() { return window_styles; } -DWORD WindowWin::CalculateWindowExStyle() { +DWORD NativeWindowWin::CalculateWindowExStyle() { return delegate_->IsDialogBox() ? WS_EX_DLGMODALFRAME : 0; } -void WindowWin::LockUpdates() { +void NativeWindowWin::LockUpdates() { lock_updates_ = true; saved_window_style_ = GetWindowLong(GWL_STYLE); SetWindowLong(GWL_STYLE, saved_window_style_ & ~WS_VISIBLE); } -void WindowWin::UnlockUpdates() { +void NativeWindowWin::UnlockUpdates() { SetWindowLong(GWL_STYLE, saved_window_style_); lock_updates_ = false; } -void WindowWin::ResetWindowRegion(bool force) { +void NativeWindowWin::ResetWindowRegion(bool force) { // A native frame uses the native window region, and we don't want to mess // with it. if (GetWindow()->ShouldUseNativeFrame()) { @@ -1442,7 +1452,7 @@ void WindowWin::ResetWindowRegion(bool force) { DeleteObject(current_rgn); } -LRESULT WindowWin::CallDefaultNCActivateHandler(BOOL active) { +LRESULT NativeWindowWin::CallDefaultNCActivateHandler(BOOL active) { // The DefWindowProc handling for WM_NCACTIVATE renders the classic-look // window title bar directly, so we need to use a redraw lock here to prevent // it from doing so. @@ -1450,7 +1460,7 @@ LRESULT WindowWin::CallDefaultNCActivateHandler(BOOL active) { return DefWindowProc(GetNativeView(), WM_NCACTIVATE, active, 0); } -void WindowWin::ExecuteSystemMenuCommand(int command) { +void NativeWindowWin::ExecuteSystemMenuCommand(int command) { if (command) SendMessage(GetNativeView(), WM_SYSCOMMAND, command, 0); } @@ -1461,7 +1471,7 @@ void WindowWin::ExecuteSystemMenuCommand(int command) { // static NativeWindow* NativeWindow::CreateNativeWindow( internal::NativeWindowDelegate* delegate) { - return new WindowWin(delegate); + return new NativeWindowWin(delegate); } } // namespace views diff --git a/views/window/window_win.h b/views/window/native_window_win.h index 286c3a0..7587832 100644 --- a/views/window/window_win.h +++ b/views/window/native_window_win.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef VIEWS_WINDOW_WINDOW_WIN_H_ -#define VIEWS_WINDOW_WINDOW_WIN_H_ +#ifndef VIEWS_WINDOW_NATIVE_WINDOW_WIN_H_ +#define VIEWS_WINDOW_NATIVE_WINDOW_WIN_H_ #pragma once #include "views/widget/native_widget_win.h" @@ -34,18 +34,18 @@ class WindowDelegate; //////////////////////////////////////////////////////////////////////////////// // -// WindowWin +// NativeWindowWin // -// 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. +// A NativeWindowWin 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 NativeWidgetWin, - public NativeWindow { +class NativeWindowWin : public NativeWidgetWin, + public NativeWindow { public: - explicit WindowWin(internal::NativeWindowDelegate* delegate); - virtual ~WindowWin(); + explicit NativeWindowWin(internal::NativeWindowDelegate* delegate); + virtual ~NativeWindowWin(); // Show the window with the specified show command. void Show(int show_state); @@ -248,7 +248,7 @@ class WindowWin : public NativeWidgetWin, // The following factory is used to ignore SetWindowPos() calls for short time // periods. - ScopedRunnableMethodFactory<WindowWin> ignore_pos_changes_factory_; + ScopedRunnableMethodFactory<NativeWindowWin> ignore_pos_changes_factory_; // If this is greater than zero, we should prevent attempts to make the window // visible when we handle WM_WINDOWPOSCHANGING. Some calls like @@ -269,9 +269,9 @@ class WindowWin : public NativeWidgetWin, DWORD drag_frame_saved_window_style_; DWORD drag_frame_saved_window_ex_style_; - DISALLOW_COPY_AND_ASSIGN(WindowWin); + DISALLOW_COPY_AND_ASSIGN(NativeWindowWin); }; } // namespace views -#endif // VIEWS_WINDOW_WINDOW_WIN_H_ +#endif // VIEWS_WINDOW_NATIVE_WINDOW_WIN_H_ diff --git a/views/window/window_win_unittest.cc b/views/window/native_window_win_unittest.cc index 7cdc913..a612af5 100644 --- a/views/window/window_win_unittest.cc +++ b/views/window/native_window_win_unittest.cc @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "views/window/window_win.h" +#include "views/window/native_window_win.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/gfx/rect.h" namespace views { -TEST(WindowWinTest, EnsureRectIsVisibleInRect) { +TEST(NativeWindowWinTest, EnsureRectIsVisibleInRect) { gfx::Rect parent_rect(0, 0, 500, 400); { |