| Index: chrome/browser/chromeos/accessibility/chromevox_panel.cc
|
| diff --git a/chrome/browser/chromeos/accessibility/chromevox_panel.cc b/chrome/browser/chromeos/accessibility/chromevox_panel.cc
|
| index dc5be1dee8d048c61ea76aa296c97d24b631fcac..0dd1b6c5f30ae4b3afdaa750280aff72ff59173c 100644
|
| --- a/chrome/browser/chromeos/accessibility/chromevox_panel.cc
|
| +++ b/chrome/browser/chromeos/accessibility/chromevox_panel.cc
|
| @@ -132,14 +132,11 @@ void ChromeVoxPanel::DidFirstVisuallyNonEmptyPaint() {
|
| }
|
|
|
| void ChromeVoxPanel::UpdatePanelHeight() {
|
| - ash::WmShelf* shelf =
|
| - ash::WmShelf::ForWindow(ash::WmWindow::Get(GetRootWindow()));
|
| - if (!shelf->IsShelfInitialized())
|
| - return;
|
| + SendPanelHeightToAsh(kPanelHeight);
|
| +}
|
|
|
| - ash::ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager();
|
| - if (shelf_layout_manager)
|
| - shelf_layout_manager->SetChromeVoxPanelHeight(kPanelHeight);
|
| +void ChromeVoxPanel::ResetPanelHeight() {
|
| + SendPanelHeightToAsh(0);
|
| }
|
|
|
| void ChromeVoxPanel::EnterFullscreen() {
|
| @@ -202,3 +199,17 @@ void ChromeVoxPanel::UpdateWidgetBounds() {
|
|
|
| widget_->SetBounds(bounds);
|
| }
|
| +
|
| +void ChromeVoxPanel::SendPanelHeightToAsh(int panel_height) {
|
| + // WmShelf is available for the lifetime of the RootWindowController.
|
| + ash::RootWindowController* root_window_controller =
|
| + ash::RootWindowController::ForWindow(GetRootWindow());
|
| + if (!root_window_controller)
|
| + return;
|
| +
|
| + // TODO(mash): Replace with shelf mojo API.
|
| + ash::ShelfLayoutManager* shelf_layout_manager =
|
| + root_window_controller->GetShelf()->shelf_layout_manager();
|
| + if (shelf_layout_manager)
|
| + shelf_layout_manager->SetChromeVoxPanelHeight(panel_height);
|
| +}
|
|
|