diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-01-25 11:39:07 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-01-25 15:20:42 +0000 |
commit | 6c91641271e536ffaa88a1dff5127e42ee99a91e (patch) | |
tree | 703d9dd49602377ddc90cbf886aad37913f2496b /chromium/base/win/win_util.h | |
parent | b145b7fafd36f0c260d6a768c81fc14e32578099 (diff) |
BASELINE: Update Chromium to 49.0.2623.23
Also adds missing printing sources.
Change-Id: I3726b8f0c7d6751c9fc846096c571fadca7108cd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'chromium/base/win/win_util.h')
-rw-r--r-- | chromium/base/win/win_util.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/chromium/base/win/win_util.h b/chromium/base/win/win_util.h index 3c900ff9b0a..6162b51bb03 100644 --- a/chromium/base/win/win_util.h +++ b/chromium/base/win/win_util.h @@ -23,6 +23,7 @@ #define BASE_WIN_WIN_UTIL_H_ #include <windows.h> +#include <stdint.h> #include <string> @@ -56,25 +57,19 @@ struct NONCLIENTMETRICS_XP { namespace base { namespace win { +inline uint32_t HandleToUint32(HANDLE h) { + // Cast through uintptr_t and then unsigned int to make the truncation to + // 32 bits explicit. Handles are size of-pointer but are always 32-bit values. + // https://msdn.microsoft.com/en-us/library/aa384203(VS.85).aspx says: + // 64-bit versions of Windows use 32-bit handles for interoperability. + return static_cast<uint32_t>(reinterpret_cast<uintptr_t>(h)); +} + BASE_EXPORT void GetNonClientMetrics(NONCLIENTMETRICS_XP* metrics); // Returns the string representing the current user sid. BASE_EXPORT bool GetUserSidString(std::wstring* user_sid); -// Returns true if the shift key is currently pressed. -BASE_EXPORT bool IsShiftPressed(); - -// Returns true if the ctrl key is currently pressed. -BASE_EXPORT bool IsCtrlPressed(); - -// Returns true if the alt key is currently pressed. -BASE_EXPORT bool IsAltPressed(); - -// Returns true if the altgr key is currently pressed. -// Windows does not have specific key code and modifier bit and Alt+Ctrl key is -// used as AltGr key in Windows. -BASE_EXPORT bool IsAltGrPressed(); - // Returns false if user account control (UAC) has been disabled with the // EnableLUA registry flag. Returns true if user account control is enabled. // NOTE: The EnableLUA registry flag, which is ignored on Windows XP @@ -128,9 +123,14 @@ BASE_EXPORT bool ShouldCrashOnProcessDetach(); BASE_EXPORT void SetAbortBehaviorForCrashReporting(); // A tablet is a device that is touch enabled and also is being used -// "like a tablet". This is used primarily for metrics in order to gain some -// insight into how users use Chrome. -BASE_EXPORT bool IsTabletDevice(); +// "like a tablet". This is used by the following:- +// 1. Metrics:- To gain insight into how users use Chrome. +// 2. Physical keyboard presence :- If a device is in tablet mode, it means +// that there is no physical keyboard attached. +// This function optionally sets the |reason| parameter to determine as to why +// or why not a device was deemed to be a tablet. +// Returns true if the device is in tablet mode. +BASE_EXPORT bool IsTabletDevice(std::string* reason); // A slate is a touch device that may have a keyboard attached. This function // returns true if a keyboard is attached and optionally will set the reason |