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

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

Issue 123443002: Track all profiles ChromeVox loads to. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address reviewer comments. Created 6 years, 11 months 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 | « chrome/browser/chromeos/accessibility/accessibility_manager.h ('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/accessibility_manager.cc
diff --git a/chrome/browser/chromeos/accessibility/accessibility_manager.cc b/chrome/browser/chromeos/accessibility/accessibility_manager.cc
index 2b67f9bcf31959fbc79ffb03ecb0e266afcc717b..d5cd91ca77c9a4dfc8edf85da5cbe0490795434e 100644
--- a/chrome/browser/chromeos/accessibility/accessibility_manager.cc
+++ b/chrome/browser/chromeos/accessibility/accessibility_manager.cc
@@ -343,8 +343,10 @@ AccessibilityManager::~AccessibilityManager() {
// Component extensions don't always notify us when they're unloaded. Ensure
// we clean up ChromeVox observers here.
- if (profile_) {
- extensions::ExtensionSystem::Get(profile_)->
+ for (std::set<Profile*>::iterator it = chromevox_profiles_.begin();
+ it != chromevox_profiles_.end();
+ it++) {
+ extensions::ExtensionSystem::Get(*it)->
event_router()->UnregisterObserver(this);
}
}
@@ -742,11 +744,6 @@ void AccessibilityManager::SetProfile(Profile* profile) {
autoclick_pref_handler_.HandleProfileChanged(profile_, profile);
autoclick_delay_pref_handler_.HandleProfileChanged(profile_, profile);
- if (!profile && profile_) {
- extensions::ExtensionSystem::Get(profile_)->
- event_router()->UnregisterObserver(this);
- }
-
if (profile && spoken_feedback_enabled_)
SetUpPreLoadChromeVox(profile);
@@ -856,6 +853,9 @@ void AccessibilityManager::Observe(
Profile* profile = content::Source<Profile>(source).ptr();
if (profile_ == profile)
SetProfile(NULL);
+
+ if (IsSpokenFeedbackEnabled())
+ TearDownPostUnloadChromeVox(profile);
break;
}
case chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED: {
@@ -944,6 +944,7 @@ void AccessibilityManager::SetUpPreLoadChromeVox(Profile* profile) {
event_router()->RegisterObserver(this,
extensions::api::experimental_accessibility::
OnChromeVoxLoadStateChanged::kEventName);
+ chromevox_profiles_.insert(profile);
}
}
@@ -952,12 +953,12 @@ void AccessibilityManager::TearDownPostUnloadChromeVox(Profile* profile) {
if (profile) {
extensions::ExtensionSystem::Get(profile)->
event_router()->UnregisterObserver(this);
+ chromevox_profiles_.erase(profile);
}
}
void AccessibilityManager::PlaySound(int sound_key) const {
- if (system_sounds_enabled_)
- media::SoundsManager::Get()->Play(sound_key);
+ media::SoundsManager::Get()->Play(sound_key);
}
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/accessibility/accessibility_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698