OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/fullscreen.h" | 5 #include "chrome/browser/fullscreen.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 return false; | 55 return false; |
56 | 56 |
57 // Get the monitor where the window is located. | 57 // Get the monitor where the window is located. |
58 RECT wnd_rect; | 58 RECT wnd_rect; |
59 if (!::GetWindowRect(wnd, &wnd_rect)) | 59 if (!::GetWindowRect(wnd, &wnd_rect)) |
60 return false; | 60 return false; |
61 HMONITOR monitor = ::MonitorFromRect(&wnd_rect, MONITOR_DEFAULTTONULL); | 61 HMONITOR monitor = ::MonitorFromRect(&wnd_rect, MONITOR_DEFAULTTONULL); |
62 if (!monitor) | 62 if (!monitor) |
63 return false; | 63 return false; |
64 MONITORINFO monitor_info = { sizeof(monitor_info) }; | 64 MONITORINFO monitor_info = { sizeof(monitor_info) }; |
65 if (!base::win::GetMonitorInfoWrapper(monitor, &monitor_info)) | 65 if (!::GetMonitorInfo(monitor, &monitor_info)) |
66 return false; | 66 return false; |
67 | 67 |
68 // It should be the main monitor. | 68 // It should be the main monitor. |
69 if (!(monitor_info.dwFlags & MONITORINFOF_PRIMARY)) | 69 if (!(monitor_info.dwFlags & MONITORINFOF_PRIMARY)) |
70 return false; | 70 return false; |
71 | 71 |
72 // The window should be at least as large as the monitor. | 72 // The window should be at least as large as the monitor. |
73 if (!::IntersectRect(&wnd_rect, &wnd_rect, &monitor_info.rcMonitor)) | 73 if (!::IntersectRect(&wnd_rect, &wnd_rect, &monitor_info.rcMonitor)) |
74 return false; | 74 return false; |
75 if (!::EqualRect(&wnd_rect, &monitor_info.rcMonitor)) | 75 if (!::EqualRect(&wnd_rect, &monitor_info.rcMonitor)) |
(...skipping 30 matching lines...) Expand all Loading... |
106 if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH) { | 106 if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH) { |
107 ash::internal::RootWindowController* controller = | 107 ash::internal::RootWindowController* controller = |
108 ash::internal::RootWindowController::ForTargetRootWindow(); | 108 ash::internal::RootWindowController::ForTargetRootWindow(); |
109 return controller && controller->GetWindowForFullscreenMode(); | 109 return controller && controller->GetWindowForFullscreenMode(); |
110 } | 110 } |
111 #endif | 111 #endif |
112 return IsPlatformFullScreenMode() || | 112 return IsPlatformFullScreenMode() || |
113 IsFullScreenWindowMode() || | 113 IsFullScreenWindowMode() || |
114 IsFullScreenConsoleMode(); | 114 IsFullScreenConsoleMode(); |
115 } | 115 } |
OLD | NEW |