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

Unified Diff: chrome/browser/fullscreen_win.cc

Issue 6344015: Delay load SHQueryUserNotificationState for platform dependent full-screen... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/fullscreen_win.cc
===================================================================
--- chrome/browser/fullscreen_win.cc (revision 72554)
+++ chrome/browser/fullscreen_win.cc (working copy)
@@ -7,8 +7,43 @@
#include <windows.h>
#include <shellapi.h>
+#include "base/logging.h"
+#include "base/sys_info.h"
+
static bool IsPlatformFullScreenMode() {
+ // SHQueryUserNotificationState is only available for Vista and above.
+#if defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_VISTA)
+ int32 major_version, minor_version, fix_version;
+ base::SysInfo::OperatingSystemVersionNumbers(&major_version,
+ &minor_version,
+ &fix_version);
+ if (major_version < 6)
+ return false;
+
+ typedef HRESULT(WINAPI *SHQueryUserNotificationStatePtr)(
+ QUERY_USER_NOTIFICATION_STATE* state);
+
+ HMODULE shell32_base = ::GetModuleHandle(L"shell32.dll");
+ if (!shell32_base) {
+ NOTREACHED();
+ return false;
+ }
+ SHQueryUserNotificationStatePtr query_user_notification_state_ptr =
+ reinterpret_cast<SHQueryUserNotificationStatePtr>
+ (::GetProcAddress(shell32_base, "SHQueryUserNotificationState"));
+ if (!query_user_notification_state_ptr) {
+ NOTREACHED();
+ return false;
+ }
+
+ QUERY_USER_NOTIFICATION_STATE state;
+ if (FAILED((*query_user_notification_state_ptr)(&state)))
+ return false;
+ return state == QUNS_RUNNING_D3D_FULL_SCREEN ||
+ state == QUNS_PRESENTATION_MODE;
+#else
return false;
+#endif
}
static bool IsFullScreenWindowMode() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698