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 2477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2488 lock_updates_count_ = 0; | 2488 lock_updates_count_ = 0; |
2489 } | 2489 } |
2490 } | 2490 } |
2491 | 2491 |
2492 bool NativeWidgetWin::WidgetSizeIsClientSize() const { | 2492 bool NativeWidgetWin::WidgetSizeIsClientSize() const { |
2493 const Widget* widget = GetWidget()->GetTopLevelWidget(); | 2493 const Widget* widget = GetWidget()->GetTopLevelWidget(); |
2494 return IsZoomed() || (widget && widget->ShouldUseNativeFrame()); | 2494 return IsZoomed() || (widget && widget->ShouldUseNativeFrame()); |
2495 } | 2495 } |
2496 | 2496 |
2497 void NativeWidgetWin::ClientAreaSizeChanged() { | 2497 void NativeWidgetWin::ClientAreaSizeChanged() { |
2498 RECT r; | 2498 RECT r = {0, 0, 0, 0}; |
2499 if (WidgetSizeIsClientSize()) | 2499 if (WidgetSizeIsClientSize()) { |
2500 GetClientRect(&r); | 2500 if (!IsMinimized()) |
2501 else | 2501 GetClientRect(&r); |
2502 } else | |
2502 GetWindowRect(&r); | 2503 GetWindowRect(&r); |
Ben Goodger (Google)
2012/08/06 19:32:35
braces around else too.
| |
2503 gfx::Size s(std::max(0, static_cast<int>(r.right - r.left)), | 2504 gfx::Size s(std::max(0, static_cast<int>(r.right - r.left)), |
2504 std::max(0, static_cast<int>(r.bottom - r.top))); | 2505 std::max(0, static_cast<int>(r.bottom - r.top))); |
2505 delegate_->OnNativeWidgetSizeChanged(s); | 2506 delegate_->OnNativeWidgetSizeChanged(s); |
2506 if (use_layered_buffer_) | 2507 if (use_layered_buffer_) |
2507 layered_window_contents_.reset( | 2508 layered_window_contents_.reset( |
2508 new gfx::Canvas(s, ui::SCALE_FACTOR_100P, false)); | 2509 new gfx::Canvas(s, ui::SCALE_FACTOR_100P, false)); |
2509 } | 2510 } |
2510 | 2511 |
2511 void NativeWidgetWin::UpdateDWMFrame() { | 2512 void NativeWidgetWin::UpdateDWMFrame() { |
2512 MARGINS m = {10, 10, 10, 10}; | 2513 MARGINS m = {10, 10, 10, 10}; |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2761 // static | 2762 // static |
2762 bool NativeWidgetPrivate::IsTouchDown() { | 2763 bool NativeWidgetPrivate::IsTouchDown() { |
2763 // This currently isn't necessary because we're not generating touch events on | 2764 // This currently isn't necessary because we're not generating touch events on |
2764 // windows. When we do, this will need to be updated. | 2765 // windows. When we do, this will need to be updated. |
2765 return false; | 2766 return false; |
2766 } | 2767 } |
2767 | 2768 |
2768 } // namespace internal | 2769 } // namespace internal |
2769 | 2770 |
2770 } // namespace views | 2771 } // namespace views |
OLD | NEW |