| 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 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 base::win::ScopedHICON previous_icon = std::move(app_icon_); | 821 base::win::ScopedHICON previous_icon = std::move(app_icon_); |
| 822 app_icon_ = IconUtil::CreateHICONFromSkBitmap(*app_icon.bitmap()); | 822 app_icon_ = IconUtil::CreateHICONFromSkBitmap(*app_icon.bitmap()); |
| 823 SendMessage(hwnd(), WM_SETICON, ICON_BIG, | 823 SendMessage(hwnd(), WM_SETICON, ICON_BIG, |
| 824 reinterpret_cast<LPARAM>(app_icon_.get())); | 824 reinterpret_cast<LPARAM>(app_icon_.get())); |
| 825 } | 825 } |
| 826 } | 826 } |
| 827 | 827 |
| 828 void HWNDMessageHandler::SetFullscreen(bool fullscreen) { | 828 void HWNDMessageHandler::SetFullscreen(bool fullscreen) { |
| 829 background_fullscreen_hack_ = false; | 829 background_fullscreen_hack_ = false; |
| 830 fullscreen_handler()->SetFullscreen(fullscreen); | 830 fullscreen_handler()->SetFullscreen(fullscreen); |
| 831 // If we are out of fullscreen and there was a pending DWM transition for the | |
| 832 // window, then go ahead and do it now. | |
| 833 if (!fullscreen && dwm_transition_desired_) | |
| 834 PerformDwmTransition(); | |
| 835 | 831 |
| 836 // Add the fullscreen window to the fullscreen window map which is used to | 832 // Add the fullscreen window to the fullscreen window map which is used to |
| 837 // handle window activations. | 833 // handle window activations. |
| 838 HMONITOR monitor = MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY); | 834 HMONITOR monitor = MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY); |
| 839 if (fullscreen) { | 835 if (fullscreen) { |
| 840 (fullscreen_monitor_map_.Get())[monitor] = this; | 836 (fullscreen_monitor_map_.Get())[monitor] = this; |
| 841 } else { | 837 } else { |
| 842 FullscreenWindowMonitorMap::iterator iter = | 838 FullscreenWindowMonitorMap::iterator iter = |
| 843 fullscreen_monitor_map_.Get().find(monitor); | 839 fullscreen_monitor_map_.Get().find(monitor); |
| 844 if (iter != fullscreen_monitor_map_.Get().end()) | 840 if (iter != fullscreen_monitor_map_.Get().end()) |
| 845 fullscreen_monitor_map_.Get().erase(iter); | 841 fullscreen_monitor_map_.Get().erase(iter); |
| 846 } | 842 } |
| 843 // If we are out of fullscreen and there was a pending DWM transition for the |
| 844 // window, then go ahead and do it now. |
| 845 if (!fullscreen && dwm_transition_desired_) |
| 846 PerformDwmTransition(); |
| 847 } | 847 } |
| 848 | 848 |
| 849 void HWNDMessageHandler::SizeConstraintsChanged() { | 849 void HWNDMessageHandler::SizeConstraintsChanged() { |
| 850 LONG style = GetWindowLong(hwnd(), GWL_STYLE); | 850 LONG style = GetWindowLong(hwnd(), GWL_STYLE); |
| 851 // Ignore if this is not a standard window. | 851 // Ignore if this is not a standard window. |
| 852 if (style & (WS_POPUP | WS_CHILD)) | 852 if (style & (WS_POPUP | WS_CHILD)) |
| 853 return; | 853 return; |
| 854 | 854 |
| 855 LONG exstyle = GetWindowLong(hwnd(), GWL_EXSTYLE); | 855 LONG exstyle = GetWindowLong(hwnd(), GWL_EXSTYLE); |
| 856 // Windows cannot have WS_THICKFRAME set if WS_EX_COMPOSITED is set. | 856 // Windows cannot have WS_THICKFRAME set if WS_EX_COMPOSITED is set. |
| (...skipping 1924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2781 MONITORINFO monitor_info = {sizeof(monitor_info)}; | 2781 MONITORINFO monitor_info = {sizeof(monitor_info)}; |
| 2782 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY), | 2782 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY), |
| 2783 &monitor_info); | 2783 &monitor_info); |
| 2784 gfx::Rect shrunk_rect(monitor_info.rcMonitor); | 2784 gfx::Rect shrunk_rect(monitor_info.rcMonitor); |
| 2785 shrunk_rect.set_height(shrunk_rect.height() - 1); | 2785 shrunk_rect.set_height(shrunk_rect.height() - 1); |
| 2786 background_fullscreen_hack_ = true; | 2786 background_fullscreen_hack_ = true; |
| 2787 SetBoundsInternal(shrunk_rect, false); | 2787 SetBoundsInternal(shrunk_rect, false); |
| 2788 } | 2788 } |
| 2789 | 2789 |
| 2790 } // namespace views | 2790 } // namespace views |
| OLD | NEW |