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

Unified Diff: Source/platform/PlatformKeyboardEvent.cpp

Issue 1177043016: [SP] Add a drawing recorder before painting caps lock indicator in password fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Need to rebaseline new tests under virtual/antialiasedtext as well. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/PlatformKeyboardEvent.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/PlatformKeyboardEvent.cpp
diff --git a/Source/platform/PlatformKeyboardEvent.cpp b/Source/platform/PlatformKeyboardEvent.cpp
index c784428de3b6166c2a31ea8a8024c0b774488c5a..8639a4edb7e647deae3e3ccd47a61a4995f5b571 100644
--- a/Source/platform/PlatformKeyboardEvent.cpp
+++ b/Source/platform/PlatformKeyboardEvent.cpp
@@ -41,6 +41,9 @@ namespace blink {
static const unsigned short HIGHBITMASKSHORT = 0x8000;
#endif
+PlatformKeyboardEvent::OverrideCapsLockState PlatformKeyboardEvent::s_overrideCapsLockState =
+ PlatformKeyboardEvent::OverrideCapsLockState::Default;
+
void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type)
{
#if OS(WIN)
@@ -73,15 +76,23 @@ void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type)
bool PlatformKeyboardEvent::currentCapsLockState()
{
+ switch (s_overrideCapsLockState) {
+ case OverrideCapsLockState::Default:
#if OS(WIN)
- // FIXME: Does this even work inside the sandbox?
- return GetKeyState(VK_CAPITAL) & 1;
+ // FIXME: Does this even work inside the sandbox?
+ return GetKeyState(VK_CAPITAL) & 1;
#elif OS(MACOSX)
- return GetCurrentKeyModifiers() & alphaLock;
+ return GetCurrentKeyModifiers() & alphaLock;
#else
- notImplemented();
- return false;
+ notImplemented();
+ return false;
#endif
+ case OverrideCapsLockState::On:
+ return true;
+ case OverrideCapsLockState::Off:
+ default:
+ return false;
+ }
}
void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey)
« no previous file with comments | « Source/platform/PlatformKeyboardEvent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698