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/display/root_window_transformers.h" | 7 #include "ash/display/root_window_transformers.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_delegate.h" | 9 #include "ash/shell_delegate.h" |
10 #include "ash/system/tray/system_tray_delegate.h" | 10 #include "ash/system/tray/system_tray_delegate.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 const float kInitialMagnifiedScale = 2.0f; | 37 const float kInitialMagnifiedScale = 2.0f; |
38 const float kScrollScaleChangeFactor = 0.05f; | 38 const float kScrollScaleChangeFactor = 0.05f; |
39 | 39 |
40 // Threadshold of panning. If the cursor moves to within pixels (in DIP) of | 40 // Threadshold of panning. If the cursor moves to within pixels (in DIP) of |
41 // |kPanningMergin| from the edge, the view-port moves. | 41 // |kPanningMergin| from the edge, the view-port moves. |
42 const int kPanningMergin = 100; | 42 const int kPanningMergin = 100; |
43 | 43 |
44 void MoveCursorTo(aura::RootWindow* root_window, | 44 void MoveCursorTo(aura::RootWindow* root_window, |
45 const gfx::Point& root_location) { | 45 const gfx::Point& root_location) { |
46 gfx::Point3F host_location_3f(root_location); | 46 gfx::Point3F host_location_3f(root_location); |
47 root_window->GetRootTransform().TransformPoint(host_location_3f); | 47 root_window->GetRootTransform().TransformPoint(&host_location_3f); |
48 root_window->MoveCursorToHostLocation( | 48 root_window->MoveCursorToHostLocation( |
49 gfx::ToCeiledPoint(host_location_3f.AsPointF())); | 49 gfx::ToCeiledPoint(host_location_3f.AsPointF())); |
50 } | 50 } |
51 | 51 |
52 } // namespace | 52 } // namespace |
53 | 53 |
54 namespace ash { | 54 namespace ash { |
55 | 55 |
56 //////////////////////////////////////////////////////////////////////////////// | 56 //////////////////////////////////////////////////////////////////////////////// |
57 // MagnificationControllerImpl: | 57 // MagnificationControllerImpl: |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 | 622 |
623 //////////////////////////////////////////////////////////////////////////////// | 623 //////////////////////////////////////////////////////////////////////////////// |
624 // MagnificationController: | 624 // MagnificationController: |
625 | 625 |
626 // static | 626 // static |
627 MagnificationController* MagnificationController::CreateInstance() { | 627 MagnificationController* MagnificationController::CreateInstance() { |
628 return new MagnificationControllerImpl(); | 628 return new MagnificationControllerImpl(); |
629 } | 629 } |
630 | 630 |
631 } // namespace ash | 631 } // namespace ash |
OLD | NEW |