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

Side by Side Diff: chrome/browser/chromeos/accessibility/chromevox_panel.cc

Issue 2293183002: ash: Remove ash::Shelf in favor of ash::WmShelf (Closed)
Patch Set: rebase Created 4 years, 3 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 unified diff | Download patch
OLDNEW
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/aura/wm_window_aura.h" 5 #include "ash/aura/wm_window_aura.h"
6 #include "ash/common/accessibility_types.h" 6 #include "ash/common/accessibility_types.h"
7 #include "ash/common/shelf/shelf.h"
8 #include "ash/common/shelf/shelf_layout_manager.h" 7 #include "ash/common/shelf/shelf_layout_manager.h"
8 #include "ash/common/shelf/wm_shelf.h"
9 #include "ash/common/shell_window_ids.h" 9 #include "ash/common/shell_window_ids.h"
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
11 #include "ash/shell.h" 11 #include "ash/shell.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 13 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
14 #include "chrome/browser/chromeos/accessibility/chromevox_panel.h" 14 #include "chrome/browser/chromeos/accessibility/chromevox_panel.h"
15 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" 15 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
16 #include "chrome/common/extensions/extension_constants.h" 16 #include "chrome/common/extensions/extension_constants.h"
17 #include "content/public/browser/web_contents.h" 17 #include "content/public/browser/web_contents.h"
18 #include "extensions/browser/view_type_utils.h" 18 #include "extensions/browser/view_type_utils.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 void ChromeVoxPanel::Close() { 109 void ChromeVoxPanel::Close() {
110 widget_->Close(); 110 widget_->Close();
111 } 111 }
112 112
113 void ChromeVoxPanel::DidFirstVisuallyNonEmptyPaint() { 113 void ChromeVoxPanel::DidFirstVisuallyNonEmptyPaint() {
114 widget_->Show(); 114 widget_->Show();
115 UpdatePanelHeight(); 115 UpdatePanelHeight();
116 } 116 }
117 117
118 void ChromeVoxPanel::UpdatePanelHeight() { 118 void ChromeVoxPanel::UpdatePanelHeight() {
119 ash::Shelf* shelf = 119 ash::WmShelf* shelf =
120 ash::Shelf::ForWindow(ash::WmWindowAura::Get(GetRootWindow())); 120 ash::WmShelf::ForWindow(ash::WmWindowAura::Get(GetRootWindow()));
121 if (!shelf) 121 if (!shelf->IsShelfCreated())
msw 2016/08/30 22:02:07 nit: maybe skip this and just let the shelf layout
James Cook 2016/08/30 23:00:57 ditto
122 return; 122 return;
123 123
124 ash::ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager(); 124 ash::ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager();
125 if (shelf_layout_manager) 125 if (shelf_layout_manager)
126 shelf_layout_manager->SetChromeVoxPanelHeight(kPanelHeight); 126 shelf_layout_manager->SetChromeVoxPanelHeight(kPanelHeight);
127 } 127 }
128 128
129 void ChromeVoxPanel::EnterFullscreen() { 129 void ChromeVoxPanel::EnterFullscreen() {
130 Focus(); 130 Focus();
131 panel_fullscreen_ = true; 131 panel_fullscreen_ = true;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 // If we're in full-screen mode, give the panel a height of 0 unless 179 // If we're in full-screen mode, give the panel a height of 0 unless
180 // it's active. 180 // it's active.
181 if (ash::GetRootWindowController(GetRootWindow()) 181 if (ash::GetRootWindowController(GetRootWindow())
182 ->GetWindowForFullscreenMode() && 182 ->GetWindowForFullscreenMode() &&
183 !widget_->IsActive()) { 183 !widget_->IsActive()) {
184 bounds.set_height(0); 184 bounds.set_height(0);
185 } 185 }
186 186
187 widget_->SetBounds(bounds); 187 widget_->SetBounds(bounds);
188 } 188 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698