| 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.h" | 10 #include "ash/shelf/shelf.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 UpdateWidgetBounds(); | 183 UpdateWidgetBounds(); |
| 184 } | 184 } |
| 185 | 185 |
| 186 void ChromeVoxPanel::UpdateWidgetBounds() { | 186 void ChromeVoxPanel::UpdateWidgetBounds() { |
| 187 gfx::Rect bounds(GetRootWindow()->bounds().size()); | 187 gfx::Rect bounds(GetRootWindow()->bounds().size()); |
| 188 if (!panel_fullscreen_) | 188 if (!panel_fullscreen_) |
| 189 bounds.set_height(kPanelHeight); | 189 bounds.set_height(kPanelHeight); |
| 190 | 190 |
| 191 // If we're in full-screen mode, give the panel a height of 0 unless | 191 // If we're in full-screen mode, give the panel a height of 0 unless |
| 192 // it's active. | 192 // it's active. |
| 193 if (ash::GetRootWindowController(GetRootWindow()) | 193 if (ash::RootWindowController::ForWindow(GetRootWindow()) |
| 194 ->GetWindowForFullscreenMode() && | 194 ->GetWindowForFullscreenMode() && |
| 195 !widget_->IsActive()) { | 195 !widget_->IsActive()) { |
| 196 bounds.set_height(0); | 196 bounds.set_height(0); |
| 197 } | 197 } |
| 198 | 198 |
| 199 widget_->SetBounds(bounds); | 199 widget_->SetBounds(bounds); |
| 200 } | 200 } |
| 201 | 201 |
| 202 void ChromeVoxPanel::SendPanelHeightToAsh(int panel_height) { | 202 void ChromeVoxPanel::SendPanelHeightToAsh(int panel_height) { |
| 203 // TODO(mash): Replace with shelf mojo API. | 203 // TODO(mash): Replace with shelf mojo API. |
| 204 ash::Shelf* shelf = ash::Shelf::ForWindow(GetRootWindow()); | 204 ash::Shelf* shelf = ash::Shelf::ForWindow(GetRootWindow()); |
| 205 ash::ShelfLayoutManager* shelf_layout_manager = | 205 ash::ShelfLayoutManager* shelf_layout_manager = |
| 206 shelf ? shelf->shelf_layout_manager() : nullptr; | 206 shelf ? shelf->shelf_layout_manager() : nullptr; |
| 207 if (shelf_layout_manager) | 207 if (shelf_layout_manager) |
| 208 shelf_layout_manager->SetChromeVoxPanelHeight(panel_height); | 208 shelf_layout_manager->SetChromeVoxPanelHeight(panel_height); |
| 209 } | 209 } |
| OLD | NEW |