OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/widget/native_widget_win.h" | 5 #include "ui/views/widget/native_widget_win.h" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 2493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2504 void NativeWidgetWin::ClientAreaSizeChanged() { | 2504 void NativeWidgetWin::ClientAreaSizeChanged() { |
2505 RECT r; | 2505 RECT r; |
2506 if (WidgetSizeIsClientSize()) | 2506 if (WidgetSizeIsClientSize()) |
2507 GetClientRect(&r); | 2507 GetClientRect(&r); |
2508 else | 2508 else |
2509 GetWindowRect(&r); | 2509 GetWindowRect(&r); |
2510 gfx::Size s(std::max(0, static_cast<int>(r.right - r.left)), | 2510 gfx::Size s(std::max(0, static_cast<int>(r.right - r.left)), |
2511 std::max(0, static_cast<int>(r.bottom - r.top))); | 2511 std::max(0, static_cast<int>(r.bottom - r.top))); |
2512 delegate_->OnNativeWidgetSizeChanged(s); | 2512 delegate_->OnNativeWidgetSizeChanged(s); |
2513 if (use_layered_buffer_) | 2513 if (use_layered_buffer_) |
2514 layered_window_contents_.reset( | 2514 layered_window_contents_.reset(new gfx::Canvas(s, false)); |
2515 new gfx::Canvas(s, ui::SCALE_FACTOR_100P, false)); | |
2516 } | 2515 } |
2517 | 2516 |
2518 void NativeWidgetWin::UpdateDWMFrame() { | 2517 void NativeWidgetWin::UpdateDWMFrame() { |
2519 MARGINS m = {10, 10, 10, 10}; | 2518 MARGINS m = {10, 10, 10, 10}; |
2520 DwmExtendFrameIntoClientArea(GetNativeView(), &m); | 2519 DwmExtendFrameIntoClientArea(GetNativeView(), &m); |
2521 } | 2520 } |
2522 | 2521 |
2523 void NativeWidgetWin::ResetWindowRegion(bool force) { | 2522 void NativeWidgetWin::ResetWindowRegion(bool force) { |
2524 // A native frame uses the native window region, and we don't want to mess | 2523 // A native frame uses the native window region, and we don't want to mess |
2525 // with it. | 2524 // with it. |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2768 // static | 2767 // static |
2769 bool NativeWidgetPrivate::IsTouchDown() { | 2768 bool NativeWidgetPrivate::IsTouchDown() { |
2770 // This currently isn't necessary because we're not generating touch events on | 2769 // This currently isn't necessary because we're not generating touch events on |
2771 // windows. When we do, this will need to be updated. | 2770 // windows. When we do, this will need to be updated. |
2772 return false; | 2771 return false; |
2773 } | 2772 } |
2774 | 2773 |
2775 } // namespace internal | 2774 } // namespace internal |
2776 | 2775 |
2777 } // namespace views | 2776 } // namespace views |
OLD | NEW |