| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "KeyboardEventManager.h" | 5 #include "KeyboardEventManager.h" |
| 6 | 6 |
| 7 #include "core/dom/DocumentUserGestureToken.h" | 7 #include "core/dom/DocumentUserGestureToken.h" |
| 8 #include "core/dom/Element.h" | 8 #include "core/dom/Element.h" |
| 9 #include "core/editing/Editor.h" | 9 #include "core/editing/Editor.h" |
| 10 #include "core/events/KeyboardEvent.h" | 10 #include "core/events/KeyboardEvent.h" |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 | 430 |
| 431 bool KeyboardEventManager::currentCapsLockState() { | 431 bool KeyboardEventManager::currentCapsLockState() { |
| 432 switch (s_overrideCapsLockState) { | 432 switch (s_overrideCapsLockState) { |
| 433 case OverrideCapsLockState::Default: | 433 case OverrideCapsLockState::Default: |
| 434 #if OS(WIN) | 434 #if OS(WIN) |
| 435 // FIXME: Does this even work inside the sandbox? | 435 // FIXME: Does this even work inside the sandbox? |
| 436 return GetKeyState(VK_CAPITAL) & 1; | 436 return GetKeyState(VK_CAPITAL) & 1; |
| 437 #elif OS(MACOSX) | 437 #elif OS(MACOSX) |
| 438 return GetCurrentKeyModifiers() & alphaLock; | 438 return GetCurrentKeyModifiers() & alphaLock; |
| 439 #else | 439 #else |
| 440 NOTIMPLEMENTED(); | 440 // Caps lock state use is limited to Mac password input |
| 441 // fields, so just return false. See http://crbug.com/618739. |
| 441 return false; | 442 return false; |
| 442 #endif | 443 #endif |
| 443 case OverrideCapsLockState::On: | 444 case OverrideCapsLockState::On: |
| 444 return true; | 445 return true; |
| 445 case OverrideCapsLockState::Off: | 446 case OverrideCapsLockState::Off: |
| 446 default: | 447 default: |
| 447 return false; | 448 return false; |
| 448 } | 449 } |
| 449 } | 450 } |
| 450 | 451 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 468 if (currentModifiers & ::cmdKey) | 469 if (currentModifiers & ::cmdKey) |
| 469 modifiers |= WebInputEvent::MetaKey; | 470 modifiers |= WebInputEvent::MetaKey; |
| 470 #else | 471 #else |
| 471 // TODO(crbug.com/538289): Implement on other platforms. | 472 // TODO(crbug.com/538289): Implement on other platforms. |
| 472 return static_cast<WebInputEvent::Modifiers>(0); | 473 return static_cast<WebInputEvent::Modifiers>(0); |
| 473 #endif | 474 #endif |
| 474 return static_cast<WebInputEvent::Modifiers>(modifiers); | 475 return static_cast<WebInputEvent::Modifiers>(modifiers); |
| 475 } | 476 } |
| 476 | 477 |
| 477 } // namespace blink | 478 } // namespace blink |
| OLD | NEW |