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/win/hwnd_message_handler.h" | 5 #include "ui/views/win/hwnd_message_handler.h" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 #include <oleacc.h> | 8 #include <oleacc.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <tchar.h> | 10 #include <tchar.h> |
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1036 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY), | 1036 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY), |
1037 &monitor_info); | 1037 &monitor_info); |
1038 gfx::Rect shrunk_rect(monitor_info.rcMonitor); | 1038 gfx::Rect shrunk_rect(monitor_info.rcMonitor); |
1039 shrunk_rect.set_height(shrunk_rect.height() - 1); | 1039 shrunk_rect.set_height(shrunk_rect.height() - 1); |
1040 background_fullscreen_hack_ = true; | 1040 background_fullscreen_hack_ = true; |
1041 SetBoundsInternal(shrunk_rect, false); | 1041 SetBoundsInternal(shrunk_rect, false); |
1042 } | 1042 } |
1043 } else if (background_fullscreen_hack_) { | 1043 } else if (background_fullscreen_hack_) { |
1044 // Restore the bounds of the window to fullscreen. | 1044 // Restore the bounds of the window to fullscreen. |
1045 DCHECK(IsFullscreen()); | 1045 DCHECK(IsFullscreen()); |
1046 background_fullscreen_hack_ = false; | |
1047 MONITORINFO monitor_info = {sizeof(monitor_info)}; | 1046 MONITORINFO monitor_info = {sizeof(monitor_info)}; |
1048 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY), | 1047 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY), |
1049 &monitor_info); | 1048 &monitor_info); |
1050 SetBoundsInternal(gfx::Rect(monitor_info.rcMonitor), false); | 1049 SetBoundsInternal(gfx::Rect(monitor_info.rcMonitor), false); |
| 1050 background_fullscreen_hack_ = false; |
1051 } | 1051 } |
1052 } | 1052 } |
1053 | 1053 |
1054 void HWNDMessageHandler::RestoreEnabledIfNecessary() { | 1054 void HWNDMessageHandler::RestoreEnabledIfNecessary() { |
1055 if (delegate_->IsModal() && !restored_enabled_) { | 1055 if (delegate_->IsModal() && !restored_enabled_) { |
1056 restored_enabled_ = true; | 1056 restored_enabled_ = true; |
1057 // If we were run modally, we need to undo the disabled-ness we inflicted on | 1057 // If we were run modally, we need to undo the disabled-ness we inflicted on |
1058 // the owner's parent hierarchy. | 1058 // the owner's parent hierarchy. |
1059 HWND start = ::GetWindow(hwnd(), GW_OWNER); | 1059 HWND start = ::GetWindow(hwnd(), GW_OWNER); |
1060 while (start) { | 1060 while (start) { |
(...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2629 delegate_->HandleClientSizeChanged(GetClientAreaBounds().size()); | 2629 delegate_->HandleClientSizeChanged(GetClientAreaBounds().size()); |
2630 ResetWindowRegion(false, true); | 2630 ResetWindowRegion(false, true); |
2631 } | 2631 } |
2632 | 2632 |
2633 if (direct_manipulation_helper_) | 2633 if (direct_manipulation_helper_) |
2634 direct_manipulation_helper_->SetBounds(bounds_in_pixels); | 2634 direct_manipulation_helper_->SetBounds(bounds_in_pixels); |
2635 } | 2635 } |
2636 | 2636 |
2637 | 2637 |
2638 } // namespace views | 2638 } // namespace views |
OLD | NEW |