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(); |