Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/shelf/app_list_button.h" | 5 #include "ash/shelf/app_list_button.h" |
| 6 | 6 |
| 7 #include "ash/common/ash_constants.h" | 7 #include "ash/common/ash_constants.h" |
| 8 #include "ash/common/material_design/material_design_controller.h" | 8 #include "ash/common/material_design/material_design_controller.h" |
| 9 #include "ash/common/shelf/shelf_constants.h" | 9 #include "ash/common/shelf/shelf_constants.h" |
| 10 #include "ash/common/shelf/shelf_item_types.h" | 10 #include "ash/common/shelf/shelf_item_types.h" |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 260 return base::WrapUnique(ink_drop_ripple); | 260 return base::WrapUnique(ink_drop_ripple); |
| 261 } | 261 } |
| 262 | 262 |
| 263 void AppListButton::NotifyClick(const ui::Event& event) { | 263 void AppListButton::NotifyClick(const ui::Event& event) { |
| 264 ImageButton::NotifyClick(event); | 264 ImageButton::NotifyClick(event); |
| 265 if (listener_) | 265 if (listener_) |
| 266 listener_->ButtonPressed(this, event, ink_drop()); | 266 listener_->ButtonPressed(this, event, ink_drop()); |
| 267 } | 267 } |
| 268 | 268 |
| 269 bool AppListButton::ShouldEnterPushedState(const ui::Event& event) { | 269 bool AppListButton::ShouldEnterPushedState(const ui::Event& event) { |
| 270 return !Shell::GetInstance()->IsApplistVisible(); | 270 if (!shelf_view_->ShouldEventActivateButton(this, event)) |
| 271 return false; | |
| 272 if (Shell::GetInstance()->IsApplistVisible()) | |
| 273 return false; | |
| 274 return views::ImageButton::ShouldEnterPushedState(event); | |
|
Dan Beam
2016/07/08 23:32:28
wat
dschuyler
2016/07/20 19:03:01
Done.
| |
| 271 } | 275 } |
| 272 | 276 |
| 273 bool AppListButton::ShouldShowInkDropHighlight() const { | 277 bool AppListButton::ShouldShowInkDropHighlight() const { |
| 274 return false; | 278 return false; |
| 275 } | 279 } |
| 276 | 280 |
| 277 void AppListButton::SetDrawBackgroundAsActive(bool draw_background_as_active) { | 281 void AppListButton::SetDrawBackgroundAsActive(bool draw_background_as_active) { |
| 278 if (draw_background_as_active_ == draw_background_as_active) | 282 if (draw_background_as_active_ == draw_background_as_active) |
| 279 return; | 283 return; |
| 280 draw_background_as_active_ = draw_background_as_active; | 284 draw_background_as_active_ = draw_background_as_active; |
| 281 SchedulePaint(); | 285 SchedulePaint(); |
| 282 } | 286 } |
| 283 | 287 |
| 284 } // namespace ash | 288 } // namespace ash |
| OLD | NEW |