Commit 39d6d4bd authored by dmazzoni's avatar dmazzoni Committed by Commit bot

Accessibility manager shouldn't try to access ash Shelf from login screen.

BUG=597000

Review URL: https://codereview.chromium.org/1837053003

Cr-Commit-Position: refs/heads/master@{#383847}
parent e73d58ef
...@@ -1194,6 +1194,11 @@ void AccessibilityManager::SetProfile(Profile* profile) { ...@@ -1194,6 +1194,11 @@ void AccessibilityManager::SetProfile(Profile* profile) {
UpdateFocusHighlightFromPref(); UpdateFocusHighlightFromPref();
UpdateSelectToSpeakFromPref(); UpdateSelectToSpeakFromPref();
UpdateSwitchAccessFromPref(); UpdateSwitchAccessFromPref();
// 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 (chromevox_panel_)
chromevox_panel_->UpdatePanelHeight();
} }
void AccessibilityManager::ActiveUserChanged(const AccountId& account_id) { void AccessibilityManager::ActiveUserChanged(const AccountId& account_id) {
...@@ -1426,9 +1431,14 @@ void AccessibilityManager::OnChromeVoxPanelClosing() { ...@@ -1426,9 +1431,14 @@ void AccessibilityManager::OnChromeVoxPanelClosing() {
aura::Window* root_window = chromevox_panel_->GetRootWindow(); aura::Window* root_window = chromevox_panel_->GetRootWindow();
chromevox_panel_widget_observer_.reset(nullptr); chromevox_panel_widget_observer_.reset(nullptr);
chromevox_panel_ = nullptr; chromevox_panel_ = nullptr;
ash::Shelf::ForWindow(root_window)
->shelf_layout_manager() ash::Shelf* shelf = ash::Shelf::ForWindow(root_window);
->SetChromeVoxPanelHeight(0); if (!shelf)
return;
ash::ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager();
if (shelf_layout_manager)
shelf_layout_manager->SetChromeVoxPanelHeight(0);
} }
void AccessibilityManager::OnChromeVoxPanelDestroying() { void AccessibilityManager::OnChromeVoxPanelDestroying() {
......
...@@ -109,9 +109,17 @@ void ChromeVoxPanel::Close() { ...@@ -109,9 +109,17 @@ void ChromeVoxPanel::Close() {
void ChromeVoxPanel::DidFirstVisuallyNonEmptyPaint() { void ChromeVoxPanel::DidFirstVisuallyNonEmptyPaint() {
widget_->Show(); widget_->Show();
ash::Shelf::ForWindow(GetRootWindow()) UpdatePanelHeight();
->shelf_layout_manager() }
->SetChromeVoxPanelHeight(kPanelHeight);
void ChromeVoxPanel::UpdatePanelHeight() {
ash::Shelf* shelf = ash::Shelf::ForWindow(GetRootWindow());
if (!shelf)
return;
ash::ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager();
if (shelf_layout_manager)
shelf_layout_manager->SetChromeVoxPanelHeight(kPanelHeight);
} }
void ChromeVoxPanel::EnterFullscreen() { void ChromeVoxPanel::EnterFullscreen() {
......
...@@ -31,6 +31,7 @@ class ChromeVoxPanel : public views::WidgetDelegate, ...@@ -31,6 +31,7 @@ class ChromeVoxPanel : public views::WidgetDelegate,
void Close(); void Close();
void DidFirstVisuallyNonEmptyPaint(); void DidFirstVisuallyNonEmptyPaint();
void UpdatePanelHeight();
void EnterFullscreen(); void EnterFullscreen();
void ExitFullscreen(); void ExitFullscreen();
void DisableSpokenFeedback(); void DisableSpokenFeedback();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment