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

Unified Diff: ash/app_list/app_list_presenter_delegate.cc

Issue 2288993002: ash: Move AppList support to ShelfWidget, expose ShelfWidget in WmShelf (Closed)
Patch Set: missed one unit test Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/common/shelf/shelf.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/app_list/app_list_presenter_delegate.cc
diff --git a/ash/app_list/app_list_presenter_delegate.cc b/ash/app_list/app_list_presenter_delegate.cc
index c7e8c91b1ecc46e0a449749b00c031588dec679b..bb485517dcbf8c393397938c01ffda45c8cd93cb 100644
--- a/ash/app_list/app_list_presenter_delegate.cc
+++ b/ash/app_list/app_list_presenter_delegate.cc
@@ -7,7 +7,6 @@
#include "ash/aura/wm_window_aura.h"
#include "ash/common/ash_switches.h"
#include "ash/common/shelf/app_list_button.h"
-#include "ash/common/shelf/shelf.h"
#include "ash/common/shelf/shelf_layout_manager.h"
#include "ash/common/shelf/shelf_types.h"
#include "ash/common/shelf/wm_shelf.h"
@@ -44,7 +43,7 @@ const int kMinimalAnchorPositionOffset = 57;
// Gets arrow location based on shelf alignment.
views::BubbleBorder::Arrow GetBubbleArrow(aura::Window* window) {
DCHECK(Shell::HasInstance());
- WmShelf* shelf = Shelf::ForWindow(WmWindowAura::Get(window))->wm_shelf();
+ WmShelf* shelf = WmShelf::ForWindow(WmWindowAura::Get(window));
switch (shelf->alignment()) {
case SHELF_ALIGNMENT_BOTTOM:
case SHELF_ALIGNMENT_BOTTOM_LOCKED:
@@ -64,8 +63,7 @@ gfx::Vector2d GetAnchorPositionOffsetToShelf(const gfx::Rect& button_bounds,
views::Widget* widget) {
DCHECK(Shell::HasInstance());
ShelfAlignment shelf_alignment =
- Shelf::ForWindow(WmLookup::Get()->GetWindowForWidget(widget))
- ->wm_shelf()
+ WmShelf::ForWindow(WmLookup::Get()->GetWindowForWidget(widget))
->alignment();
gfx::Point anchor(button_bounds.CenterPoint());
switch (shelf_alignment) {
@@ -168,8 +166,8 @@ void AppListPresenterDelegate::Init(app_list::AppListView* view,
->GetRootWindowForDisplayId(display_id);
aura::Window* container = GetRootWindowController(root_window)
->GetContainer(kShellWindowId_AppListContainer);
- Shelf* shelf = Shelf::ForWindow(WmWindowAura::Get(container));
- AppListButton* applist_button = shelf->GetAppListButton();
+ WmShelf* shelf = WmShelf::ForWindow(WmWindowAura::Get(container));
+ AppListButton* applist_button = shelf->shelf_widget()->GetAppListButton();
is_centered_ = view->ShouldCenterWindow();
bool is_fullscreen = IsFullscreenAppListEnabled() &&
WmShell::Get()
@@ -214,14 +212,17 @@ void AppListPresenterDelegate::Init(app_list::AppListView* view,
// By setting us as DnD recipient, the app list knows that we can
// handle items.
view->SetDragAndDropHostOfCurrentAppList(
- shelf->GetDragAndDropHostForAppList());
+ shelf->shelf_widget()->GetDragAndDropHostForAppList());
}
void AppListPresenterDelegate::OnShown(int64_t display_id) {
is_visible_ = true;
// Update applist button status when app list visibility is changed.
WmWindow* root_window = WmShell::Get()->GetRootWindowForDisplayId(display_id);
- Shelf::ForWindow(root_window)->GetAppListButton()->OnAppListShown();
+ WmShelf::ForWindow(root_window)
+ ->shelf_widget()
+ ->GetAppListButton()
+ ->OnAppListShown();
}
void AppListPresenterDelegate::OnDismissed() {
@@ -232,12 +233,12 @@ void AppListPresenterDelegate::OnDismissed() {
// App list needs to know the new shelf layout in order to calculate its
// UI layout when AppListView visibility changes.
- Shelf* shelf =
- Shelf::ForWindow(WmLookup::Get()->GetWindowForWidget(view_->GetWidget()));
- shelf->shelf_layout_manager()->UpdateAutoHideState();
+ WmShelf* shelf = WmShelf::ForWindow(
+ WmLookup::Get()->GetWindowForWidget(view_->GetWidget()));
+ shelf->UpdateAutoHideState();
// Update applist button status when app list visibility is changed.
- shelf->GetAppListButton()->OnAppListDismissed();
+ shelf->shelf_widget()->GetAppListButton()->OnAppListDismissed();
}
void AppListPresenterDelegate::UpdateBounds() {
@@ -258,10 +259,10 @@ gfx::Vector2d AppListPresenterDelegate::GetVisibilityAnimationOffset(
// App list needs to know the new shelf layout in order to calculate its
// UI layout when AppListView visibility changes.
- Shelf* shelf = Shelf::ForWindow(WmWindowAura::Get(root_window));
- shelf->shelf_layout_manager()->UpdateAutoHideState();
+ WmShelf* shelf = WmShelf::ForWindow(WmWindowAura::Get(root_window));
+ shelf->UpdateAutoHideState();
- switch (shelf->wm_shelf()->alignment()) {
+ switch (shelf->alignment()) {
case SHELF_ALIGNMENT_BOTTOM:
case SHELF_ALIGNMENT_BOTTOM_LOCKED:
return gfx::Vector2d(0, kAnimationOffset);
« no previous file with comments | « no previous file | ash/common/shelf/shelf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698