Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1161)

Unified Diff: ash/magnifier/magnification_controller.h

Issue 10388141: Full-screen Magnifier: Support warping the cursor on the edge (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Change behaivior of the magnified region. Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/magnifier/magnification_controller.h
diff --git a/ash/magnifier/magnification_controller.h b/ash/magnifier/magnification_controller.h
index f0927b6bd0bdbf14fdb8dd1293bfee68e8e68d1f..19c28b59cd0d3542637889bb207c20c73f990cb1 100644
--- a/ash/magnifier/magnification_controller.h
+++ b/ash/magnifier/magnification_controller.h
@@ -8,53 +8,42 @@
#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"
namespace aura {
class RootWindow;
+class EventFilter;
}
namespace ash {
namespace internal {
-class MagnificationController {
+class MagnificationController : public aura::EventFilter {
public:
- MagnificationController();
+ MagnificationController() {}
- virtual ~MagnificationController() {}
+ static MagnificationController* CreateInstance();
// Sets the magnification ratio. 1.0f means no magnification.
- void SetScale(float scale);
+ virtual void SetScale(float scale, bool animation) = 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 animation) = 0;
+ virtual void MoveWindow(const gfx::Point& point, bool animation) = 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);
+ virtual void EnsureShowRect(const gfx::Rect& rect, bool animation) = 0;
+ virtual void EnsureShowPoint(const gfx::Point& point, bool animation) = 0;
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);
-
DISALLOW_COPY_AND_ASSIGN(MagnificationController);
};

Powered by Google App Engine
This is Rietveld 408576698