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

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: Fix host build. 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
« no previous file with comments | « remoting/protocol/input_event_tracker.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c232c013f96c87f07e1c0321b4f5fde3ec249559 100644
--- a/remoting/protocol/input_event_tracker.cc
+++ b/remoting/protocol/input_event_tracker.cc
@@ -10,9 +10,10 @@
namespace remoting {
namespace protocol {
+InputEventTracker::InputEventTracker() {}
+
InputEventTracker::InputEventTracker(InputStub* input_stub)
- : input_stub_(input_stub),
- mouse_button_state_(0) {
+ : input_stub_(input_stub) {
}
InputEventTracker::~InputEventTracker() {}
@@ -26,6 +27,8 @@ int InputEventTracker::PressedKeyCount() const {
}
void InputEventTracker::ReleaseAll() {
+ DCHECK(input_stub_);
+
// Release all pressed keys.
for (auto keycode : pressed_keys_) {
KeyEvent event;
@@ -91,6 +94,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 +113,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 +138,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.
« no previous file with comments | « remoting/protocol/input_event_tracker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698