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

Unified Diff: remoting/host/local_input_monitor_chromeos.cc

Issue 756643006: Remote assistance on Chrome OS Part IX - Input injection on Ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Ozone_input_injection
Patch Set: Address feedback (wez) Created 6 years 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/host/input_injector_x11.cc ('k') | remoting/remoting_host.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/local_input_monitor_chromeos.cc
diff --git a/remoting/host/local_input_monitor_chromeos.cc b/remoting/host/local_input_monitor_chromeos.cc
index abd76515caa96cc13c9ae90f9a1509a67f0bd3e1..4c9e6932bd9c8c5d61a7eef1ce498048c77f90dd 100644
--- a/remoting/host/local_input_monitor_chromeos.cc
+++ b/remoting/host/local_input_monitor_chromeos.cc
@@ -9,6 +9,7 @@
#include "base/location.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/non_thread_safe.h"
+#include "remoting/host/chromeos/point_transformer.h"
#include "remoting/host/client_session_control.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
#include "ui/events/event.h"
@@ -52,6 +53,10 @@ class LocalInputMonitorChromeos : public LocalInputMonitor {
// disconnect requests. Must be called on the |caller_task_runner_|.
base::WeakPtr<ClientSessionControl> client_session_control_;
+ // Used to rotate the local mouse positions appropriately based on the
+ // current display rotation settings.
+ scoped_ptr<PointTransformer> point_transformer_;
+
DISALLOW_COPY_AND_ASSIGN(Core);
};
@@ -86,6 +91,7 @@ LocalInputMonitorChromeos::Core::Core(
void LocalInputMonitorChromeos::Core::Start() {
ui::PlatformEventSource::GetInstance()->AddPlatformEventObserver(this);
+ point_transformer_.reset(new PointTransformer());
}
LocalInputMonitorChromeos::Core::~Core() {
@@ -109,7 +115,9 @@ void LocalInputMonitorChromeos::Core::DidProcessEvent(
void LocalInputMonitorChromeos::Core::HandleMouseMove(
const ui::PlatformEvent& event) {
- gfx::Point mouse_position = ui::EventLocationFromNative(event);
+ gfx::PointF mouse_position = ui::EventLocationFromNative(event);
+ mouse_position = point_transformer_->FromScreenCoordinates(mouse_position);
+
caller_task_runner_->PostTask(
FROM_HERE,
base::Bind(
« no previous file with comments | « remoting/host/input_injector_x11.cc ('k') | remoting/remoting_host.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698