| 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_MAGNIFICATION_CONTROLLER_H_ | 5 #ifndef ASH_MAGNIFIER_MAGNIFICATION_CONTROLLER_H_ |
| 6 #define ASH_MAGNIFIER_MAGNIFICATION_CONTROLLER_H_ | 6 #define ASH_MAGNIFIER_MAGNIFICATION_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 // Creates a new MagnificationController. The caller takes ownership of the | 33 // Creates a new MagnificationController. The caller takes ownership of the |
| 34 // returned object. | 34 // returned object. |
| 35 static MagnificationController* CreateInstance(); | 35 static MagnificationController* CreateInstance(); |
| 36 | 36 |
| 37 // Enables (or disables if |enabled| is false) screen magnifier feature. | 37 // Enables (or disables if |enabled| is false) screen magnifier feature. |
| 38 virtual void SetEnabled(bool enabled) = 0; | 38 virtual void SetEnabled(bool enabled) = 0; |
| 39 | 39 |
| 40 // Returns if the screen magnifier is enabled or not. | 40 // Returns if the screen magnifier is enabled or not. |
| 41 virtual bool IsEnabled() const = 0; | 41 virtual bool IsEnabled() const = 0; |
| 42 | 42 |
| 43 // Enables or disables the feature for keeping the text input focus centered. |
| 44 virtual void SetKeepFocusCentered(bool keep_focus_centered) = 0; |
| 45 |
| 46 // Returns true if magnifier will keep the focus centered in screen for text |
| 47 // input. |
| 48 virtual bool KeepFocusCentered() const = 0; |
| 49 |
| 43 // Sets the magnification ratio. 1.0f means no magnification. | 50 // Sets the magnification ratio. 1.0f means no magnification. |
| 44 virtual void SetScale(float scale, bool animate) = 0; | 51 virtual void SetScale(float scale, bool animate) = 0; |
| 45 // Returns the current magnification ratio. | 52 // Returns the current magnification ratio. |
| 46 virtual float GetScale() const = 0; | 53 virtual float GetScale() const = 0; |
| 47 | 54 |
| 48 // Set the top-left point of the magnification window. | 55 // Set the top-left point of the magnification window. |
| 49 virtual void MoveWindow(int x, int y, bool animate) = 0; | 56 virtual void MoveWindow(int x, int y, bool animate) = 0; |
| 50 virtual void MoveWindow(const gfx::Point& point, bool animate) = 0; | 57 virtual void MoveWindow(const gfx::Point& point, bool animate) = 0; |
| 51 // Returns the current top-left point of the magnification window. | 58 // Returns the current top-left point of the magnification window. |
| 52 virtual gfx::Point GetWindowPosition() const = 0; | 59 virtual gfx::Point GetWindowPosition() const = 0; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 64 | 71 |
| 65 // Returns |point_of_interest_| in MagnificationControllerImpl. This is | 72 // Returns |point_of_interest_| in MagnificationControllerImpl. This is |
| 66 // the internal variable to stores the last mouse cursor (or last touched) | 73 // the internal variable to stores the last mouse cursor (or last touched) |
| 67 // location. This method is only for test purpose. | 74 // location. This method is only for test purpose. |
| 68 virtual gfx::Point GetPointOfInterestForTesting() = 0; | 75 virtual gfx::Point GetPointOfInterestForTesting() = 0; |
| 69 | 76 |
| 70 // Returns true if magnifier is still on animation for moving viewport. | 77 // Returns true if magnifier is still on animation for moving viewport. |
| 71 // This is only used for testing purpose. | 78 // This is only used for testing purpose. |
| 72 virtual bool IsOnAnimationForTesting() const = 0; | 79 virtual bool IsOnAnimationForTesting() const = 0; |
| 73 | 80 |
| 81 // Disables the delay for moving magnifier window in testing mode. |
| 82 virtual void DisableMoveMagnifierDelayForTesting() = 0; |
| 83 |
| 74 // Switch the magnified root window to |new_root_window|. This does following: | 84 // Switch the magnified root window to |new_root_window|. This does following: |
| 75 // - Unzoom the current root_window. | 85 // - Unzoom the current root_window. |
| 76 // - Zoom the given new root_window |new_root_window|. | 86 // - Zoom the given new root_window |new_root_window|. |
| 77 // - Switch the target window from current window to |new_root_window|. | 87 // - Switch the target window from current window to |new_root_window|. |
| 78 virtual void SwitchTargetRootWindow(aura::Window* new_root_window, | 88 virtual void SwitchTargetRootWindow(aura::Window* new_root_window, |
| 79 bool redraw_original_root) = 0; | 89 bool redraw_original_root) = 0; |
| 80 | 90 |
| 81 protected: | 91 protected: |
| 82 MagnificationController() {} | 92 MagnificationController() {} |
| 83 | 93 |
| 84 private: | 94 private: |
| 85 DISALLOW_COPY_AND_ASSIGN(MagnificationController); | 95 DISALLOW_COPY_AND_ASSIGN(MagnificationController); |
| 86 }; | 96 }; |
| 87 | 97 |
| 88 } // namespace ash | 98 } // namespace ash |
| 89 | 99 |
| 90 #endif // ASH_MAGNIFIER_MAGNIFICATION_CONTROLLER_H_ | 100 #endif // ASH_MAGNIFIER_MAGNIFICATION_CONTROLLER_H_ |
| OLD | NEW |