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

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

Issue 11550010: Remove partial magnifier from settings page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use a boolean pref instead of string pref. 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 | chrome/browser/chromeos/accessibility/magnification_manager_browsertest.cc » ('j') | 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 5b2693c57e8bd3fa32b49362da0a77689ec5af29..c5285337d2c19725700bf11edbec899652133f18 100644
--- a/chrome/browser/chromeos/accessibility/magnification_manager.cc
+++ b/chrome/browser/chromeos/accessibility/magnification_manager.cc
@@ -64,10 +64,9 @@ class MagnificationManagerImpl : public MagnificationManager,
if (profile_) {
PrefService* prefs = profile_->GetPrefs();
if (prefs) {
- std::string typeString =
- accessibility::ScreenMagnifierNameFromType(type);
- if (typeString != prefs->GetString(prefs::kMagnifierType)) {
- prefs->SetString(prefs::kMagnifierType, typeString);
+ bool enabled = (type != ash::MAGNIFIER_OFF);
+ if (enabled != prefs->GetBoolean(prefs::kScreenMagnifierEnabled)) {
+ prefs->SetBoolean(prefs::kScreenMagnifierEnabled, enabled);
prefs->CommitPendingWrite();
}
}
@@ -120,8 +119,8 @@ class MagnificationManagerImpl : public MagnificationManager,
if (!prefs)
return ash::MAGNIFIER_OFF;
- return accessibility::MagnifierTypeFromName(
- prefs->GetString(prefs::kMagnifierType).c_str());
+ return prefs->GetBoolean(prefs::kScreenMagnifierEnabled) ?
+ ash::MAGNIFIER_FULL : ash::MAGNIFIER_OFF;
}
void SetProfile(Profile* profile) {
@@ -133,7 +132,7 @@ class MagnificationManagerImpl : public MagnificationManager,
pref_change_registrar_.reset(new PrefChangeRegistrar);
pref_change_registrar_->Init(profile->GetPrefs());
pref_change_registrar_->Add(
- prefs::kMagnifierType,
+ prefs::kScreenMagnifierEnabled,
base::Bind(&MagnificationManagerImpl::UpdateMagnifierStatus,
base::Unretained(this)));
}
@@ -143,30 +142,6 @@ 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);
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/accessibility/magnification_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698