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" |
11 #include "base/win/windows_version.h" | 11 #include "base/win/windows_version.h" |
12 | 12 |
13 #if defined(USE_ASH) | 13 #if defined(USE_ASH) |
14 #include "ash/wm/window_util.h" | 14 #include "ash/root_window_controller.h" |
15 #include "chrome/browser/ui/host_desktop.h" | 15 #include "chrome/browser/ui/host_desktop.h" |
16 #endif | 16 #endif |
17 | 17 |
18 static bool IsPlatformFullScreenMode() { | 18 static bool IsPlatformFullScreenMode() { |
19 // SHQueryUserNotificationState is only available for Vista and above. | 19 // SHQueryUserNotificationState is only available for Vista and above. |
20 #if defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_VISTA) | 20 #if defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_VISTA) |
21 if (base::win::GetVersion() < base::win::VERSION_VISTA) | 21 if (base::win::GetVersion() < base::win::VERSION_VISTA) |
22 return false; | 22 return false; |
23 | 23 |
24 typedef HRESULT(WINAPI *SHQueryUserNotificationStatePtr)( | 24 typedef HRESULT(WINAPI *SHQueryUserNotificationStatePtr)( |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 DWORD modes = 0; | 96 DWORD modes = 0; |
97 ::GetConsoleDisplayMode(&modes); | 97 ::GetConsoleDisplayMode(&modes); |
98 ::FreeConsole(); | 98 ::FreeConsole(); |
99 | 99 |
100 return (modes & (CONSOLE_FULLSCREEN | CONSOLE_FULLSCREEN_HARDWARE)) != 0; | 100 return (modes & (CONSOLE_FULLSCREEN | CONSOLE_FULLSCREEN_HARDWARE)) != 0; |
101 } | 101 } |
102 | 102 |
103 bool IsFullScreenMode() { | 103 bool IsFullScreenMode() { |
104 #if defined(USE_ASH) | 104 #if defined(USE_ASH) |
105 if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH) | 105 if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH) { |
106 return ash::wm::IsActiveWindowFullscreen(); | 106 ash::internal::RootWindowController* controller = |
| 107 ash::internal::RootWindowController::ForActiveRootWindow(); |
| 108 return controller && controller->GetFullscreenWindow(); |
| 109 } |
107 #endif | 110 #endif |
108 return IsPlatformFullScreenMode() || | 111 return IsPlatformFullScreenMode() || |
109 IsFullScreenWindowMode() || | 112 IsFullScreenWindowMode() || |
110 IsFullScreenConsoleMode(); | 113 IsFullScreenConsoleMode(); |
111 } | 114 } |
OLD | NEW |