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

Side by Side Diff: ash/app_list/app_list_presenter_delegate.cc

Issue 2629643002: chromeos: Renames WmWindowAura to WmWindow (Closed)
Patch Set: unnecessary casts Created 3 years, 11 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/app_list/app_list_presenter_delegate.h" 5 #include "ash/app_list/app_list_presenter_delegate.h"
6 6
7 #include "ash/aura/wm_window_aura.h"
8 #include "ash/common/ash_switches.h" 7 #include "ash/common/ash_switches.h"
9 #include "ash/common/shelf/app_list_button.h" 8 #include "ash/common/shelf/app_list_button.h"
10 #include "ash/common/shelf/shelf_layout_manager.h" 9 #include "ash/common/shelf/shelf_layout_manager.h"
11 #include "ash/common/shelf/wm_shelf.h" 10 #include "ash/common/shelf/wm_shelf.h"
12 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" 11 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
13 #include "ash/common/wm/wm_screen_util.h" 12 #include "ash/common/wm/wm_screen_util.h"
14 #include "ash/common/wm_lookup.h" 13 #include "ash/common/wm_lookup.h"
15 #include "ash/common/wm_shell.h" 14 #include "ash/common/wm_shell.h"
16 #include "ash/common/wm_window.h" 15 #include "ash/common/wm_window.h"
17 #include "ash/display/window_tree_host_manager.h" 16 #include "ash/display/window_tree_host_manager.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 int current_apps_page) { 96 int current_apps_page) {
98 // App list needs to know the new shelf layout in order to calculate its 97 // App list needs to know the new shelf layout in order to calculate its
99 // UI layout when AppListView visibility changes. 98 // UI layout when AppListView visibility changes.
100 ash::Shell::GetPrimaryRootWindowController() 99 ash::Shell::GetPrimaryRootWindowController()
101 ->GetShelfLayoutManager() 100 ->GetShelfLayoutManager()
102 ->UpdateAutoHideState(); 101 ->UpdateAutoHideState();
103 view_ = view; 102 view_ = view;
104 aura::Window* root_window = Shell::GetInstance() 103 aura::Window* root_window = Shell::GetInstance()
105 ->window_tree_host_manager() 104 ->window_tree_host_manager()
106 ->GetRootWindowForDisplayId(display_id); 105 ->GetRootWindowForDisplayId(display_id);
107 WmWindow* wm_root_window = WmWindowAura::Get(root_window); 106 WmWindow* wm_root_window = WmWindow::Get(root_window);
108 aura::Window* container = GetRootWindowController(root_window) 107 aura::Window* container = GetRootWindowController(root_window)
109 ->GetContainer(kShellWindowId_AppListContainer); 108 ->GetContainer(kShellWindowId_AppListContainer);
110 bool is_fullscreen = IsFullscreenAppListEnabled() && 109 bool is_fullscreen = IsFullscreenAppListEnabled() &&
111 WmShell::Get() 110 WmShell::Get()
112 ->maximize_mode_controller() 111 ->maximize_mode_controller()
113 ->IsMaximizeModeWindowManagerEnabled(); 112 ->IsMaximizeModeWindowManagerEnabled();
114 if (is_fullscreen) { 113 if (is_fullscreen) {
115 view->InitAsFramelessWindow( 114 view->InitAsFramelessWindow(
116 container, current_apps_page, 115 container, current_apps_page,
117 ScreenUtil::GetDisplayWorkAreaBoundsInParent(container)); 116 ScreenUtil::GetDisplayWorkAreaBoundsInParent(container));
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 WmLookup::Get()->GetWindowForWidget(view_->GetWidget()), 168 WmLookup::Get()->GetWindowForWidget(view_->GetWidget()),
170 GetMinimumBoundsHeightForAppList(view_))); 169 GetMinimumBoundsHeightForAppList(view_)));
171 } 170 }
172 171
173 gfx::Vector2d AppListPresenterDelegate::GetVisibilityAnimationOffset( 172 gfx::Vector2d AppListPresenterDelegate::GetVisibilityAnimationOffset(
174 aura::Window* root_window) { 173 aura::Window* root_window) {
175 DCHECK(Shell::HasInstance()); 174 DCHECK(Shell::HasInstance());
176 175
177 // App list needs to know the new shelf layout in order to calculate its 176 // App list needs to know the new shelf layout in order to calculate its
178 // UI layout when AppListView visibility changes. 177 // UI layout when AppListView visibility changes.
179 WmShelf* shelf = WmShelf::ForWindow(WmWindowAura::Get(root_window)); 178 WmShelf* shelf = WmShelf::ForWindow(WmWindow::Get(root_window));
180 shelf->UpdateAutoHideState(); 179 shelf->UpdateAutoHideState();
181 180
182 switch (shelf->alignment()) { 181 switch (shelf->alignment()) {
183 case SHELF_ALIGNMENT_BOTTOM: 182 case SHELF_ALIGNMENT_BOTTOM:
184 case SHELF_ALIGNMENT_BOTTOM_LOCKED: 183 case SHELF_ALIGNMENT_BOTTOM_LOCKED:
185 return gfx::Vector2d(0, kAnimationOffset); 184 return gfx::Vector2d(0, kAnimationOffset);
186 case SHELF_ALIGNMENT_LEFT: 185 case SHELF_ALIGNMENT_LEFT:
187 return gfx::Vector2d(-kAnimationOffset, 0); 186 return gfx::Vector2d(-kAnimationOffset, 0);
188 case SHELF_ALIGNMENT_RIGHT: 187 case SHELF_ALIGNMENT_RIGHT:
189 return gfx::Vector2d(kAnimationOffset, 0); 188 return gfx::Vector2d(kAnimationOffset, 0);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 } 271 }
273 272
274 //////////////////////////////////////////////////////////////////////////////// 273 ////////////////////////////////////////////////////////////////////////////////
275 // AppListPresenterDelegate, WmShelfObserver implementation: 274 // AppListPresenterDelegate, WmShelfObserver implementation:
276 275
277 void AppListPresenterDelegate::OnShelfIconPositionsChanged() { 276 void AppListPresenterDelegate::OnShelfIconPositionsChanged() {
278 UpdateBounds(); 277 UpdateBounds();
279 } 278 }
280 279
281 } // namespace ash 280 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698