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

Side by Side Diff: ash/magnifier/magnification_controller.h

Issue 10915140: Add the partial screen magnifier to Chrome OS. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 8 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « ash/ash.gyp ('k') | ash/magnifier/magnification_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "ui/gfx/point.h" 11 #include "ui/gfx/point.h"
12 #include "ui/gfx/rect.h" 12 #include "ui/gfx/rect.h"
13 13
14 namespace aura { 14 namespace aura {
15 class RootWindow; 15 class RootWindow;
16 } 16 }
17 17
18 namespace ash { 18 namespace ash {
19 namespace internal {
20 19
21 class MagnificationController { 20 class MagnificationController {
22 public: 21 public:
23 virtual ~MagnificationController() {} 22 virtual ~MagnificationController() {}
24 23
25 // Creates a new MagnificationController. The caller takes ownership of the 24 // Creates a new MagnificationController. The caller takes ownership of the
26 // returned object. 25 // returned object.
27 static MagnificationController* CreateInstance(); 26 static MagnificationController* CreateInstance();
28 27
29 // Enables (or disables if |enabled| is false) screen magnifier feature. 28 // Enables (or disables if |enabled| is false) screen magnifier feature.
30 virtual void SetEnabled(bool enabled) = 0; 29 virtual void SetEnabled(bool enabled) = 0;
31 30
31 virtual bool IsEnabled() const = 0;
32
32 // Sets the magnification ratio. 1.0f means no magnification. 33 // Sets the magnification ratio. 1.0f means no magnification.
33 virtual void SetScale(float scale, bool animate) = 0; 34 virtual void SetScale(float scale, bool animate) = 0;
34 // Returns the current magnification ratio. 35 // Returns the current magnification ratio.
35 virtual float GetScale() const = 0; 36 virtual float GetScale() const = 0;
36 37
37 // Set the top-left point of the magnification window. 38 // Set the top-left point of the magnification window.
38 virtual void MoveWindow(int x, int y, bool animate) = 0; 39 virtual void MoveWindow(int x, int y, bool animate) = 0;
39 virtual void MoveWindow(const gfx::Point& point, bool animate) = 0; 40 virtual void MoveWindow(const gfx::Point& point, bool animate) = 0;
40 // Returns the current top-left point of the magnification window. 41 // Returns the current top-left point of the magnification window.
41 virtual gfx::Point GetWindowPosition() const = 0; 42 virtual gfx::Point GetWindowPosition() const = 0;
42 43
43 // Ensures that the given point/rect is inside the magnification window. If 44 // Ensures that the given point/rect is inside the magnification window. If
44 // not, the controller moves the window to contain the given point/rect. 45 // not, the controller moves the window to contain the given point/rect.
45 virtual void EnsureRectIsVisible(const gfx::Rect& rect, bool animate) = 0; 46 virtual void EnsureRectIsVisible(const gfx::Rect& rect, bool animate) = 0;
46 virtual void EnsurePointIsVisible(const gfx::Point& point, bool animate) = 0; 47 virtual void EnsurePointIsVisible(const gfx::Point& point, bool animate) = 0;
47 48
48 protected: 49 protected:
49 MagnificationController() {} 50 MagnificationController() {}
50 }; 51 };
51 52
52 } // namespace internal
53 } // namespace ash 53 } // namespace ash
54 54
55 #endif // ASH_MAGNIFIER_MAGNIFICATION_CONTROLLER_H_ 55 #endif // ASH_MAGNIFIER_MAGNIFICATION_CONTROLLER_H_
OLDNEW
« no previous file with comments | « ash/ash.gyp ('k') | ash/magnifier/magnification_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698