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

Unified Diff: ash/shelf/app_list_button.cc

Issue 2898743002: Draggable peeking/fullscreen launcher with transparent background. (Closed)
Patch Set: Removed header include in shell.h that was causing gn check failure. Created 3 years, 6 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 | « ash/shelf/app_list_button.h ('k') | ash/shelf/shelf_layout_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/app_list_button.cc
diff --git a/ash/shelf/app_list_button.cc b/ash/shelf/app_list_button.cc
index 584d9d842d223fcaf91911116abcb9d32d96a0be..efecc294aa093c4b389fae44cf1998ee35148f06 100644
--- a/ash/shelf/app_list_button.cc
+++ b/ash/shelf/app_list_button.cc
@@ -44,7 +44,7 @@ AppListButton::AppListButton(InkDropButtonListener* listener,
DCHECK(listener_);
DCHECK(shelf_view_);
DCHECK(shelf_);
-
+ Shell::Get()->AddShellObserver(this);
SetInkDropMode(InkDropMode::ON_NO_GESTURE_HANDLER);
set_ink_drop_base_color(kShelfInkDropBaseColor);
set_ink_drop_visible_opacity(kShelfInkDropVisibleOpacity);
@@ -55,7 +55,9 @@ AppListButton::AppListButton(InkDropButtonListener* listener,
set_notify_action(CustomButton::NOTIFY_ON_PRESS);
}
-AppListButton::~AppListButton() {}
+AppListButton::~AppListButton() {
+ Shell::Get()->RemoveShellObserver(this);
+}
void AppListButton::OnAppListShown() {
AnimateInkDrop(views::InkDropState::ACTIVATED, nullptr);
@@ -239,4 +241,15 @@ gfx::Point AppListButton::GetCenterPoint() const {
}
}
+void AppListButton::OnAppListVisibilityChanged(bool shown,
+ aura::Window* root_window) {
+ if (shelf_ != Shelf::ForWindow(root_window))
+ return;
+
+ if (shown)
+ OnAppListShown();
+ else
+ OnAppListDismissed();
+}
+
} // namespace ash
« no previous file with comments | « ash/shelf/app_list_button.h ('k') | ash/shelf/shelf_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698