diff options
author | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-27 01:22:27 +0000 |
---|---|---|
committer | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-27 01:22:27 +0000 |
commit | e49c051e5ace6e526f700a704f8202506e5283af (patch) | |
tree | 09c67a01f20022f99052a4651254889021416975 /chrome/browser/fullscreen_win.cc | |
parent | 188da519ad3504c0138aa0033cae30e2684ff75d (diff) | |
download | chromium_src-e49c051e5ace6e526f700a704f8202506e5283af.zip chromium_src-e49c051e5ace6e526f700a704f8202506e5283af.tar.gz chromium_src-e49c051e5ace6e526f700a704f8202506e5283af.tar.bz2 |
Delay load SHQueryUserNotificationState for platform dependent full-screen
check.
BUG=none
TEST=Manual test
Review URL: http://codereview.chromium.org/6344015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72737 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/fullscreen_win.cc')
-rw-r--r-- | chrome/browser/fullscreen_win.cc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/chrome/browser/fullscreen_win.cc b/chrome/browser/fullscreen_win.cc index 5e6c28f..ac50ed4 100644 --- a/chrome/browser/fullscreen_win.cc +++ b/chrome/browser/fullscreen_win.cc @@ -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() { |