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

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

Issue 11415025: A11y: Introduce High Contrast Mode and Screen Magnifier to ubar tray. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase @170134 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
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 205a00fd0acd2184dbbe040e80b69c9a1415c001..56819a49185111854b35d3347b13cb7ddf6a0dbe 100644
--- a/chrome/browser/chromeos/accessibility/magnification_manager.cc
+++ b/chrome/browser/chromeos/accessibility/magnification_manager.cc
@@ -7,6 +7,7 @@
#include "ash/magnifier/magnification_controller.h"
#include "ash/magnifier/partial_magnification_controller.h"
#include "ash/shell.h"
+#include "ash/system/tray/system_tray_notifier.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
#include "chrome/browser/api/prefs/pref_member.h"
@@ -50,32 +51,35 @@ class MagnificationManagerImpl : public MagnificationManager,
}
// MagnificationManager implimentation:
- accessibility::ScreenMagnifierType GetScreenMagnifierType() OVERRIDE {
+ ash::MagnifierType GetMagnifierType() OVERRIDE {
if (!profile_)
- return accessibility::MAGNIFIER_OFF;
+ return ash::MAGNIFIER_OFF;
PrefService* prefs = profile_->GetPrefs();
if (!prefs)
- return accessibility::MAGNIFIER_OFF;
+ return ash::MAGNIFIER_OFF;
- return accessibility::ScreenMagnifierTypeFromName(
- prefs->GetString(prefs::kScreenMagnifierType).c_str());
+ return accessibility::MagnifierTypeFromName(
+ prefs->GetString(prefs::kMagnifierType).c_str());
}
- void SetScreenMagnifier(accessibility::ScreenMagnifierType type) OVERRIDE {
+ void SetMagnifier(ash::MagnifierType type) OVERRIDE {
PrefService* prefs = profile_->GetPrefs();
if (prefs) {
- std::string typeString = ScreenMagnifierNameFromType(type);
- if (typeString != prefs->GetString(prefs::kScreenMagnifierType)) {
- prefs->SetString(prefs::kScreenMagnifierType, typeString);
+ std::string typeString = accessibility::ScreenMagnifierNameFromType(type);
+ if (typeString != prefs->GetString(prefs::kMagnifierType)) {
+ prefs->SetString(prefs::kMagnifierType, typeString);
prefs->CommitPendingWrite();
}
}
+ ash::Shell::GetInstance()->system_tray_notifier()->
+ NotifyAccessibilityModeChanged();
+
ash::Shell::GetInstance()->magnification_controller()->SetEnabled(
- type == accessibility::MAGNIFIER_FULL);
+ type == ash::MAGNIFIER_FULL);
ash::Shell::GetInstance()->partial_magnification_controller()->SetEnabled(
- type == accessibility::MAGNIFIER_PARTIAL);
+ type == ash::MAGNIFIER_PARTIAL);
}
private:
@@ -88,7 +92,7 @@ class MagnificationManagerImpl : public MagnificationManager,
pref_change_registrar_.reset(new PrefChangeRegistrar);
pref_change_registrar_->Init(profile->GetPrefs());
pref_change_registrar_->Add(
- prefs::kScreenMagnifierType,
+ prefs::kMagnifierType,
base::Bind(&MagnificationManagerImpl::UpdateMagnifierStatus,
base::Unretained(this)));
}
@@ -100,12 +104,12 @@ class MagnificationManagerImpl : public MagnificationManager,
void UpdateMagnifierStatus() {
UserManager* manager = UserManager::Get();
if (!profile_) {
- SetScreenMagnifier(accessibility::MAGNIFIER_OFF);
+ SetMagnifier(ash::MAGNIFIER_OFF);
} else if (manager && !manager->IsSessionStarted()) {
- SetScreenMagnifier(accessibility::MAGNIFIER_FULL);
+ SetMagnifier(ash::MAGNIFIER_FULL);
} else {
- accessibility::ScreenMagnifierType type = GetScreenMagnifierType();
- SetScreenMagnifier(type);
+ ash::MagnifierType type = GetMagnifierType();
+ SetMagnifier(type);
}
}

Powered by Google App Engine
This is Rietveld 408576698