#include "ash/magnifier/magnification_controller.h"
#include "ash/magnifier/partial_magnification_controller.h"
-#include "ash/session_state_delegate.h"
+#include "ash/session/session_state_delegate.h"
#include "ash/shell.h"
#include "ash/shell_delegate.h"
#include "ash/system/tray/system_tray_notifier.h"
#include "base/prefs/pref_service.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
-#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
MagnificationManagerImpl()
: first_time_update_(true),
profile_(NULL),
- magnifier_enabled_pref_handler_(prefs::kScreenMagnifierEnabled),
- magnifier_type_pref_handler_(prefs::kScreenMagnifierType),
- magnifier_scale_pref_handler_(prefs::kScreenMagnifierScale),
+ magnifier_enabled_pref_handler_(
+ prefs::kAccessibilityScreenMagnifierEnabled),
+ magnifier_type_pref_handler_(prefs::kAccessibilityScreenMagnifierType),
+ magnifier_scale_pref_handler_(
+ prefs::kAccessibilityScreenMagnifierScale),
type_(ash::kDefaultMagnifierType),
enabled_(false) {
registrar_.Add(this,
return;
PrefService* prefs = profile_->GetPrefs();
- prefs->SetBoolean(prefs::kScreenMagnifierEnabled, enabled);
+ prefs->SetBoolean(prefs::kAccessibilityScreenMagnifierEnabled, enabled);
prefs->CommitPendingWrite();
}
return;
PrefService* prefs = profile_->GetPrefs();
- prefs->SetInteger(prefs::kScreenMagnifierType, type);
+ prefs->SetInteger(prefs::kAccessibilityScreenMagnifierType, type);
prefs->CommitPendingWrite();
}
if (!profile_)
return;
- profile_->GetPrefs()->SetDouble(prefs::kScreenMagnifierScale, scale);
+ profile_->GetPrefs()->SetDouble(prefs::kAccessibilityScreenMagnifierScale,
+ scale);
}
virtual double GetSavedScreenMagnifierScale() const OVERRIDE {
if (!profile_)
return std::numeric_limits<double>::min();
- return profile_->GetPrefs()->GetDouble(prefs::kScreenMagnifierScale);
+ return profile_->GetPrefs()->GetDouble(
+ prefs::kAccessibilityScreenMagnifierScale);
}
virtual void SetProfileForTest(Profile* profile) OVERRIDE {
pref_change_registrar_.reset(new PrefChangeRegistrar);
pref_change_registrar_->Init(profile->GetPrefs());
pref_change_registrar_->Add(
- prefs::kScreenMagnifierEnabled,
+ prefs::kAccessibilityScreenMagnifierEnabled,
base::Bind(&MagnificationManagerImpl::UpdateMagnifierFromPrefs,
base::Unretained(this)));
pref_change_registrar_->Add(
- prefs::kScreenMagnifierType,
+ prefs::kAccessibilityScreenMagnifierType,
base::Bind(&MagnificationManagerImpl::UpdateMagnifierFromPrefs,
base::Unretained(this)));
}
if (!profile_)
return;
- const bool enabled =
- profile_->GetPrefs()->GetBoolean(prefs::kScreenMagnifierEnabled);
- const int type_integer =
- profile_->GetPrefs()->GetInteger(prefs::kScreenMagnifierType);
+ const bool enabled = profile_->GetPrefs()->GetBoolean(
+ prefs::kAccessibilityScreenMagnifierEnabled);
+ const int type_integer = profile_->GetPrefs()->GetInteger(
+ prefs::kAccessibilityScreenMagnifierType);
ash::MagnifierType type = ash::kDefaultMagnifierType;
if (type_integer > 0 && type_integer <= ash::kMaxMagnifierType) {
}
AccessibilityStatusEventDetails details(
- enabled_, type_, ash::A11Y_NOTIFICATION_NONE);
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_CROS_ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFIER,
- content::NotificationService::AllSources(),
- content::Details<AccessibilityStatusEventDetails>(&details));
+ ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFIER,
+ enabled_,
+ type_,
+ ash::A11Y_NOTIFICATION_NONE);
+
+#if defined(OS_CHROMEOS)
+ if (AccessibilityManager::Get()) {
+ AccessibilityManager::Get()->NotifyAccessibilityStatusChanged(details);
+ if (ash::Shell::GetInstance()) {
+ ash::Shell::GetInstance()->SetCursorCompositingEnabled(
+ AccessibilityManager::Get()->ShouldEnableCursorCompositing());
+ }
+ }
+#endif
}
// content::NotificationObserver implementation: