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

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 wez's feedback 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
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..b31f9e113b5dfce8f606b64d0fb7e9a0b47828a7 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/pixel_rotator.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_;
+ // Rotate the local mouse positions appropriately based on the current
Wez 2014/12/06 01:55:17 nit: Used to rotate... Here and elsewhere, does i
kelvinp 2014/12/08 18:41:44 Done. No, it doesn't translate AFAIK.
+ // display rotation settings.
+ scoped_ptr<PixelRotator> rotator_;
+
DISALLOW_COPY_AND_ASSIGN(Core);
};
@@ -86,6 +91,7 @@ LocalInputMonitorChromeos::Core::Core(
void LocalInputMonitorChromeos::Core::Start() {
ui::PlatformEventSource::GetInstance()->AddPlatformEventObserver(this);
+ rotator_.reset(new PixelRotator());
}
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 = rotator_->FromScreenPixel(mouse_position);
+
caller_task_runner_->PostTask(
FROM_HERE,
base::Bind(

Powered by Google App Engine
This is Rietveld 408576698