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/sys_info.h" | 11 #include "base/win/windows_version.h" |
12 | 12 |
13 static bool IsPlatformFullScreenMode() { | 13 static bool IsPlatformFullScreenMode() { |
14 // SHQueryUserNotificationState is only available for Vista and above. | 14 // SHQueryUserNotificationState is only available for Vista and above. |
15 #if defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_VISTA) | 15 #if defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_VISTA) |
16 int32 major_version, minor_version, fix_version; | 16 if (base::win::GetVersion() < base::win::VERSION_VISTA) |
17 base::SysInfo::OperatingSystemVersionNumbers(&major_version, | |
18 &minor_version, | |
19 &fix_version); | |
20 if (major_version < 6) | |
21 return false; | 17 return false; |
22 | 18 |
23 typedef HRESULT(WINAPI *SHQueryUserNotificationStatePtr)( | 19 typedef HRESULT(WINAPI *SHQueryUserNotificationStatePtr)( |
24 QUERY_USER_NOTIFICATION_STATE* state); | 20 QUERY_USER_NOTIFICATION_STATE* state); |
25 | 21 |
26 HMODULE shell32_base = ::GetModuleHandle(L"shell32.dll"); | 22 HMODULE shell32_base = ::GetModuleHandle(L"shell32.dll"); |
27 if (!shell32_base) { | 23 if (!shell32_base) { |
28 NOTREACHED(); | 24 NOTREACHED(); |
29 return false; | 25 return false; |
30 } | 26 } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 ::FreeConsole(); | 93 ::FreeConsole(); |
98 | 94 |
99 return (modes & (CONSOLE_FULLSCREEN | CONSOLE_FULLSCREEN_HARDWARE)) != 0; | 95 return (modes & (CONSOLE_FULLSCREEN | CONSOLE_FULLSCREEN_HARDWARE)) != 0; |
100 } | 96 } |
101 | 97 |
102 bool IsFullScreenMode() { | 98 bool IsFullScreenMode() { |
103 return IsPlatformFullScreenMode() || | 99 return IsPlatformFullScreenMode() || |
104 IsFullScreenWindowMode() || | 100 IsFullScreenWindowMode() || |
105 IsFullScreenConsoleMode(); | 101 IsFullScreenConsoleMode(); |
106 } | 102 } |
OLD | NEW |