diff options
Diffstat (limited to 'views/window/window_win.cc')
-rw-r--r-- | views/window/window_win.cc | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/views/window/window_win.cc b/views/window/window_win.cc index e73c144..2845379 100644 --- a/views/window/window_win.cc +++ b/views/window/window_win.cc @@ -310,7 +310,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. - if (delegate_->IsUsingNativeFrame()) + if (GetWindow()->ShouldUseNativeFrame()) return gfx::Insets(); if (IsMaximized()) { @@ -414,7 +414,7 @@ void WindowWin::OnExitSizeMove() { WidgetWin::OnExitSizeMove(); delegate_->OnNativeWindowEndUserBoundsChange(); - if (!ShouldUseNativeFrame()) { + if (!GetWindow()->ShouldUseNativeFrame()) { // Sending SWP_FRAMECHANGED forces a non-client repaint, which fixes the // glitch in rendering the bottom pixel of the window caused by us // offsetting the client rect there (See comment in GetClientAreaInsets()). @@ -438,7 +438,7 @@ void WindowWin::OnGetMinMaxInfo(MINMAXINFO* 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 (delegate_->IsUsingNativeFrame()) + if (GetWindow()->ShouldUseNativeFrame()) WidgetWin::OnInitMenu(menu); bool is_fullscreen = IsFullscreen(); @@ -484,7 +484,8 @@ LRESULT WindowWin::OnMouseRange(UINT message, WPARAM w_param, LPARAM l_param) { ExecuteSystemMenuCommand(id); return 0; } - } else if (message == WM_NCLBUTTONDOWN && !delegate_->IsUsingNativeFrame()) { + } else if (message == WM_NCLBUTTONDOWN && + !GetWindow()->ShouldUseNativeFrame()) { switch (w_param) { case HTCLOSE: case HTMINBUTTON: @@ -562,7 +563,7 @@ LRESULT WindowWin::OnNCActivate(BOOL active) { if (IsVisible()) GetWindow()->non_client_view()->SchedulePaint(); - if (!ShouldUseNativeFrame()) { + if (!GetWindow()->ShouldUseNativeFrame()) { // TODO(beng, et al): Hack to redraw this window and child windows // synchronously upon activation. Not all child windows are redrawing // themselves leading to issues like http://crbug.com/74604 @@ -624,7 +625,7 @@ LRESULT WindowWin::OnNCCalcSize(BOOL mode, LPARAM l_param) { if (EdgeHasTopmostAutoHideTaskbar(ABE_LEFT, monitor)) client_rect->left += kAutoHideTaskbarThicknessPx; if (EdgeHasTopmostAutoHideTaskbar(ABE_TOP, monitor)) { - if (delegate_->IsUsingNativeFrame()) { + if (GetWindow()->ShouldUseNativeFrame()) { // Tricky bit. Due to a bug in DwmDefWindowProc()'s handling of // WM_NCHITTEST, having any nonclient area atop the window causes the // caption buttons to draw onscreen but not respond to mouse @@ -665,7 +666,7 @@ LRESULT WindowWin::OnNCCalcSize(BOOL mode, LPARAM l_param) { LRESULT WindowWin::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 (ShouldUseNativeFrame()) { + if (GetWindow()->ShouldUseNativeFrame()) { LRESULT result; if (DwmDefWindowProc(GetNativeView(), WM_NCHITTEST, 0, MAKELPARAM(point.x, point.y), &result)) { @@ -690,14 +691,14 @@ void WindowWin::OnNCPaint(HRGN rgn) { // When using a custom frame, we want to avoid calling DefWindowProc() since // that may render artifacts. SetMsgHandled((!IsActive() || is_in_size_move_) && - !delegate_->IsUsingNativeFrame()); + !GetWindow()->ShouldUseNativeFrame()); } LRESULT WindowWin::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(!delegate_->IsUsingNativeFrame()); + SetMsgHandled(!GetWindow()->ShouldUseNativeFrame()); return 0; } @@ -705,7 +706,7 @@ LRESULT WindowWin::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(!delegate_->IsUsingNativeFrame()); + SetMsgHandled(!GetWindow()->ShouldUseNativeFrame()); return 0; } @@ -762,7 +763,7 @@ void WindowWin::OnSysCommand(UINT notification_code, CPoint click) { ((notification_code & sc_mask) == SC_MOVE) || ((notification_code & sc_mask) == SC_MAXIMIZE))) return; - if (!delegate_->IsUsingNativeFrame()) { + if (!GetWindow()->ShouldUseNativeFrame()) { if ((notification_code & sc_mask) == SC_MINIMIZE || (notification_code & sc_mask) == SC_MAXIMIZE || (notification_code & sc_mask) == SC_RESTORE) { @@ -1205,7 +1206,7 @@ void WindowWin::SetUseDragFrame(bool use_drag_frame) { } NonClientFrameView* WindowWin::CreateFrameViewForWindow() { - if (ShouldUseNativeFrame()) + if (GetWindow()->ShouldUseNativeFrame()) return new NativeFrameView(GetWindow()); return new CustomFrameView(GetWindow()); } @@ -1232,8 +1233,8 @@ void WindowWin::FrameTypeChanged() { // the DWM's glass non-client rendering is enabled, which is why // DWMNCRP_ENABLED is used for the native frame case. _DISABLED means the // DWM doesn't render glass, and so is used in the custom frame case. - DWMNCRENDERINGPOLICY policy = - delegate_->IsUsingNativeFrame() ? DWMNCRP_ENABLED : DWMNCRP_DISABLED; + DWMNCRENDERINGPOLICY policy = GetWindow()->ShouldUseNativeFrame() ? + DWMNCRP_ENABLED : DWMNCRP_DISABLED; DwmSetWindowAttribute(GetNativeView(), DWMWA_NCRENDERING_POLICY, &policy, sizeof(DWMNCRENDERINGPOLICY)); } @@ -1307,7 +1308,7 @@ void WindowWin::UnlockUpdates() { void WindowWin::ResetWindowRegion(bool force) { // A native frame uses the native window region, and we don't want to mess // with it. - if (delegate_->IsUsingNativeFrame()) { + if (GetWindow()->ShouldUseNativeFrame()) { if (force) SetWindowRgn(NULL, TRUE); return; |