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 <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "ash/common/accelerators/accelerator_controller.h" | 10 #include "ash/common/accelerators/accelerator_controller.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // |kCursorPanningMargin| from the edge, the view-port moves. | 67 // |kCursorPanningMargin| from the edge, the view-port moves. |
68 const int kCursorPanningMargin = 100; | 68 const int kCursorPanningMargin = 100; |
69 | 69 |
70 // Threadshold of panning. If the caret moves to within pixels (in DIP) of | 70 // Threadshold of panning. If the caret moves to within pixels (in DIP) of |
71 // |kCaretPanningMargin| from the edge, the view-port moves. | 71 // |kCaretPanningMargin| from the edge, the view-port moves. |
72 const int kCaretPanningMargin = 50; | 72 const int kCaretPanningMargin = 50; |
73 | 73 |
74 void MoveCursorTo(aura::WindowTreeHost* host, const gfx::Point& root_location) { | 74 void MoveCursorTo(aura::WindowTreeHost* host, const gfx::Point& root_location) { |
75 auto host_location_3f = gfx::Point3F(gfx::PointF(root_location)); | 75 auto host_location_3f = gfx::Point3F(gfx::PointF(root_location)); |
76 host->GetRootTransform().TransformPoint(&host_location_3f); | 76 host->GetRootTransform().TransformPoint(&host_location_3f); |
77 host->MoveCursorToHostLocation( | 77 host->MoveCursorToLocationInPixels( |
78 gfx::ToCeiledPoint(host_location_3f.AsPointF())); | 78 gfx::ToCeiledPoint(host_location_3f.AsPointF())); |
79 } | 79 } |
80 | 80 |
81 ui::InputMethod* GetInputMethod(aura::Window* root_window) { | 81 ui::InputMethod* GetInputMethod(aura::Window* root_window) { |
82 if (root_window->GetHost()) | 82 if (root_window->GetHost()) |
83 return root_window->GetHost()->GetInputMethod(); | 83 return root_window->GetHost()->GetInputMethod(); |
84 return nullptr; | 84 return nullptr; |
85 } | 85 } |
86 | 86 |
87 } // namespace | 87 } // namespace |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 | 849 |
850 //////////////////////////////////////////////////////////////////////////////// | 850 //////////////////////////////////////////////////////////////////////////////// |
851 // MagnificationController: | 851 // MagnificationController: |
852 | 852 |
853 // static | 853 // static |
854 MagnificationController* MagnificationController::CreateInstance() { | 854 MagnificationController* MagnificationController::CreateInstance() { |
855 return new MagnificationControllerImpl(); | 855 return new MagnificationControllerImpl(); |
856 } | 856 } |
857 | 857 |
858 } // namespace ash | 858 } // namespace ash |
OLD | NEW |