| 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/point.h" | 10 #include "ui/gfx/point.h" |
| 11 #include "ui/views/widget/widget_observer.h" | 11 #include "ui/views/widget/widget_observer.h" |
| 12 | 12 |
| 13 namespace aura { |
| 14 class RootWindow; |
| 15 } |
| 16 |
| 13 namespace ash { | 17 namespace ash { |
| 14 | 18 |
| 15 const float kDefaultPartialMagnifiedScale = 1.5f; | 19 const float kDefaultPartialMagnifiedScale = 1.5f; |
| 16 const float kNonPartialMagnifiedScale = 1.0f; | 20 const float kNonPartialMagnifiedScale = 1.0f; |
| 17 | 21 |
| 18 // Controls the partial screen magnifier, which is a small area of the screen | 22 // Controls the partial screen magnifier, which is a small area of the screen |
| 19 // which is zoomed in. The zoomed area follows the mouse cursor when enabled. | 23 // which is zoomed in. The zoomed area follows the mouse cursor when enabled. |
| 20 class PartialMagnificationController | 24 class PartialMagnificationController |
| 21 : public ui::EventHandler, | 25 : public ui::EventHandler, |
| 22 public aura::WindowObserver, | 26 public aura::WindowObserver, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 41 void OnMouseMove(const gfx::Point& location_in_root); | 45 void OnMouseMove(const gfx::Point& location_in_root); |
| 42 | 46 |
| 43 // Switch PartialMagnified RootWindow to |new_root_window|. This does | 47 // Switch PartialMagnified RootWindow to |new_root_window|. This does |
| 44 // following: | 48 // following: |
| 45 // - Remove the magnifier from the current root window. | 49 // - Remove the magnifier from the current root window. |
| 46 // - Create a magnifier in the new root_window |new_root_window|. | 50 // - Create a magnifier in the new root_window |new_root_window|. |
| 47 // - Switch the target window from current window to |new_root_window|. | 51 // - Switch the target window from current window to |new_root_window|. |
| 48 void SwitchTargetRootWindow(aura::Window* new_root_window); | 52 void SwitchTargetRootWindow(aura::Window* new_root_window); |
| 49 | 53 |
| 50 // Returns the root window that contains the mouse cursor. | 54 // Returns the root window that contains the mouse cursor. |
| 51 aura::Window* GetCurrentRootWindow(); | 55 aura::RootWindow* GetCurrentRootWindow(); |
| 52 | 56 |
| 53 // Return true if the magnification scale > kMinPartialMagnifiedScaleThreshold | 57 // Return true if the magnification scale > kMinPartialMagnifiedScaleThreshold |
| 54 bool IsPartialMagnified() const; | 58 bool IsPartialMagnified() const; |
| 55 | 59 |
| 56 // Create the magnifier window. | 60 // Create the magnifier window. |
| 57 void CreateMagnifierWindow(); | 61 void CreateMagnifierWindow(); |
| 58 | 62 |
| 59 // Cleans up the window if needed. | 63 // Cleans up the window if needed. |
| 60 void CloseMagnifierWindow(); | 64 void CloseMagnifierWindow(); |
| 61 | 65 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 82 gfx::Point origin_; | 86 gfx::Point origin_; |
| 83 | 87 |
| 84 views::Widget* zoom_widget_; | 88 views::Widget* zoom_widget_; |
| 85 | 89 |
| 86 DISALLOW_COPY_AND_ASSIGN(PartialMagnificationController); | 90 DISALLOW_COPY_AND_ASSIGN(PartialMagnificationController); |
| 87 }; | 91 }; |
| 88 | 92 |
| 89 } // namespace ash | 93 } // namespace ash |
| 90 | 94 |
| 91 #endif // ASH_MAGNIFIER_PARTIAL_MAGNIFICATION_CONTROLLER_H_ | 95 #endif // ASH_MAGNIFIER_PARTIAL_MAGNIFICATION_CONTROLLER_H_ |
| OLD | NEW |