| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/accessibility/chromevox_panel.h" | 5 #include "chrome/browser/chromeos/accessibility/chromevox_panel.h" |
| 6 | 6 |
| 7 #include "ash/accessibility_types.h" | 7 #include "ash/accessibility_types.h" |
| 8 #include "ash/public/cpp/shell_window_ids.h" | 8 #include "ash/public/cpp/shell_window_ids.h" |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 if (ash::GetRootWindowController(GetRootWindow()) | 194 if (ash::GetRootWindowController(GetRootWindow()) |
| 195 ->GetWindowForFullscreenMode() && | 195 ->GetWindowForFullscreenMode() && |
| 196 !widget_->IsActive()) { | 196 !widget_->IsActive()) { |
| 197 bounds.set_height(0); | 197 bounds.set_height(0); |
| 198 } | 198 } |
| 199 | 199 |
| 200 widget_->SetBounds(bounds); | 200 widget_->SetBounds(bounds); |
| 201 } | 201 } |
| 202 | 202 |
| 203 void ChromeVoxPanel::SendPanelHeightToAsh(int panel_height) { | 203 void ChromeVoxPanel::SendPanelHeightToAsh(int panel_height) { |
| 204 // WmShelf is available for the lifetime of the RootWindowController. | |
| 205 ash::RootWindowController* root_window_controller = | |
| 206 ash::RootWindowController::ForWindow(GetRootWindow()); | |
| 207 if (!root_window_controller) | |
| 208 return; | |
| 209 | |
| 210 // TODO(mash): Replace with shelf mojo API. | 204 // TODO(mash): Replace with shelf mojo API. |
| 205 ash::WmShelf* shelf = ash::WmShelf::ForWindow(GetRootWindow()); |
| 211 ash::ShelfLayoutManager* shelf_layout_manager = | 206 ash::ShelfLayoutManager* shelf_layout_manager = |
| 212 root_window_controller->GetShelf()->shelf_layout_manager(); | 207 shelf ? shelf->shelf_layout_manager() : nullptr; |
| 213 if (shelf_layout_manager) | 208 if (shelf_layout_manager) |
| 214 shelf_layout_manager->SetChromeVoxPanelHeight(panel_height); | 209 shelf_layout_manager->SetChromeVoxPanelHeight(panel_height); |
| 215 } | 210 } |
| OLD | NEW |