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 "ash/shelf/shelf.h" | 5 #include "ash/shelf/shelf.h" |
6 #include "ash/shelf/shelf_layout_manager.h" | 6 #include "ash/shelf/shelf_layout_manager.h" |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 10 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 aura::Window* ChromeVoxPanel::GetRootWindow() { | 102 aura::Window* ChromeVoxPanel::GetRootWindow() { |
103 return GetWidget()->GetNativeWindow()->GetRootWindow(); | 103 return GetWidget()->GetNativeWindow()->GetRootWindow(); |
104 } | 104 } |
105 | 105 |
106 void ChromeVoxPanel::Close() { | 106 void ChromeVoxPanel::Close() { |
107 widget_->Close(); | 107 widget_->Close(); |
108 } | 108 } |
109 | 109 |
110 void ChromeVoxPanel::DidFirstVisuallyNonEmptyPaint() { | 110 void ChromeVoxPanel::DidFirstVisuallyNonEmptyPaint() { |
111 widget_->Show(); | 111 widget_->Show(); |
112 ash::Shelf::ForWindow(GetRootWindow()) | 112 UpdatePanelHeight(); |
113 ->shelf_layout_manager() | 113 } |
114 ->SetChromeVoxPanelHeight(kPanelHeight); | 114 |
| 115 void ChromeVoxPanel::UpdatePanelHeight() { |
| 116 ash::Shelf* shelf = ash::Shelf::ForWindow(GetRootWindow()); |
| 117 if (!shelf) |
| 118 return; |
| 119 |
| 120 ash::ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager(); |
| 121 if (shelf_layout_manager) |
| 122 shelf_layout_manager->SetChromeVoxPanelHeight(kPanelHeight); |
115 } | 123 } |
116 | 124 |
117 void ChromeVoxPanel::EnterFullscreen() { | 125 void ChromeVoxPanel::EnterFullscreen() { |
118 Focus(); | 126 Focus(); |
119 fullscreen_ = true; | 127 fullscreen_ = true; |
120 UpdateWidgetBounds(); | 128 UpdateWidgetBounds(); |
121 } | 129 } |
122 | 130 |
123 void ChromeVoxPanel::ExitFullscreen() { | 131 void ChromeVoxPanel::ExitFullscreen() { |
124 widget_->widget_delegate()->set_can_activate(false); | 132 widget_->widget_delegate()->set_can_activate(false); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 uint32_t changed_metrics) { | 165 uint32_t changed_metrics) { |
158 UpdateWidgetBounds(); | 166 UpdateWidgetBounds(); |
159 } | 167 } |
160 | 168 |
161 void ChromeVoxPanel::UpdateWidgetBounds() { | 169 void ChromeVoxPanel::UpdateWidgetBounds() { |
162 gfx::Rect bounds(GetRootWindow()->bounds().size()); | 170 gfx::Rect bounds(GetRootWindow()->bounds().size()); |
163 if (!fullscreen_) | 171 if (!fullscreen_) |
164 bounds.set_height(kPanelHeight); | 172 bounds.set_height(kPanelHeight); |
165 widget_->SetBounds(bounds); | 173 widget_->SetBounds(bounds); |
166 } | 174 } |
OLD | NEW |