Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1863)

Unified Diff: ash/magnifier/magnification_controller.cc

Issue 11316214: Do not let MagnificationController move cursor on login screen when cursor is invisible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/magnifier/magnification_controller.cc
diff --git a/ash/magnifier/magnification_controller.cc b/ash/magnifier/magnification_controller.cc
index 20d4b0888fa7d98b9c6dd73ce175c3e30160c49e..d2169b320e0a88530ee0baf6b7399ea91fe48224 100644
--- a/ash/magnifier/magnification_controller.cc
+++ b/ash/magnifier/magnification_controller.cc
@@ -107,6 +107,8 @@ class MagnificationControllerImpl : virtual public MagnificationController,
// Returns the default scale which depends on the login status.
float GetDefaultZoomScale() const {
+ // TODO(yoshiki,mazda): Do not use SystemTrayDelegate to get the user login
+ // status (http://crbug.com/163170).
user::LoginStatus login = Shell::GetInstance()->tray_delegate() ?
Shell::GetInstance()->tray_delegate()->GetUserLoginStatus() :
user::LOGGED_IN_NONE;
@@ -159,7 +161,7 @@ MagnificationControllerImpl::MagnificationControllerImpl()
is_on_animation_(false),
is_enabled_(false),
move_cursor_after_animation_(false),
- scale_(std::numeric_limits<double>::min()) {
+ scale_(kNonMagnifiedScale) {
Shell::GetInstance()->AddPreTargetHandler(this);
}
@@ -351,8 +353,13 @@ void MagnificationControllerImpl::AfterAnimationMoveCursorTo(
const gfx::Point& location) {
aura::client::CursorClient* cursor_client =
aura::client::GetCursorClient(root_window_);
- if (cursor_client)
+ if (cursor_client) {
+ // When cursor is invisible, do not move or show the cursor after the
+ // animation.
+ if (!cursor_client->IsCursorVisible())
+ return;
cursor_client->ShowCursor(false);
+ }
move_cursor_after_animation_ = true;
position_after_animation_ = location;
}
@@ -397,12 +404,12 @@ void MagnificationControllerImpl::OnImplicitAnimationsCompleted() {
if (move_cursor_after_animation_) {
root_window_->MoveCursorTo(position_after_animation_);
move_cursor_after_animation_ = false;
- }
- aura::client::CursorClient* cursor_client =
- aura::client::GetCursorClient(root_window_);
- if (cursor_client)
- cursor_client->ShowCursor(true);
+ aura::client::CursorClient* cursor_client =
+ aura::client::GetCursorClient(root_window_);
+ if (cursor_client)
+ cursor_client->ShowCursor(true);
+ }
is_on_animation_ = false;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698