OLD | NEW |
---|---|
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 25 matching lines...) Expand all Loading... | |
36 const float kNonMagnifiedScale = 1.0f; | 36 const float kNonMagnifiedScale = 1.0f; |
37 | 37 |
38 const float kInitialMagnifiedScale = 2.0f; | 38 const float kInitialMagnifiedScale = 2.0f; |
39 const float kScrollScaleChangeFactor = 0.05f; | 39 const float kScrollScaleChangeFactor = 0.05f; |
40 | 40 |
41 // Threadshold of panning. If the cursor moves to within pixels (in DIP) of | 41 // Threadshold of panning. If the cursor moves to within pixels (in DIP) of |
42 // |kPanningMergin| from the edge, the view-port moves. | 42 // |kPanningMergin| from the edge, the view-port moves. |
43 const int kPanningMergin = 100; | 43 const int kPanningMergin = 100; |
44 | 44 |
45 void MoveCursorTo(aura::RootWindow* root_window, | 45 void MoveCursorTo(aura::RootWindow* root_window, |
46 const gfx::Point root_location) { | 46 const gfx::Point& root_location) { |
47 gfx::Point3F host_location_3f(root_location); | 47 gfx::Point3F host_location_3f(root_location); |
48 root_window->layer()->transform().TransformPoint(host_location_3f); | 48 root_window->GetRootTransform().TransformPoint(host_location_3f); |
49 root_window->MoveCursorToHostLoation( | 49 root_window->MoveCursorToHostLoation( |
50 gfx::ToCeiledPoint(host_location_3f.AsPointF())); | 50 gfx::ToCeiledPoint(host_location_3f.AsPointF())); |
oshima
2013/04/30 23:03:07
We have this rounding issue because we're converti
| |
51 } | 51 } |
52 | 52 |
53 } // namespace | 53 } // namespace |
54 | 54 |
55 namespace ash { | 55 namespace ash { |
56 | 56 |
57 //////////////////////////////////////////////////////////////////////////////// | 57 //////////////////////////////////////////////////////////////////////////////// |
58 // MagnificationControllerImpl: | 58 // MagnificationControllerImpl: |
59 | 59 |
60 class MagnificationControllerImpl : virtual public MagnificationController, | 60 class MagnificationControllerImpl : virtual public MagnificationController, |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
619 | 619 |
620 //////////////////////////////////////////////////////////////////////////////// | 620 //////////////////////////////////////////////////////////////////////////////// |
621 // MagnificationController: | 621 // MagnificationController: |
622 | 622 |
623 // static | 623 // static |
624 MagnificationController* MagnificationController::CreateInstance() { | 624 MagnificationController* MagnificationController::CreateInstance() { |
625 return new MagnificationControllerImpl(); | 625 return new MagnificationControllerImpl(); |
626 } | 626 } |
627 | 627 |
628 } // namespace ash | 628 } // namespace ash |
OLD | NEW |