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

Unified Diff: ash/magnifier/partial_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: Code review fixes Created 8 years, 2 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/partial_magnification_controller.h
diff --git a/ash/magnifier/partial_magnification_controller.h b/ash/magnifier/partial_magnification_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..cf8c7044018499f7f0d6f52bd480b3a4acd4ea21
--- /dev/null
+++ b/ash/magnifier/partial_magnification_controller.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_MAGNIFIER_PARTIAL_MAGNIFICATION_CONTROLLER_H_
+#define ASH_MAGNIFIER_PARTIAL_MAGNIFICATION_CONTROLLER_H_
+
+namespace aura {
+class RootWindow;
+}
+
+namespace ash {
+namespace internal {
+
+const float kDefaultPartialMagnifiedScale = 1.5f;
+const float kNonPartialMagnifiedScale = 1.0f;
+
+// Controls the partial screen magnifier, which is a small area of the screen
+// which is zoomed in. The zoomed area follows the mouse cursor when enabled.
+class PartialMagnificationController {
sky 2012/10/11 17:00:49 Is there a reason to make this pure virtual?
Zachary Kuznia 2012/10/12 08:41:35 It's done this way in order to match the style of
sky 2012/10/12 17:09:19 Is there a reason for that?
Zachary Kuznia 2012/10/15 08:28:40 Apparently the reason was to keep the header file
+ public:
+ virtual ~PartialMagnificationController() {}
+
+ // Creates a new PartialMagnificationController. The caller takes ownership
+ // of the returned object.
+ static PartialMagnificationController* CreateInstance();
+
+ // Enables (or disables if |enabled| is false) partial screen magnifier
+ // feature.
+ virtual void SetEnabled(bool enabled) = 0;
+
+ virtual bool IsEnabled() const = 0;
+
+ // Sets the magnification ratio. 1.0f means no magnification.
+ virtual void SetScale(float scale) = 0;
+
+ // Returns the current magnification ratio.
+ virtual float GetScale() const = 0;
+
+ protected:
+ PartialMagnificationController() {}
+};
+
+} // namespace internal
+} // namespace ash
+
+#endif // ASH_MAGNIFIER_PARTIAL_MAGNIFICATION_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698