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

Unified Diff: ash/magnifier/magnification_controller.cc

Issue 11548044: Revert 171609 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1354/src/
Patch Set: Created 8 years 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 | ash/system/tray_accessibility.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/magnifier/magnification_controller.cc
===================================================================
--- ash/magnifier/magnification_controller.cc (revision 172698)
+++ ash/magnifier/magnification_controller.cc (working copy)
@@ -105,6 +105,21 @@
// 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 {
+ // 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;
+
+ // On login screen, don't magnify the screen by default.
+ if (login == user::LOGGED_IN_NONE)
+ return kNonMagnifiedScale;
+
+ return kInitialMagnifiedScale;
+ }
+
// Returns the rect of the magnification window.
gfx::RectF GetWindowRectDIP(float scale) const;
// Returns the size of the root window.
@@ -461,7 +476,7 @@
float scale =
ash::Shell::GetInstance()->delegate()->GetSavedScreenMagnifierScale();
if (scale <= 0.0f)
- scale = kInitialMagnifiedScale;
+ scale = GetDefaultZoomScale();
ValidateScale(&scale);
// Do nothing, if already enabled with same scale.
@@ -469,7 +484,6 @@
return;
RedrawKeepingMousePosition(scale, true);
- ash::Shell::GetInstance()->delegate()->SaveScreenMagnifierScale(scale);
is_enabled_ = enabled;
} else {
// Do nothing, if already disabled.
« no previous file with comments | « no previous file | ash/system/tray_accessibility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698