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

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: review fix 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
« no previous file with comments | « ash/accelerators/accelerator_table.cc ('k') | ash/magnifier/magnification_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/magnifier/magnification_controller.h
diff --git a/ash/magnifier/magnification_controller.h b/ash/magnifier/magnification_controller.h
index f0927b6bd0bdbf14fdb8dd1293bfee68e8e68d1f..25d8922de78ab74f08e1eba3fc0da6a48a814066 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,28 @@ namespace internal {
class MagnificationController {
public:
- MagnificationController();
+ static MagnificationController* CreateInstance();
sky 2012/06/20 13:41:27 Document caller owns this.
yoshiki 2012/06/21 02:40:36 Done.
virtual ~MagnificationController() {}
sky 2012/06/20 13:41:27 constructor/destructor should be before other meth
yoshiki 2012/06/21 02:40:36 Done.
// 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);
+ virtual void EnsureRectIsVisible(const gfx::Rect& rect, bool animate) = 0;
+ virtual void EnsurePointIsVisible(const gfx::Point& point, bool animate) = 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);
+ protected:
+ MagnificationController() {}
sky 2012/06/20 13:41:27 I'm still confused. How does this compile with the
yoshiki 2012/06/21 02:40:36 You seem to be wrong. The destructor is not protec
sky 2012/06/21 16:28:06 Gah. I'm clearly wrong here. Sorry about that.
};
} // namespace internal
« no previous file with comments | « ash/accelerators/accelerator_table.cc ('k') | ash/magnifier/magnification_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698