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

Unified Diff: remoting/protocol/input_event_tracker.cc

Issue 1760633003: Notify normalizing input filters on blur. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: remoting/protocol/input_event_tracker.cc
diff --git a/remoting/protocol/input_event_tracker.cc b/remoting/protocol/input_event_tracker.cc
index 60c4bfd11ebee4007d646bd6ca9b231203764c0c..c7af95bc818e8b13af99c36ca1615b3fedac0cc2 100644
--- a/remoting/protocol/input_event_tracker.cc
+++ b/remoting/protocol/input_event_tracker.cc
@@ -10,11 +10,7 @@
namespace remoting {
namespace protocol {
-InputEventTracker::InputEventTracker(InputStub* input_stub)
- : input_stub_(input_stub),
- mouse_button_state_(0) {
-}
-
+InputEventTracker::InputEventTracker() {}
InputEventTracker::~InputEventTracker() {}
bool InputEventTracker::IsKeyPressed(ui::DomCode usb_keycode) const {
@@ -26,6 +22,8 @@ int InputEventTracker::PressedKeyCount() const {
}
void InputEventTracker::ReleaseAll() {
+ DCHECK(input_stub_);
Jamie 2016/03/03 00:18:54 Note that this is different from the previous impl
+
// Release all pressed keys.
for (auto keycode : pressed_keys_) {
KeyEvent event;
@@ -91,6 +89,8 @@ void InputEventTracker::ReleaseAllIfModifiersStuck(bool alt_expected,
}
void InputEventTracker::InjectKeyEvent(const KeyEvent& event) {
+ DCHECK(input_stub_);
+
// We don't need to track the keyboard lock states of key down events.
// Pressed keys will be released with |lock_states| set to 0.
// The lock states of auto generated key up events don't matter as long as
@@ -108,10 +108,13 @@ void InputEventTracker::InjectKeyEvent(const KeyEvent& event) {
}
void InputEventTracker::InjectTextEvent(const TextEvent& event) {
+ DCHECK(input_stub_);
input_stub_->InjectTextEvent(event);
}
void InputEventTracker::InjectMouseEvent(const MouseEvent& event) {
+ DCHECK(input_stub_);
+
if (event.has_x() && event.has_y()) {
mouse_pos_ = webrtc::DesktopVector(event.x(), event.y());
}
@@ -130,6 +133,7 @@ void InputEventTracker::InjectMouseEvent(const MouseEvent& event) {
}
void InputEventTracker::InjectTouchEvent(const TouchEvent& event) {
+ DCHECK(input_stub_);
// We only need the IDs to cancel all touch points in ReleaseAll(). Other
// fields do not have to be tracked here as long as the host keeps track of
// them.
« remoting/protocol/input_event_tracker.h ('K') | « remoting/protocol/input_event_tracker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698