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

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

Issue 2889673002: chromeos: Refactor shelf to create ShelfView earlier in startup (Closed)
Patch Set: rebase Created 3 years, 7 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/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);
+}

Powered by Google App Engine
This is Rietveld 408576698