Chromium Code Reviews| 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() {} |