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) {
UpdateFocusHighlightFromPref();
UpdateSelectToSpeakFromPref();
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) {
......@@ -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() {
......
......@@ -109,9 +109,17 @@ void ChromeVoxPanel::Close() {
void ChromeVoxPanel::DidFirstVisuallyNonEmptyPaint() {
widget_->Show();
ash::Shelf::ForWindow(GetRootWindow())
->shelf_layout_manager()
->SetChromeVoxPanelHeight(kPanelHeight);
UpdatePanelHeight();
}
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() {
......
......@@ -31,6 +31,7 @@ class ChromeVoxPanel : public views::WidgetDelegate,
void Close();
void DidFirstVisuallyNonEmptyPaint();
void UpdatePanelHeight();
void EnterFullscreen();
void ExitFullscreen();
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