| 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "core/dom/Element.h" | 9 #include "core/dom/Element.h" |
| 10 #include "core/dom/UserGestureIndicator.h" | 10 #include "core/dom/UserGestureIndicator.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 170 |
| 171 if (initial_key_event.windows_key_code == VK_CAPITAL) | 171 if (initial_key_event.windows_key_code == VK_CAPITAL) |
| 172 CapsLockStateMayHaveChanged(); | 172 CapsLockStateMayHaveChanged(); |
| 173 | 173 |
| 174 if (scroll_manager_->MiddleClickAutoscrollInProgress()) { | 174 if (scroll_manager_->MiddleClickAutoscrollInProgress()) { |
| 175 DCHECK(RuntimeEnabledFeatures::MiddleClickAutoscrollEnabled()); | 175 DCHECK(RuntimeEnabledFeatures::MiddleClickAutoscrollEnabled()); |
| 176 // If a key is pressed while the middleClickAutoscroll is in progress then | 176 // If a key is pressed while the middleClickAutoscroll is in progress then |
| 177 // we want to stop. | 177 // we want to stop. |
| 178 if (initial_key_event.GetType() == WebInputEvent::kKeyDown || | 178 if (initial_key_event.GetType() == WebInputEvent::kKeyDown || |
| 179 initial_key_event.GetType() == WebInputEvent::kRawKeyDown) | 179 initial_key_event.GetType() == WebInputEvent::kRawKeyDown) |
| 180 scroll_manager_->StopAutoscroll(); | 180 scroll_manager_->StopMiddleClickAutoscroll(); |
| 181 | 181 |
| 182 // If we were in panscroll mode, we swallow the key event | 182 // If we were in panscroll mode, we swallow the key event |
| 183 return WebInputEventResult::kHandledSuppressed; | 183 return WebInputEventResult::kHandledSuppressed; |
| 184 } | 184 } |
| 185 | 185 |
| 186 // Check for cases where we are too early for events -- possible unmatched key | 186 // Check for cases where we are too early for events -- possible unmatched key |
| 187 // up from pressing return in the location bar. | 187 // up from pressing return in the location bar. |
| 188 Node* node = EventTargetNodeForDocument(frame_->GetDocument()); | 188 Node* node = EventTargetNodeForDocument(frame_->GetDocument()); |
| 189 if (!node) | 189 if (!node) |
| 190 return WebInputEventResult::kNotHandled; | 190 return WebInputEventResult::kNotHandled; |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 if (current_modifiers & ::cmdKey) | 486 if (current_modifiers & ::cmdKey) |
| 487 modifiers |= WebInputEvent::kMetaKey; | 487 modifiers |= WebInputEvent::kMetaKey; |
| 488 #else | 488 #else |
| 489 // TODO(crbug.com/538289): Implement on other platforms. | 489 // TODO(crbug.com/538289): Implement on other platforms. |
| 490 return static_cast<WebInputEvent::Modifiers>(0); | 490 return static_cast<WebInputEvent::Modifiers>(0); |
| 491 #endif | 491 #endif |
| 492 return static_cast<WebInputEvent::Modifiers>(modifiers); | 492 return static_cast<WebInputEvent::Modifiers>(modifiers); |
| 493 } | 493 } |
| 494 | 494 |
| 495 } // namespace blink | 495 } // namespace blink |
| OLD | NEW |