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

Side by Side Diff: remoting/host/remote_input_filter.cc

Issue 799233004: Add touch events to the protocol, the stub layer, and to the client plugin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 5 years, 9 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
« no previous file with comments | « remoting/host/remote_input_filter.h ('k') | remoting/host/single_window_input_injector_mac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "remoting/host/remote_input_filter.h" 5 #include "remoting/host/remote_input_filter.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "remoting/proto/event.pb.h" 8 #include "remoting/proto/event.pb.h"
9 9
10 namespace { 10 namespace {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 injected_mouse_positions_.push_back( 88 injected_mouse_positions_.push_back(
89 webrtc::DesktopVector(event.x(), event.y())); 89 webrtc::DesktopVector(event.x(), event.y()));
90 if (injected_mouse_positions_.size() > kNumRemoteMousePositions) { 90 if (injected_mouse_positions_.size() > kNumRemoteMousePositions) {
91 VLOG(1) << "Injected mouse positions queue full."; 91 VLOG(1) << "Injected mouse positions queue full.";
92 injected_mouse_positions_.pop_front(); 92 injected_mouse_positions_.pop_front();
93 } 93 }
94 } 94 }
95 event_tracker_->InjectMouseEvent(event); 95 event_tracker_->InjectMouseEvent(event);
96 } 96 }
97 97
98 void RemoteInputFilter::InjectTouchEvent(const protocol::TouchEvent& event) {
99 if (ShouldIgnoreInput())
100 return;
101 event_tracker_->InjectTouchEvent(event);
102 }
103
98 bool RemoteInputFilter::ShouldIgnoreInput() const { 104 bool RemoteInputFilter::ShouldIgnoreInput() const {
99 // Ignore remote events if the local mouse moved recently. 105 // Ignore remote events if the local mouse moved recently.
100 int64 millis = 106 int64 millis =
101 (base::TimeTicks::Now() - latest_local_input_time_).InMilliseconds(); 107 (base::TimeTicks::Now() - latest_local_input_time_).InMilliseconds();
102 if (millis < kRemoteBlockTimeoutMillis) 108 if (millis < kRemoteBlockTimeoutMillis)
103 return true; 109 return true;
104 return false; 110 return false;
105 } 111 }
106 112
107 } // namespace remoting 113 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/remote_input_filter.h ('k') | remoting/host/single_window_input_injector_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698