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

Unified Diff: ash/shelf/shelf.cc

Issue 2898743002: Draggable peeking/fullscreen launcher with transparent background. (Closed)
Patch Set: Rebased to resolve merge conflicts, Refactored to use observers, addressed comments, and disabled a… Created 3 years, 7 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
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

Powered by Google App Engine
This is Rietveld 408576698