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 #ifndef ASH_MAGNIFIER_PARTIAL_MAGNIFICATION_CONTROLLER_H_ | 5 #ifndef ASH_MAGNIFIER_PARTIAL_MAGNIFICATION_CONTROLLER_H_ |
6 #define ASH_MAGNIFIER_PARTIAL_MAGNIFICATION_CONTROLLER_H_ | 6 #define ASH_MAGNIFIER_PARTIAL_MAGNIFICATION_CONTROLLER_H_ |
7 | 7 |
8 #include "ui/aura/window_observer.h" | 8 #include "ui/aura/window_observer.h" |
9 #include "ui/events/event_handler.h" | 9 #include "ui/events/event_handler.h" |
10 #include "ui/gfx/geometry/point.h" | 10 #include "ui/gfx/geometry/point.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 virtual void SetEnabled(bool enabled); | 30 virtual void SetEnabled(bool enabled); |
31 | 31 |
32 bool is_enabled() const { return is_enabled_; } | 32 bool is_enabled() const { return is_enabled_; } |
33 | 33 |
34 // Sets the magnification ratio. 1.0f means no magnification. | 34 // Sets the magnification ratio. 1.0f means no magnification. |
35 void SetScale(float scale); | 35 void SetScale(float scale); |
36 | 36 |
37 // Returns the current magnification ratio. | 37 // Returns the current magnification ratio. |
38 float GetScale() const { return scale_; } | 38 float GetScale() const { return scale_; } |
39 | 39 |
40 private: | |
41 void OnMouseMove(const gfx::Point& location_in_root); | |
42 | |
43 // Switch PartialMagnified RootWindow to |new_root_window|. This does | 40 // Switch PartialMagnified RootWindow to |new_root_window|. This does |
44 // following: | 41 // following: |
45 // - Remove the magnifier from the current root window. | 42 // - Remove the magnifier from the current root window. |
46 // - Create a magnifier in the new root_window |new_root_window|. | 43 // - Create a magnifier in the new root_window |new_root_window|. |
47 // - Switch the target window from current window to |new_root_window|. | 44 // - Switch the target window from current window to |new_root_window|. |
48 void SwitchTargetRootWindow(aura::Window* new_root_window); | 45 void SwitchTargetRootWindow(aura::Window* new_root_window); |
49 | 46 |
| 47 private: |
| 48 void OnMouseMove(const gfx::Point& location_in_root); |
| 49 |
50 // Returns the root window that contains the mouse cursor. | 50 // Returns the root window that contains the mouse cursor. |
51 aura::Window* GetCurrentRootWindow(); | 51 aura::Window* GetCurrentRootWindow(); |
52 | 52 |
53 // Return true if the magnification scale > kMinPartialMagnifiedScaleThreshold | 53 // Return true if the magnification scale > kMinPartialMagnifiedScaleThreshold |
54 bool IsPartialMagnified() const; | 54 bool IsPartialMagnified() const; |
55 | 55 |
56 // Create the magnifier window. | 56 // Create the magnifier window. |
57 void CreateMagnifierWindow(); | 57 void CreateMagnifierWindow(); |
58 | 58 |
59 // Cleans up the window if needed. | 59 // Cleans up the window if needed. |
(...skipping 18 matching lines...) Expand all Loading... |
78 gfx::Point origin_; | 78 gfx::Point origin_; |
79 | 79 |
80 views::Widget* zoom_widget_; | 80 views::Widget* zoom_widget_; |
81 | 81 |
82 DISALLOW_COPY_AND_ASSIGN(PartialMagnificationController); | 82 DISALLOW_COPY_AND_ASSIGN(PartialMagnificationController); |
83 }; | 83 }; |
84 | 84 |
85 } // namespace ash | 85 } // namespace ash |
86 | 86 |
87 #endif // ASH_MAGNIFIER_PARTIAL_MAGNIFICATION_CONTROLLER_H_ | 87 #endif // ASH_MAGNIFIER_PARTIAL_MAGNIFICATION_CONTROLLER_H_ |
OLD | NEW |