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

Unified Diff: ash/magnifier/magnification_controller.cc

Issue 13947045: Magnifier: Move the cursor directly to the root window host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | « no previous file | ui/aura/root_window.h » ('j') | ui/aura/root_window.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/magnifier/magnification_controller.cc
diff --git a/ash/magnifier/magnification_controller.cc b/ash/magnifier/magnification_controller.cc
index ba1de9ea68cacd83ae3e818984e1502404a54538..04cb8285790bd62552a8674a5107495a461ebaa1 100644
--- a/ash/magnifier/magnification_controller.cc
+++ b/ash/magnifier/magnification_controller.cc
@@ -18,6 +18,7 @@
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animation_observer.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
+#include "ui/gfx/point3_f.h"
#include "ui/gfx/point_conversions.h"
#include "ui/gfx/point_f.h"
#include "ui/gfx/rect_conversions.h"
@@ -38,6 +39,14 @@ const float kScrollScaleChangeFactor = 0.05f;
// |kPanningMergin| from the edge, the view-port moves.
const int kPanningMergin = 100;
+void MoveCursorTo(aura::RootWindow* root_window,
+ const gfx::Point root_location) {
+ gfx::Point3F host_location_3f(root_location);
+ root_window->layer()->transform().TransformPoint(host_location_3f);
+ root_window->MoveCursorToInHost(
+ gfx::ToCeiledPoint(host_location_3f.AsPointF()));
+}
+
} // namespace
namespace ash {
@@ -358,7 +367,7 @@ void MagnificationControllerImpl::OnMouseMove(const gfx::Point& location) {
if (ret) {
// If the magnified region is moved, hides the mouse cursor and moves it.
if (x_diff != 0 || y_diff != 0)
- root_window_->MoveCursorTo(mouse);
+ MoveCursorTo(root_window_, mouse);
}
}
}
@@ -418,7 +427,7 @@ void MagnificationControllerImpl::OnImplicitAnimationsCompleted() {
return;
if (move_cursor_after_animation_) {
- root_window_->MoveCursorTo(position_after_animation_);
+ MoveCursorTo(root_window_, position_after_animation_);
move_cursor_after_animation_ = false;
aura::client::CursorClient* cursor_client =
« no previous file with comments | « no previous file | ui/aura/root_window.h » ('j') | ui/aura/root_window.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698