| Index: ash/shelf/shelf.cc
|
| diff --git a/ash/shelf/shelf.cc b/ash/shelf/shelf.cc
|
| index dce85c9d256cd602c706d022184800ea776c7ae3..2bfa69902fe1734d078038992063ce4fbd5ec92d 100644
|
| --- a/ash/shelf/shelf.cc
|
| +++ b/ash/shelf/shelf.cc
|
| @@ -9,6 +9,7 @@
|
| #include "ash/public/cpp/shell_window_ids.h"
|
| #include "ash/root_window_controller.h"
|
| #include "ash/session/session_controller.h"
|
| +#include "ash/shelf/app_list_button.h"
|
| #include "ash/shelf/shelf_bezel_event_handler.h"
|
| #include "ash/shelf/shelf_controller.h"
|
| #include "ash/shelf/shelf_layout_manager.h"
|
| @@ -18,6 +19,7 @@
|
| #include "ash/shell.h"
|
| #include "base/logging.h"
|
| #include "base/memory/ptr_util.h"
|
| +#include "ui/app_list/app_list_features.h"
|
| #include "ui/display/types/display_constants.h"
|
| #include "ui/gfx/geometry/rect.h"
|
|
|
| @@ -67,9 +69,12 @@ Shelf::Shelf() : shelf_locking_manager_(this) {
|
| // http://crbug.com/636647
|
| if (Shell::GetAshConfig() != Config::MASH)
|
| bezel_event_handler_ = base::MakeUnique<ShelfBezelEventHandler>(this);
|
| + Shell::Get()->AddShellObserver(this);
|
| }
|
|
|
| -Shelf::~Shelf() {}
|
| +Shelf::~Shelf() {
|
| + Shell::Get()->RemoveShellObserver(this);
|
| +}
|
|
|
| // static
|
| Shelf* Shelf::ForWindow(aura::Window* window) {
|
| @@ -323,6 +328,10 @@ ShelfView* Shelf::GetShelfViewForTesting() {
|
| return shelf_widget_->shelf_view_for_testing();
|
| }
|
|
|
| +void Shelf::OnAppListIsActive() {
|
| + shelf_layout_manager()->OnAppListIsActive();
|
| +}
|
| +
|
| void Shelf::WillDeleteShelfLayoutManager() {
|
| if (Shell::GetAshConfig() == Config::MASH) {
|
| // TODO(sky): this should be removed once Shell is used everywhere.
|
| @@ -363,4 +372,17 @@ void Shelf::OnBackgroundUpdated(ShelfBackgroundType background_type,
|
| observer.OnBackgroundTypeChanged(background_type, change_type);
|
| }
|
|
|
| +void Shelf::OnAppListShownOrDismissed(bool shown, aura::Window* root_window) {
|
| + // Check if the AppList was shown on this display.
|
| + if (shelf_widget() == Shelf::ForWindow(root_window)->shelf_widget()) {
|
| + if (shown) {
|
| + shelf_widget()->GetAppListButton()->OnAppListShown();
|
| + } else {
|
| + shelf_widget()->GetAppListButton()->OnAppListDismissed();
|
| + }
|
| + if (app_list::features::IsFullscreenAppListEnabled())
|
| + OnAppListIsActive();
|
| + }
|
| +}
|
| +
|
| } // namespace ash
|
|
|