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

Side by Side Diff: ash/magnifier/magnification_controller.cc

Issue 14466005: Magnifier: Prevent the cursor jumping on HiDPI display. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase & use aura::test::EventGenerator::MoveMouseToInHost Created 7 years, 7 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 | Annotate | Revision Log
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 "ash/magnifier/magnification_controller.h" 5 #include "ash/magnifier/magnification_controller.h"
6 6
7 #include "ash/ash_root_window_transformer.h" 7 #include "ash/ash_root_window_transformer.h"
8 #include "ash/display/display_controller.h" 8 #include "ash/display/display_controller.h"
9 #include "ash/display/display_manager.h" 9 #include "ash/display/display_manager.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 26 matching lines...) Expand all
37 const float kNonMagnifiedScale = 1.0f; 37 const float kNonMagnifiedScale = 1.0f;
38 38
39 const float kInitialMagnifiedScale = 2.0f; 39 const float kInitialMagnifiedScale = 2.0f;
40 const float kScrollScaleChangeFactor = 0.05f; 40 const float kScrollScaleChangeFactor = 0.05f;
41 41
42 // Threadshold of panning. If the cursor moves to within pixels (in DIP) of 42 // Threadshold of panning. If the cursor moves to within pixels (in DIP) of
43 // |kPanningMergin| from the edge, the view-port moves. 43 // |kPanningMergin| from the edge, the view-port moves.
44 const int kPanningMergin = 100; 44 const int kPanningMergin = 100;
45 45
46 void MoveCursorTo(aura::RootWindow* root_window, 46 void MoveCursorTo(aura::RootWindow* root_window,
47 const gfx::Point root_location) { 47 const gfx::Point& root_location) {
48 gfx::Point3F host_location_3f(root_location); 48 gfx::Point3F host_location_3f(root_location);
49 root_window->layer()->transform().TransformPoint(host_location_3f); 49 root_window->GetRootTransform().TransformPoint(host_location_3f);
50 root_window->MoveCursorToHostLocation( 50 root_window->MoveCursorToHostLocation(
51 gfx::ToCeiledPoint(host_location_3f.AsPointF())); 51 gfx::ToCeiledPoint(host_location_3f.AsPointF()));
52 } 52 }
53 53
54 } // namespace 54 } // namespace
55 55
56 namespace ash { 56 namespace ash {
57 57
58 //////////////////////////////////////////////////////////////////////////////// 58 ////////////////////////////////////////////////////////////////////////////////
59 // MagnificationControllerImpl: 59 // MagnificationControllerImpl:
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 624
625 //////////////////////////////////////////////////////////////////////////////// 625 ////////////////////////////////////////////////////////////////////////////////
626 // MagnificationController: 626 // MagnificationController:
627 627
628 // static 628 // static
629 MagnificationController* MagnificationController::CreateInstance() { 629 MagnificationController* MagnificationController::CreateInstance() {
630 return new MagnificationControllerImpl(); 630 return new MagnificationControllerImpl();
631 } 631 }
632 632
633 } // namespace ash 633 } // namespace ash
OLDNEW
« no previous file with comments | « ash/ash_root_window_transformer_unittest.cc ('k') | ash/magnifier/magnification_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698