Chromium Code Reviews| Index: ash/magnifier/magnification_controller.h |
| diff --git a/ash/magnifier/magnification_controller.h b/ash/magnifier/magnification_controller.h |
| index 75d1b2f8f3d78283f77ccdf010676e698af81c1c..c1b144431bfad93302e43bce37f9f82c57f31d81 100644 |
| --- a/ash/magnifier/magnification_controller.h |
| +++ b/ash/magnifier/magnification_controller.h |
| @@ -5,6 +5,7 @@ |
| #ifndef ASH_MAGNIFIER_MAGNIFICATION_CONTROLLER_H_ |
| #define ASH_MAGNIFIER_MAGNIFICATION_CONTROLLER_H_ |
| +#include "ash/ash_export.h" |
| #include "base/compiler_specific.h" |
| #include "base/logging.h" |
| #include "base/memory/scoped_ptr.h" |
| @@ -17,7 +18,7 @@ class RootWindow; |
| namespace ash { |
| -class MagnificationController { |
| +class ASH_EXPORT MagnificationController { |
| public: |
| virtual ~MagnificationController() {} |
| @@ -25,6 +26,9 @@ class MagnificationController { |
| // returned object. |
| static MagnificationController* CreateInstance(); |
| + static bool IsMagnifierAcceleratorsEnabled(); |
| + static void SetMagnifierAcceleratorsEnabled(bool enabled); |
| + |
| // Enables (or disables if |enabled| is false) screen magnifier feature. |
| virtual void SetEnabled(bool enabled) = 0; |
| @@ -42,18 +46,40 @@ class MagnificationController { |
| // Returns the current top-left point of the magnification window. |
| virtual gfx::Point GetWindowPosition() const = 0; |
| - // Ensures that the given point/rect is inside the magnification window. If |
| - // not, the controller moves the window to contain the given point/rect. |
| - virtual void EnsureRectIsVisible(const gfx::Rect& rect, bool animate) = 0; |
| - virtual void EnsurePointIsVisible(const gfx::Point& point, bool animate) = 0; |
|
oshima
2014/02/06 22:57:31
They were dead code.
|
| + enum ScrollDirection { |
| + SCROLL_NONE, |
| + SCROLL_LEFT, |
| + SCROLL_RIGHT, |
| + SCROLL_UP, |
| + SCROLL_DOWN |
| + }; |
| + |
| + virtual void SetScrollDirection(ScrollDirection direction) = 0; |
| // Returns |point_of_interest_| in MagnificationControllerImpl. This is |
| // the internal variable to stores the last mouse cursor (or last touched) |
| // location. This method is only for test purpose. |
| virtual gfx::Point GetPointOfInterestForTesting() = 0; |
| + // A scoped object to enable and disable the magnifier accelerator for test. |
| + class ScopedMagnifierAcceleratorsEnablerForTest { |
| + public: |
| + ScopedMagnifierAcceleratorsEnablerForTest() { |
| + MagnificationController::SetMagnifierAcceleratorsEnabled(true); |
| + } |
| + ~ScopedMagnifierAcceleratorsEnablerForTest() { |
| + MagnificationController::SetMagnifierAcceleratorsEnabled(false); |
| + } |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(ScopedMagnifierAcceleratorsEnablerForTest); |
| + }; |
| protected: |
| + |
| MagnificationController() {} |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(MagnificationController); |
| }; |
| } // namespace ash |