diff options
author | yoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-31 06:20:13 +0000 |
---|---|---|
committer | yoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-31 06:20:13 +0000 |
commit | 21c2431ade8b3548b004d33047a15a0169528f83 (patch) | |
tree | d884b9d1e0d559cfb5fd9968ce3cf298350b2409 /ash/magnifier | |
parent | c5bc46ce50159d1137ba48ebf446d1ce02a54429 (diff) | |
download | chromium_src-21c2431ade8b3548b004d33047a15a0169528f83.zip chromium_src-21c2431ade8b3548b004d33047a15a0169528f83.tar.gz chromium_src-21c2431ade8b3548b004d33047a15a0169528f83.tar.bz2 |
Full Screen Magnifier: Ignores the fling scroll events with Ctrl-Alt.
When the screen magnifier is enabled, Ctrl-Alt-Scroll is used for changing zoom scale. But sometimes quick *flick* makes scrolling instead of zooming. This CL ignores fling scroll events and fix the problem.
BUG=157490
Review URL: https://chromiumcodereview.appspot.com/11301029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165115 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/magnifier')
-rw-r--r-- | ash/magnifier/magnification_controller.cc | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/ash/magnifier/magnification_controller.cc b/ash/magnifier/magnification_controller.cc index 0ea0ecd..2bcabbf 100644 --- a/ash/magnifier/magnification_controller.cc +++ b/ash/magnifier/magnification_controller.cc @@ -458,14 +458,19 @@ bool MagnificationControllerImpl::PreHandleKeyEvent(aura::Window* target, bool MagnificationControllerImpl::PreHandleMouseEvent(aura::Window* target, ui::MouseEvent* event) { - if (event->type() == ui::ET_SCROLL && - event->IsAltDown() & - event->IsControlDown()) { - ui::ScrollEvent* scroll_event = static_cast<ui::ScrollEvent*>(event); - float scale = GetScale(); - scale += scroll_event->y_offset() * kScrollScaleChangeFactor; - SetScale(scale, true); - return true; + if (event->IsAltDown() && event->IsControlDown()) { + if (event->type() == ui::ET_SCROLL_FLING_START || + event->type() == ui::ET_SCROLL_FLING_CANCEL) { + return true; + } + + if (event->type() == ui::ET_SCROLL) { + ui::ScrollEvent* scroll_event = static_cast<ui::ScrollEvent*>(event); + float scale = GetScale(); + scale += scroll_event->y_offset() * kScrollScaleChangeFactor; + SetScale(scale, true); + return true; + } } if (IsMagnified() && event->type() == ui::ET_MOUSE_MOVED) { |