Commit 4a8fdae6 authored by yoshiki@chromium.org's avatar yoshiki@chromium.org

Screen Magnifier: Change the zoom level with Alt + Scroll

BUG=135185

Review URL: https://chromiumcodereview.appspot.com/10827192

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150416 0039d316-1c4b-4281-b951-d872f2087c98
parent 7489638d
...@@ -26,6 +26,7 @@ const float kMinMagnifiedScaleThreshold = 1.1f; ...@@ -26,6 +26,7 @@ const float kMinMagnifiedScaleThreshold = 1.1f;
const float kNonMagnifiedScale = 1.0f; const float kNonMagnifiedScale = 1.0f;
const float kInitialMagnifiedScale = 2.0f; const float kInitialMagnifiedScale = 2.0f;
const float kScrollScaleChangeFactor = 0.05f;
} // namespace } // namespace
...@@ -421,6 +422,14 @@ bool MagnificationControllerImpl::PreHandleKeyEvent(aura::Window* target, ...@@ -421,6 +422,14 @@ bool MagnificationControllerImpl::PreHandleKeyEvent(aura::Window* target,
bool MagnificationControllerImpl::PreHandleMouseEvent(aura::Window* target, bool MagnificationControllerImpl::PreHandleMouseEvent(aura::Window* target,
aura::MouseEvent* event) { 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) { if (IsMagnified() && event->type() == ui::ET_MOUSE_MOVED) {
aura::RootWindow* current_root = target->GetRootWindow(); aura::RootWindow* current_root = target->GetRootWindow();
gfx::Rect root_bounds = current_root->bounds(); gfx::Rect root_bounds = current_root->bounds();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment