diff options
author | yoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-27 09:45:53 +0000 |
---|---|---|
committer | yoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-27 09:45:53 +0000 |
commit | 97c85850ead6e6b7f3f61be82183385d057f2b53 (patch) | |
tree | c86469b584f7cbad42fabfb33345368cee03c5c7 /ash | |
parent | 9a6814e36829a671f94ebec06c7f1b42fa927420 (diff) | |
download | chromium_src-97c85850ead6e6b7f3f61be82183385d057f2b53.zip chromium_src-97c85850ead6e6b7f3f61be82183385d057f2b53.tar.gz chromium_src-97c85850ead6e6b7f3f61be82183385d057f2b53.tar.bz2 |
Magnifier: Prevent from sometimes not showing back the cursor after animation.
Major changes:
- Rename: |is_on_zoopming_|-> |is_on_animation_|
- Set |is_on_animation_| in Redraw() instead of the callees.
BUG=none
TEST=manual
TBR=sky@chromium.org
# TBRing for simple changes inside magnifier.
Review URL: https://chromiumcodereview.appspot.com/11428018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169616 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/magnifier/magnification_controller.cc | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/ash/magnifier/magnification_controller.cc b/ash/magnifier/magnification_controller.cc index 7ab7a2d..20d4b08 100644 --- a/ash/magnifier/magnification_controller.cc +++ b/ash/magnifier/magnification_controller.cc @@ -132,9 +132,9 @@ class MagnificationControllerImpl : virtual public MagnificationController, aura::RootWindow* root_window_; - // True if the magnified window is in motion of zooming or un-zooming effect. - // Otherwise, false. - bool is_on_zooming_; + // True if the magnified window is currently animating a change. Otherwise, + // false. + bool is_on_animation_; bool is_enabled_; @@ -156,7 +156,7 @@ class MagnificationControllerImpl : virtual public MagnificationController, MagnificationControllerImpl::MagnificationControllerImpl() : root_window_(ash::Shell::GetPrimaryRootWindow()), - is_on_zooming_(false), + is_on_animation_(false), is_enabled_(false), move_cursor_after_animation_(false), scale_(std::numeric_limits<double>::min()) { @@ -244,6 +244,9 @@ bool MagnificationControllerImpl::RedrawDIP(const gfx::PointF& position_in_dip, root_window_->layer()->SetTransform(transform); + if (animate) + is_on_animation_ = true; + return true; } @@ -331,12 +334,10 @@ void MagnificationControllerImpl::OnMouseMove(const gfx::Point& location) { start_zoom = true; } - if (start_zoom && !is_on_zooming_) { + if (start_zoom && !is_on_animation_) { bool ret = RedrawDIP(gfx::Point(x, y), scale_, true); if (ret) { - is_on_zooming_ = true; - int x_diff = origin_.x() - window_rect.x(); int y_diff = origin_.y() - window_rect.y(); // If the magnified region is moved, hides the mouse cursor and moves it. @@ -390,7 +391,7 @@ void MagnificationControllerImpl::ValidateScale(float* scale) { } void MagnificationControllerImpl::OnImplicitAnimationsCompleted() { - if (!is_on_zooming_) + if (!is_on_animation_) return; if (move_cursor_after_animation_) { @@ -402,7 +403,8 @@ void MagnificationControllerImpl::OnImplicitAnimationsCompleted() { aura::client::GetCursorClient(root_window_); if (cursor_client) cursor_client->ShowCursor(true); - is_on_zooming_ = false; + + is_on_animation_ = false; } void MagnificationControllerImpl::SwitchTargetRootWindow( |