Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: chrome/browser/fullscreen_win.cc

Issue 7150018: Use GetVersion for Windows run-time version checks in preference to OperatingSystemVersionNumbers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/renderer/localized_error.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/localized_error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698