| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 void ChromeVoxPanel::Close() { | 125 void ChromeVoxPanel::Close() { |
| 126 widget_->Close(); | 126 widget_->Close(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void ChromeVoxPanel::DidFirstVisuallyNonEmptyPaint() { | 129 void ChromeVoxPanel::DidFirstVisuallyNonEmptyPaint() { |
| 130 widget_->Show(); | 130 widget_->Show(); |
| 131 UpdatePanelHeight(); | 131 UpdatePanelHeight(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void ChromeVoxPanel::UpdatePanelHeight() { | 134 void ChromeVoxPanel::UpdatePanelHeight() { |
| 135 ash::WmShelf* shelf = | 135 ash::WmShelf* shelf = ash::WmShelf::ForWindow(GetRootWindow()); |
| 136 ash::WmShelf::ForWindow(ash::WmWindow::Get(GetRootWindow())); | |
| 137 if (!shelf->IsShelfInitialized()) | 136 if (!shelf->IsShelfInitialized()) |
| 138 return; | 137 return; |
| 139 | 138 |
| 140 ash::ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager(); | 139 ash::ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager(); |
| 141 if (shelf_layout_manager) | 140 if (shelf_layout_manager) |
| 142 shelf_layout_manager->SetChromeVoxPanelHeight(kPanelHeight); | 141 shelf_layout_manager->SetChromeVoxPanelHeight(kPanelHeight); |
| 143 } | 142 } |
| 144 | 143 |
| 145 void ChromeVoxPanel::EnterFullscreen() { | 144 void ChromeVoxPanel::EnterFullscreen() { |
| 146 Focus(); | 145 Focus(); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 // If we're in full-screen mode, give the panel a height of 0 unless | 194 // If we're in full-screen mode, give the panel a height of 0 unless |
| 196 // it's active. | 195 // it's active. |
| 197 if (ash::GetRootWindowController(GetRootWindow()) | 196 if (ash::GetRootWindowController(GetRootWindow()) |
| 198 ->GetWindowForFullscreenMode() && | 197 ->GetWindowForFullscreenMode() && |
| 199 !widget_->IsActive()) { | 198 !widget_->IsActive()) { |
| 200 bounds.set_height(0); | 199 bounds.set_height(0); |
| 201 } | 200 } |
| 202 | 201 |
| 203 widget_->SetBounds(bounds); | 202 widget_->SetBounds(bounds); |
| 204 } | 203 } |
| OLD | NEW |