| Index: ash/magnifier/magnification_controller.h
|
| diff --git a/ash/magnifier/magnification_controller.h b/ash/magnifier/magnification_controller.h
|
| index f0927b6bd0bdbf14fdb8dd1293bfee68e8e68d1f..a97d171ee1aa96e7c3106d735b6a5aceb0290d08 100644
|
| --- a/ash/magnifier/magnification_controller.h
|
| +++ b/ash/magnifier/magnification_controller.h
|
| @@ -8,6 +8,8 @@
|
|
|
| #include "base/compiler_specific.h"
|
| #include "base/logging.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "ui/aura/event_filter.h"
|
| #include "ui/gfx/point.h"
|
| #include "ui/gfx/rect.h"
|
|
|
| @@ -20,42 +22,30 @@ namespace internal {
|
|
|
| class MagnificationController {
|
| public:
|
| - MagnificationController();
|
| -
|
| virtual ~MagnificationController() {}
|
|
|
| + // Creates a new MagnificationController. The caller takes ownership of the
|
| + // returned object.
|
| + static MagnificationController* CreateInstance();
|
| +
|
| // Sets the magnification ratio. 1.0f means no magnification.
|
| - void SetScale(float scale);
|
| + virtual void SetScale(float scale, bool animate) = 0;
|
| // Returns the current magnification ratio.
|
| - float GetScale() const { return scale_; }
|
| + virtual float GetScale() const = 0;
|
|
|
| // Set the top-left point of the magnification window.
|
| - void MoveWindow(int x, int y);
|
| - void MoveWindow(const gfx::Point& point);
|
| + virtual void MoveWindow(int x, int y, bool animate) = 0;
|
| + virtual void MoveWindow(const gfx::Point& point, bool animate) = 0;
|
| // Returns the current top-left point of the magnification window.
|
| - gfx::Point GetWindowPosition() const { return gfx::Point(x_, y_); }
|
| + 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.
|
| - void EnsureShowRect(const gfx::Rect& rect);
|
| - void EnsureShowPoint(const gfx::Point& point, bool animation);
|
| -
|
| - private:
|
| - aura::RootWindow* root_window_;
|
| -
|
| - // Current scale, position of the magnification window.
|
| - float scale_;
|
| - int x_;
|
| - int y_;
|
| -
|
| - // Returns the rect of the magnification window.
|
| - gfx::Rect GetWindowRect();
|
| - // Moves the magnification window to new scale and position. This method
|
| - // should be called internally just after the scale and/or the position are
|
| - // changed.
|
| - void RedrawScreen(bool animation);
|
| + virtual void EnsureRectIsVisible(const gfx::Rect& rect, bool animate) = 0;
|
| + virtual void EnsurePointIsVisible(const gfx::Point& point, bool animate) = 0;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(MagnificationController);
|
| + protected:
|
| + MagnificationController() {}
|
| };
|
|
|
| } // namespace internal
|
|
|