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

Unified Diff: ash/magnifier/magnification_controller.cc

Issue 10827192: Screen Magnifier: Change the zoom level with Alt + Scroll (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/magnifier/magnification_controller.cc
diff --git a/ash/magnifier/magnification_controller.cc b/ash/magnifier/magnification_controller.cc
index 83f47e4546f3e9d28a93b82e838c3593b63606a6..056ea7bb355e27f10630bc80375d70d5f0bae068 100644
--- a/ash/magnifier/magnification_controller.cc
+++ b/ash/magnifier/magnification_controller.cc
@@ -26,6 +26,7 @@ const float kMinMagnifiedScaleThreshold = 1.1f;
const float kNonMagnifiedScale = 1.0f;
const float kInitialMagnifiedScale = 2.0f;
+const float kScrollScaleChangeFactor = 0.05f;
} // namespace
@@ -421,6 +422,14 @@ bool MagnificationControllerImpl::PreHandleKeyEvent(aura::Window* target,
bool MagnificationControllerImpl::PreHandleMouseEvent(aura::Window* target,
aura::MouseEvent* event) {
+ if (event->type() == ui::ET_SCROLL && event->IsAltDown()) {
+ aura::ScrollEvent* scroll_event = static_cast<aura::ScrollEvent*>(event);
+ float scale = GetScale();
+ scale += scroll_event->y_offset() * kScrollScaleChangeFactor;
+ SetScale(scale, true);
+ return true;
+ }
+
if (IsMagnified() && event->type() == ui::ET_MOUSE_MOVED) {
aura::RootWindow* current_root = target->GetRootWindow();
gfx::Rect root_bounds = current_root->bounds();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698