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

Unified Diff: chrome/browser/chromeos/accessibility/magnification_manager.cc

Issue 11442036: Magnifier: Change the login-screen default scale from 1.0x to 2.0x (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add TODO comment 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 | « ash/system/tray_accessibility.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/accessibility/magnification_manager.cc
diff --git a/chrome/browser/chromeos/accessibility/magnification_manager.cc b/chrome/browser/chromeos/accessibility/magnification_manager.cc
index 906a1f038b7f9b881a58ab7969ba4c42c8c48c11..01cfc01a9ff5d36235a5494735d7eab9d07a8807 100644
--- a/chrome/browser/chromeos/accessibility/magnification_manager.cc
+++ b/chrome/browser/chromeos/accessibility/magnification_manager.cc
@@ -25,13 +25,15 @@
namespace chromeos {
namespace {
+const double kInitialMagnifiedScale = 2.0;
static MagnificationManager* g_magnification_manager = NULL;
}
class MagnificationManagerImpl : public MagnificationManager,
public content::NotificationObserver {
public:
- MagnificationManagerImpl() : profile_(NULL),
+ MagnificationManagerImpl() : first_time_update_(true),
+ profile_(NULL),
type_(ash::MAGNIFIER_OFF) {
registrar_.Add(this,
chrome::NOTIFICATION_SESSION_STARTED,
@@ -136,6 +138,30 @@ class MagnificationManagerImpl : public MagnificationManager,
}
void UpdateMagnifierStatus() {
+ // Historycally, from r162080 to r170956, screen magnifier had been enabled
+ // with 1.0x scale on login screen by default, hence some users
+ // unintentionally have the pref to enable magnifier. Now, the default scale
+ // is 2.0x on login screen (same as other screens), so despite them, with
+ // the old pref, their screen might be magnified with 2.0x scale.
+ // The following code prevents it. If the user on login screen has full
+ // screen magnifier pref but no scale pref, doesn't make magnifier enabled.
+ // TODO(yoshiki): remove this in the near future: crbug.com/164627
+ if (first_time_update_) {
+ first_time_update_ = false;
+ UserManager* manager = UserManager::Get();
+ if (profile_ &&
+ !profile_->GetPrefs()->HasPrefPath(prefs::kScreenMagnifierScale) &&
+ accessibility::MagnifierTypeFromName(profile_->GetPrefs()->GetString(
+ prefs::kMagnifierType).c_str()) == ash::MAGNIFIER_FULL &&
+ manager &&
+ !manager->IsSessionStarted()) {
+ SetMagnifier(ash::MAGNIFIER_OFF);
+ profile_->GetPrefs()->SetDouble(prefs::kScreenMagnifierScale,
+ kInitialMagnifiedScale);
+ return;
+ }
+ }
+
ash::MagnifierType type = GetMagnifierTypeFromPref();
SetMagnifier(type);
}
@@ -158,6 +184,7 @@ class MagnificationManagerImpl : public MagnificationManager,
}
}
+ bool first_time_update_;
Profile* profile_;
ash::MagnifierType type_;
content::NotificationRegistrar registrar_;
« no previous file with comments | « ash/system/tray_accessibility.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698