Chromium Code Reviews| 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 // Note that the caps lock state provided by this method is only |
|
wkorman
2017/03/15 00:03:14
Two alternatives to this patch:
1. modify LayoutT
dtapuska
2017/03/15 00:11:04
this lgtm. This NOTIMPLEMENTED use to be a no-op b
| |
| 441 // used to paint a caps lock icon for Mac password input fields. | |
| 442 // We may as well just return false if we end up here. Calling | |
| 443 // NOTIMPLEMENTED() just produces a verbose debug stack trace | |
| 444 // whenever an event is forwarded to a | |
| 445 // LayoutTextControlSingleLine on platforms lacking an | |
| 446 // implementation, such as CrOS, which isn't helpful as we have | |
| 447 // no current plans or need to use this. | |
|
stevenjb
2017/03/15 01:25:33
This is helpful, but maybe a little bit verbose :)
wkorman
2017/03/15 08:18:53
Done.
| |
| 441 return false; | 448 return false; |
| 442 #endif | 449 #endif |
| 443 case OverrideCapsLockState::On: | 450 case OverrideCapsLockState::On: |
| 444 return true; | 451 return true; |
| 445 case OverrideCapsLockState::Off: | 452 case OverrideCapsLockState::Off: |
| 446 default: | 453 default: |
| 447 return false; | 454 return false; |
| 448 } | 455 } |
| 449 } | 456 } |
| 450 | 457 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 468 if (currentModifiers & ::cmdKey) | 475 if (currentModifiers & ::cmdKey) |
| 469 modifiers |= WebInputEvent::MetaKey; | 476 modifiers |= WebInputEvent::MetaKey; |
| 470 #else | 477 #else |
| 471 // TODO(crbug.com/538289): Implement on other platforms. | 478 // TODO(crbug.com/538289): Implement on other platforms. |
| 472 return static_cast<WebInputEvent::Modifiers>(0); | 479 return static_cast<WebInputEvent::Modifiers>(0); |
| 473 #endif | 480 #endif |
| 474 return static_cast<WebInputEvent::Modifiers>(modifiers); | 481 return static_cast<WebInputEvent::Modifiers>(modifiers); |
| 475 } | 482 } |
| 476 | 483 |
| 477 } // namespace blink | 484 } // namespace blink |
| OLD | NEW |