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

Side by Side Diff: third_party/WebKit/Source/core/input/KeyboardEventManager.cpp

Issue 2289213002: Implement Middle Click Autoscroll on all platforms not just Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename the files. Created 4 years, 3 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 unified diff | Download patch
OLDNEW
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/Element.h" 7 #include "core/dom/Element.h"
8 #include "core/editing/Editor.h" 8 #include "core/editing/Editor.h"
9 #include "core/events/KeyboardEvent.h" 9 #include "core/events/KeyboardEvent.h"
10 #include "core/html/HTMLDialogElement.h" 10 #include "core/html/HTMLDialogElement.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 82
83 WebInputEventResult KeyboardEventManager::keyEvent( 83 WebInputEventResult KeyboardEventManager::keyEvent(
84 const WebKeyboardEvent& initialKeyEvent) 84 const WebKeyboardEvent& initialKeyEvent)
85 { 85 {
86 m_frame->chromeClient().clearToolTip(); 86 m_frame->chromeClient().clearToolTip();
87 87
88 if (initialKeyEvent.windowsKeyCode == VK_CAPITAL) 88 if (initialKeyEvent.windowsKeyCode == VK_CAPITAL)
89 capsLockStateMayHaveChanged(); 89 capsLockStateMayHaveChanged();
90 90
91 #if OS(WIN) 91 #if OS(WIN)
bokan 2016/09/07 16:33:46 Should we remove this #if?
92 if (m_scrollManager->panScrollInProgress()) { 92 if (m_scrollManager->middleClickAutoscrollInProgress()) {
93 // If a key is pressed while the panScroll is in progress then we want t o stop 93 // If a key is pressed while the middleClickAutoscroll is in progress th en we want to stop
94 if (initialKeyEvent.type == WebInputEvent::KeyDown || initialKeyEvent.ty pe == WebInputEvent::RawKeyDown) 94 if (initialKeyEvent.type == WebInputEvent::KeyDown || initialKeyEvent.ty pe == WebInputEvent::RawKeyDown)
95 m_scrollManager->stopAutoscroll(); 95 m_scrollManager->stopAutoscroll();
96 96
97 // If we were in panscroll mode, we swallow the key event 97 // If we were in panscroll mode, we swallow the key event
98 return WebInputEventResult::HandledSuppressed; 98 return WebInputEventResult::HandledSuppressed;
99 } 99 }
100 #endif 100 #endif
101 101
102 // Check for cases where we are too early for events -- possible unmatched k ey up 102 // Check for cases where we are too early for events -- possible unmatched k ey up
103 // from pressing return in the location bar. 103 // from pressing return in the location bar.
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 if (currentModifiers & ::cmdKey) 358 if (currentModifiers & ::cmdKey)
359 modifiers |= WebInputEvent::MetaKey; 359 modifiers |= WebInputEvent::MetaKey;
360 #else 360 #else
361 // TODO(crbug.com/538289): Implement on other platforms. 361 // TODO(crbug.com/538289): Implement on other platforms.
362 return static_cast<WebInputEvent::Modifiers>(0); 362 return static_cast<WebInputEvent::Modifiers>(0);
363 #endif 363 #endif
364 return static_cast<WebInputEvent::Modifiers>(modifiers); 364 return static_cast<WebInputEvent::Modifiers>(modifiers);
365 } 365 }
366 366
367 } // namespace blink 367 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698