diff options
author | yoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-06 17:54:08 +0000 |
---|---|---|
committer | yoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-06 17:54:08 +0000 |
commit | 022fd0abfa96a8d2417e3f5bb205531cb6842b44 (patch) | |
tree | da6e520041585662a78b2647c09e102aeb0028c0 /ash/magnifier | |
parent | 6a54fe109265124fbe155bc1920f36c965542ff4 (diff) | |
download | chromium_src-022fd0abfa96a8d2417e3f5bb205531cb6842b44.zip chromium_src-022fd0abfa96a8d2417e3f5bb205531cb6842b44.tar.gz chromium_src-022fd0abfa96a8d2417e3f5bb205531cb6842b44.tar.bz2 |
Magnifier: keep recording the last mouse location even magnifier is off.
We should keep to watch the mouse location and root window changing even when the magnifier is disabled, in order to do the initial zoom from the disabled state.
BUG=173968
TEST=manual
R=zork@chromium.org
TBR=derat@chromium.org
# TBRIng for simple changes just around magnifier.
Review URL: https://chromiumcodereview.appspot.com/12177014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181002 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/magnifier')
-rw-r--r-- | ash/magnifier/magnification_controller.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/ash/magnifier/magnification_controller.cc b/ash/magnifier/magnification_controller.cc index b8c454c..487aa7a 100644 --- a/ash/magnifier/magnification_controller.cc +++ b/ash/magnifier/magnification_controller.cc @@ -506,18 +506,18 @@ bool MagnificationControllerImpl::IsEnabled() const { // MagnificationControllerImpl: aura::EventFilter implementation void MagnificationControllerImpl::OnMouseEvent(ui::MouseEvent* event) { - if (IsMagnified() && event->type() == ui::ET_MOUSE_MOVED) { - aura::Window* target = static_cast<aura::Window*>(event->target()); - aura::RootWindow* current_root = target->GetRootWindow(); - gfx::Rect root_bounds = current_root->bounds(); + aura::Window* target = static_cast<aura::Window*>(event->target()); + aura::RootWindow* current_root = target->GetRootWindow(); + gfx::Rect root_bounds = current_root->bounds(); - if (root_bounds.Contains(event->root_location())) { - if (current_root != root_window_) - SwitchTargetRootWindow(current_root); + if (root_bounds.Contains(event->root_location())) { + if (current_root != root_window_) + SwitchTargetRootWindow(current_root); - point_of_interest_ = event->root_location(); + point_of_interest_ = event->root_location(); + + if (IsMagnified() && event->type() == ui::ET_MOUSE_MOVED) OnMouseMove(event->root_location()); - } } } |