Chromium Code Reviews| 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) { |