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

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

Issue 2802903003: Implementation of a full screen app list and re-alphabetized switches (Closed)
Patch Set: Addressed comments, added my tests to the filter, and refactored! Created 3 years, 8 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/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/public/cpp/shelf_types.h" 8 #include "ash/public/cpp/shelf_types.h"
9 #include "ash/public/cpp/shell_window_ids.h" 9 #include "ash/public/cpp/shell_window_ids.h"
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // UI layout when AppListView visibility changes. 92 // UI layout when AppListView visibility changes.
93 ash::Shell::GetPrimaryRootWindowController() 93 ash::Shell::GetPrimaryRootWindowController()
94 ->GetShelfLayoutManager() 94 ->GetShelfLayoutManager()
95 ->UpdateAutoHideState(); 95 ->UpdateAutoHideState();
96 view_ = view; 96 view_ = view;
97 WmWindow* wm_root_window = 97 WmWindow* wm_root_window =
98 ShellPort::Get()->GetRootWindowForDisplayId(display_id); 98 ShellPort::Get()->GetRootWindowForDisplayId(display_id);
99 aura::Window* root_window = wm_root_window->aura_window(); 99 aura::Window* root_window = wm_root_window->aura_window();
100 aura::Window* container = GetRootWindowController(root_window) 100 aura::Window* container = GetRootWindowController(root_window)
101 ->GetContainer(kShellWindowId_AppListContainer); 101 ->GetContainer(kShellWindowId_AppListContainer);
102 view->InitAsBubble(container, current_apps_page); 102 view->Initialize(
103 // The app list is centered over the display. 103 container, current_apps_page,
104 view->SetAnchorPoint(GetCenterOfDisplayForWindow( 104 ash::ScreenUtil::GetDisplayWorkAreaBoundsInParent(container));
105 wm_root_window, GetMinimumBoundsHeightForAppList(view)));
106 105
106 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
107 app_list::switches::kEnableFullscreenAppList)) {
108 view->MaybeSetAnchorPoint(GetCenterOfDisplayForWindow(
109 wm_root_window, GetMinimumBoundsHeightForAppList(view)));
110 }
107 keyboard::KeyboardController* keyboard_controller = 111 keyboard::KeyboardController* keyboard_controller =
108 keyboard::KeyboardController::GetInstance(); 112 keyboard::KeyboardController::GetInstance();
109 if (keyboard_controller) 113 if (keyboard_controller)
110 keyboard_controller->AddObserver(this); 114 keyboard_controller->AddObserver(this);
111 Shell::Get()->AddPreTargetHandler(this); 115 Shell::Get()->AddPreTargetHandler(this);
112 WmShelf* shelf = WmShelf::ForWindow(wm_root_window); 116 WmShelf* shelf = WmShelf::ForWindow(wm_root_window);
113 shelf->AddObserver(this); 117 shelf->AddObserver(this);
114 118
115 // By setting us as DnD recipient, the app list knows that we can 119 // By setting us as DnD recipient, the app list knows that we can
116 // handle items. 120 // handle items.
(...skipping 24 matching lines...) Expand all
141 WmShelf::ForWindow(window)->shelf_widget()->GetAppListButton(); 145 WmShelf::ForWindow(window)->shelf_widget()->GetAppListButton();
142 if (app_list_button) 146 if (app_list_button)
143 app_list_button->OnAppListDismissed(); 147 app_list_button->OnAppListDismissed();
144 } 148 }
145 149
146 void AppListPresenterDelegate::UpdateBounds() { 150 void AppListPresenterDelegate::UpdateBounds() {
147 if (!view_ || !is_visible_) 151 if (!view_ || !is_visible_)
148 return; 152 return;
149 153
150 view_->UpdateBounds(); 154 view_->UpdateBounds();
151 view_->SetAnchorPoint(GetCenterOfDisplayForWindow( 155 view_->MaybeSetAnchorPoint(GetCenterOfDisplayForWindow(
152 WmWindow::Get(view_->GetWidget()->GetNativeWindow()), 156 WmWindow::Get(view_->GetWidget()->GetNativeWindow()),
153 GetMinimumBoundsHeightForAppList(view_))); 157 GetMinimumBoundsHeightForAppList(view_)));
154 } 158 }
155 159
156 gfx::Vector2d AppListPresenterDelegate::GetVisibilityAnimationOffset( 160 gfx::Vector2d AppListPresenterDelegate::GetVisibilityAnimationOffset(
157 aura::Window* root_window) { 161 aura::Window* root_window) {
158 DCHECK(Shell::HasInstance()); 162 DCHECK(Shell::HasInstance());
159 163
160 // App list needs to know the new shelf layout in order to calculate its 164 // App list needs to know the new shelf layout in order to calculate its
161 // UI layout when AppListView visibility changes. 165 // UI layout when AppListView visibility changes.
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 } 243 }
240 244
241 //////////////////////////////////////////////////////////////////////////////// 245 ////////////////////////////////////////////////////////////////////////////////
242 // AppListPresenterDelegate, WmShelfObserver implementation: 246 // AppListPresenterDelegate, WmShelfObserver implementation:
243 247
244 void AppListPresenterDelegate::OnShelfIconPositionsChanged() { 248 void AppListPresenterDelegate::OnShelfIconPositionsChanged() {
245 UpdateBounds(); 249 UpdateBounds();
246 } 250 }
247 251
248 } // namespace ash 252 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698