Chromium Code Reviews| 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; |
| } |