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

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

Issue 2422983004: Reload ChromeVox panel when reloading ChromeVox into a new profile. (Closed)
Patch Set: Created 4 years, 2 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 d8bd5f59d8631973e23dfec05f55aee454a6e7b5..d2559e69e7f0ead1d717ab5108afae31b2280395 100644
--- a/chrome/browser/chromeos/accessibility/accessibility_manager.cc
+++ b/chrome/browser/chromeos/accessibility/accessibility_manager.cc
@@ -453,8 +453,11 @@ void AccessibilityManager::UpdateSpokenFeedbackFromPref() {
const bool enabled = profile_->GetPrefs()->GetBoolean(
prefs::kAccessibilitySpokenFeedbackEnabled);
- if (enabled)
- chromevox_loader_->SetProfile(profile_);
+ if (enabled) {
+ chromevox_loader_->SetProfile(
+ profile_, base::Bind(&AccessibilityManager::PostSwitchChromeVoxProfile,
+ weak_ptr_factory_.GetWeakPtr()));
+ }
if (spoken_feedback_enabled_ == enabled)
return;
@@ -1036,7 +1039,9 @@ void AccessibilityManager::SetProfile(Profile* profile) {
&AccessibilityManager::UpdateChromeOSAccessibilityHistograms,
base::Unretained(this)));
- chromevox_loader_->SetProfile(profile);
+ chromevox_loader_->SetProfile(
+ profile, base::Bind(&AccessibilityManager::PostSwitchChromeVoxProfile,
+ weak_ptr_factory_.GetWeakPtr()));
extensions::ExtensionRegistry* registry =
extensions::ExtensionRegistry::Get(profile);
@@ -1318,6 +1323,16 @@ void AccessibilityManager::PostUnloadChromeVox() {
}
}
+void AccessibilityManager::PostSwitchChromeVoxProfile() {
+ if (chromevox_panel_) {
+ chromevox_panel_->Close();
+ chromevox_panel_ = nullptr;
+ }
+ chromevox_panel_ = new ChromeVoxPanel(profile_);
+ chromevox_panel_widget_observer_.reset(
+ new ChromeVoxPanelWidgetObserver(chromevox_panel_->GetWidget(), this));
+}
+
void AccessibilityManager::OnChromeVoxPanelClosing() {
aura::Window* root_window = chromevox_panel_->GetRootWindow();
chromevox_panel_widget_observer_.reset(nullptr);
« 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