| 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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 return; | 389 return; |
| 390 | 390 |
| 391 WebFocusType focusType = | 391 WebFocusType focusType = |
| 392 event->shiftKey() ? WebFocusTypeBackward : WebFocusTypeForward; | 392 event->shiftKey() ? WebFocusTypeBackward : WebFocusTypeForward; |
| 393 | 393 |
| 394 // Tabs can be used in design mode editing. | 394 // Tabs can be used in design mode editing. |
| 395 if (m_frame->document()->inDesignMode()) | 395 if (m_frame->document()->inDesignMode()) |
| 396 return; | 396 return; |
| 397 | 397 |
| 398 if (page->focusController().advanceFocus(focusType, | 398 if (page->focusController().advanceFocus(focusType, |
| 399 m_frame->document() | 399 InputDeviceCapabilities::None)) |
| 400 ->domWindow() | |
| 401 ->getInputDeviceCapabilities() | |
| 402 ->firesTouchEvents(false))) | |
| 403 event->setDefaultHandled(); | 400 event->setDefaultHandled(); |
| 404 } | 401 } |
| 405 | 402 |
| 406 void KeyboardEventManager::defaultEscapeEventHandler(KeyboardEvent* event) { | 403 void KeyboardEventManager::defaultEscapeEventHandler(KeyboardEvent* event) { |
| 407 if (HTMLDialogElement* dialog = m_frame->document()->activeModalDialog()) | 404 if (HTMLDialogElement* dialog = m_frame->document()->activeModalDialog()) |
| 408 dialog->dispatchEvent(Event::createCancelable(EventTypeNames::cancel)); | 405 dialog->dispatchEvent(Event::createCancelable(EventTypeNames::cancel)); |
| 409 } | 406 } |
| 410 | 407 |
| 411 static OverrideCapsLockState s_overrideCapsLockState; | 408 static OverrideCapsLockState s_overrideCapsLockState; |
| 412 | 409 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 if (currentModifiers & ::cmdKey) | 452 if (currentModifiers & ::cmdKey) |
| 456 modifiers |= WebInputEvent::MetaKey; | 453 modifiers |= WebInputEvent::MetaKey; |
| 457 #else | 454 #else |
| 458 // TODO(crbug.com/538289): Implement on other platforms. | 455 // TODO(crbug.com/538289): Implement on other platforms. |
| 459 return static_cast<WebInputEvent::Modifiers>(0); | 456 return static_cast<WebInputEvent::Modifiers>(0); |
| 460 #endif | 457 #endif |
| 461 return static_cast<WebInputEvent::Modifiers>(modifiers); | 458 return static_cast<WebInputEvent::Modifiers>(modifiers); |
| 462 } | 459 } |
| 463 | 460 |
| 464 } // namespace blink | 461 } // namespace blink |
| OLD | NEW |