| 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/common/shelf/app_list_button.h" | 5 #include "ash/common/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/ink_drop_button_listener.h" | 9 #include "ash/common/shelf/ink_drop_button_listener.h" |
| 10 #include "ash/common/shelf/shelf_constants.h" | 10 #include "ash/common/shelf/shelf_constants.h" |
| 11 #include "ash/common/shelf/shelf_item_types.h" | 11 #include "ash/common/shelf/shelf_item_types.h" |
| 12 #include "ash/common/shelf/shelf_view.h" | 12 #include "ash/common/shelf/shelf_view.h" |
| 13 #include "ash/common/shelf/wm_shelf.h" | 13 #include "ash/common/shelf/wm_shelf.h" |
| 14 #include "ash/common/shelf/wm_shelf_util.h" | 14 #include "ash/common/shelf/wm_shelf_util.h" |
| 15 #include "ash/common/wm_shell.h" | 15 #include "ash/common/wm_shell.h" |
| 16 #include "ash/public/cpp/shelf_types.h" | 16 #include "ash/public/cpp/shelf_types.h" |
| 17 #include "ash/resources/vector_icons/vector_icons.h" | 17 #include "ash/resources/vector_icons/vector_icons.h" |
| 18 #include "base/command_line.h" | 18 #include "base/command_line.h" |
| 19 #include "grit/ash_resources.h" | 19 #include "grit/ash_resources.h" |
| 20 #include "grit/ash_strings.h" | 20 #include "grit/ash_strings.h" |
| 21 #include "ui/accessibility/ax_node_data.h" | 21 #include "ui/accessibility/ax_node_data.h" |
| 22 #include "ui/app_list/app_list_switches.h" | 22 #include "ui/app_list/app_list_switches.h" |
| 23 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
| 24 #include "ui/base/resource/resource_bundle.h" | 24 #include "ui/base/resource/resource_bundle.h" |
| 25 #include "ui/gfx/canvas.h" | 25 #include "ui/gfx/canvas.h" |
| 26 #include "ui/gfx/paint_vector_icon.h" | 26 #include "ui/gfx/paint_vector_icon.h" |
| 27 #include "ui/views/animation/ink_drop_impl.h" |
| 27 #include "ui/views/animation/square_ink_drop_ripple.h" | 28 #include "ui/views/animation/square_ink_drop_ripple.h" |
| 28 #include "ui/views/painter.h" | 29 #include "ui/views/painter.h" |
| 29 | 30 |
| 30 namespace ash { | 31 namespace ash { |
| 31 | 32 |
| 32 AppListButton::AppListButton(InkDropButtonListener* listener, | 33 AppListButton::AppListButton(InkDropButtonListener* listener, |
| 33 ShelfView* shelf_view, | 34 ShelfView* shelf_view, |
| 34 WmShelf* wm_shelf) | 35 WmShelf* wm_shelf) |
| 35 : views::ImageButton(nullptr), | 36 : views::ImageButton(nullptr), |
| 36 draw_background_as_active_(false), | 37 draw_background_as_active_(false), |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 } | 269 } |
| 269 | 270 |
| 270 bool AppListButton::ShouldEnterPushedState(const ui::Event& event) { | 271 bool AppListButton::ShouldEnterPushedState(const ui::Event& event) { |
| 271 if (!shelf_view_->ShouldEventActivateButton(this, event)) | 272 if (!shelf_view_->ShouldEventActivateButton(this, event)) |
| 272 return false; | 273 return false; |
| 273 if (WmShell::Get()->IsApplistVisible()) | 274 if (WmShell::Get()->IsApplistVisible()) |
| 274 return false; | 275 return false; |
| 275 return views::ImageButton::ShouldEnterPushedState(event); | 276 return views::ImageButton::ShouldEnterPushedState(event); |
| 276 } | 277 } |
| 277 | 278 |
| 278 bool AppListButton::ShouldShowInkDropHighlight() const { | 279 std::unique_ptr<views::InkDrop> AppListButton::CreateInkDrop() { |
| 279 return false; | 280 std::unique_ptr<views::InkDropImpl> ink_drop = |
| 281 CustomButton::CreateDefaultInkDropImpl(); |
| 282 ink_drop->SetShowHighlightOnHover(false); |
| 283 return std::move(ink_drop); |
| 280 } | 284 } |
| 281 | 285 |
| 282 void AppListButton::SetDrawBackgroundAsActive(bool draw_background_as_active) { | 286 void AppListButton::SetDrawBackgroundAsActive(bool draw_background_as_active) { |
| 283 if (draw_background_as_active_ == draw_background_as_active) | 287 if (draw_background_as_active_ == draw_background_as_active) |
| 284 return; | 288 return; |
| 285 draw_background_as_active_ = draw_background_as_active; | 289 draw_background_as_active_ = draw_background_as_active; |
| 286 SchedulePaint(); | 290 SchedulePaint(); |
| 287 } | 291 } |
| 288 | 292 |
| 289 } // namespace ash | 293 } // namespace ash |
| OLD | NEW |