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

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

Issue 1837053003: Accessibility manager shouldn't try to access ash Shelf from login screen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update height when profile changes Created 4 years, 9 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
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 cdf37a793117fb182481dafa6f2c0c9d0ecefed3..1d0c9ab31304df829b08aaa6afbdd9889f46d655 100644
--- a/chrome/browser/chromeos/accessibility/accessibility_manager.cc
+++ b/chrome/browser/chromeos/accessibility/accessibility_manager.cc
@@ -365,6 +365,11 @@ void AccessibilityManager::PrefHandler::HandleProfileChanged(
PrefService* user_prefs = current_profile->GetPrefs();
user_prefs->Set(pref_path_, *value_on_login);
}
+
+ // Update the panel height in the shelf layout manager when the profile
+ // changes, since the shelf layout manager doesn't exist in the login profile.
+ if (g_accessibility_manager)
+ g_accessibility_manager->UpdateChromeVoxPanelHeight();
xiyuan 2016/03/28 22:35:56 Do this in AccessibilityManager::SetProfile so tha
dmazzoni 2016/03/29 20:43:22 Done.
}
///////////////////////////////////////////////////////////////////////////////
@@ -1426,9 +1431,14 @@ void AccessibilityManager::OnChromeVoxPanelClosing() {
aura::Window* root_window = chromevox_panel_->GetRootWindow();
chromevox_panel_widget_observer_.reset(nullptr);
chromevox_panel_ = nullptr;
- ash::Shelf::ForWindow(root_window)
- ->shelf_layout_manager()
- ->SetChromeVoxPanelHeight(0);
+
+ ash::Shelf* shelf = ash::Shelf::ForWindow(root_window);
+ if (!shelf)
+ return;
+
+ ash::ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager();
+ if (shelf_layout_manager)
+ shelf_layout_manager->SetChromeVoxPanelHeight(0);
}
void AccessibilityManager::OnChromeVoxPanelDestroying() {
@@ -1436,6 +1446,11 @@ void AccessibilityManager::OnChromeVoxPanelDestroying() {
chromevox_panel_ = nullptr;
}
+void AccessibilityManager::UpdateChromeVoxPanelHeight() {
+ if (chromevox_panel_)
+ chromevox_panel_->UpdatePanelHeight();
+}
+
void AccessibilityManager::SetKeyboardListenerExtensionId(
const std::string& id,
content::BrowserContext* context) {
« no previous file with comments | « chrome/browser/chromeos/accessibility/accessibility_manager.h ('k') | chrome/browser/chromeos/accessibility/chromevox_panel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698