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

Unified Diff: ash/common/system/overview/overview_button_tray.cc

Issue 2499453002: Add ink drop ripple to overview mode button (Closed)
Patch Set: Fixed crash when there is no window Created 4 years, 1 month 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/common/system/overview/overview_button_tray.cc
diff --git a/ash/common/system/overview/overview_button_tray.cc b/ash/common/system/overview/overview_button_tray.cc
index f88134f04213d3c94ee58a0624651ae6f70a7d93..1d510e389d0eb962735e959ab826fefa90060910 100644
--- a/ash/common/system/overview/overview_button_tray.cc
+++ b/ash/common/system/overview/overview_button_tray.cc
@@ -39,14 +39,15 @@ namespace ash {
OverviewButtonTray::OverviewButtonTray(WmShelf* wm_shelf)
: TrayBackgroundView(wm_shelf), icon_(nullptr) {
- SetContentsBackground();
-
icon_ = new views::ImageView();
if (MaterialDesignController::IsShelfMaterial()) {
+ SetInkDropMode(InkDropMode::ON);
+ SetContentsBackground(false);
gfx::ImageSkia image_md =
CreateVectorIcon(gfx::VectorIconId::SHELF_OVERVIEW, kShelfIconColor);
icon_->SetImage(image_md);
} else {
+ SetContentsBackground(true);
gfx::ImageSkia* image_non_md =
ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
IDR_AURA_UBER_TRAY_OVERVIEW_MODE);
@@ -71,10 +72,10 @@ void OverviewButtonTray::UpdateAfterLoginStatusChange(LoginStatus status) {
bool OverviewButtonTray::PerformAction(const ui::Event& event) {
WindowSelectorController* controller =
WmShell::Get()->window_selector_controller();
+ bool was_selecting = controller->IsSelecting();
controller->ToggleOverview();
bruthig 2016/11/11 17:30:40 nit: Consider changing ToggleOverview() to return
mohsen 2016/11/11 22:37:24 Done.
- SetDrawBackgroundAsActive(controller->IsSelecting());
WmShell::Get()->RecordUserMetricsAction(UMA_TRAY_OVERVIEW);
- return true;
+ return was_selecting != controller->IsSelecting();
bruthig 2016/11/11 17:30:40 nit: it would be useful to have a comment here as
mohsen 2016/11/11 22:37:24 Done.
}
void OverviewButtonTray::SessionStateChanged(
@@ -90,8 +91,12 @@ void OverviewButtonTray::OnMaximizeModeEnded() {
UpdateIconVisibility();
}
+void OverviewButtonTray::OnOverviewModeStarting() {
+ SetIsActive(true);
+}
+
void OverviewButtonTray::OnOverviewModeEnded() {
- SetDrawBackgroundAsActive(false);
+ SetIsActive(false);
}
void OverviewButtonTray::ClickedOutsideBubble() {}

Powered by Google App Engine
This is Rietveld 408576698