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

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: 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..2f7d55a27491bd1954c18b277ca0aff8a2e17c64 100644
--- a/ash/magnifier/magnification_controller.cc
+++ b/ash/magnifier/magnification_controller.cc
@@ -105,14 +105,18 @@ class MagnificationControllerImpl : virtual public MagnificationController,
// Returns if the magnification scale is 1.0 or not (larger then 1.0).
bool IsMagnified() const;
- // Returns the default scale which depends on the login status.
- float GetDefaultZoomScale() const {
+ // Returns true if the user is logged in.
+ bool IsUserLoggedIn() const {
user::LoginStatus login = Shell::GetInstance()->tray_delegate() ?
Shell::GetInstance()->tray_delegate()->GetUserLoginStatus() :
Daniel Erat 2012/11/28 15:35:23 it seems pretty strange to me how all of this code
mazda 2012/11/28 19:27:16 I filed a cleanup issue (http://crbug.com/163170)
user::LOGGED_IN_NONE;
+ return login != user::LOGGED_IN_NONE;
+ }
+ // Returns the default scale which depends on the login status.
+ float GetDefaultZoomScale() const {
// On login screen, don't magnify the screen by default.
- if (login == user::LOGGED_IN_NONE)
+ if (!IsUserLoggedIn())
return kNonMagnifiedScale;
return kInitialMagnifiedScale;
@@ -351,8 +355,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 on login screen, do not move cursor nor show
Daniel Erat 2012/11/28 15:35:23 nit: s/nor/or/, s/cursor/the cursor/g ("nor" woul
mazda 2012/11/28 19:27:16 Done.
+ // cursor after the animation.
+ if (!IsUserLoggedIn() && !cursor_client->IsCursorVisible())
yoshiki 2012/11/28 05:00:14 I think you can remove "!IsUserLoggedIn()". We sho
mazda 2012/11/28 19:27:16 Done.
+ return;
cursor_client->ShowCursor(false);
+ }
move_cursor_after_animation_ = true;
position_after_animation_ = location;
}
@@ -397,12 +406,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