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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 SetSize( | 49 SetSize( |
| 50 gfx::Size(GetShelfConstant(SHELF_SIZE), GetShelfConstant(SHELF_SIZE))); | 50 gfx::Size(GetShelfConstant(SHELF_SIZE), GetShelfConstant(SHELF_SIZE))); |
| 51 SetFocusPainter(views::Painter::CreateSolidFocusPainter( | 51 SetFocusPainter(views::Painter::CreateSolidFocusPainter( |
| 52 kFocusBorderColor, gfx::Insets(1, 1, 1, 1))); | 52 kFocusBorderColor, gfx::Insets(1, 1, 1, 1))); |
| 53 set_notify_action(CustomButton::NOTIFY_ON_PRESS); | 53 set_notify_action(CustomButton::NOTIFY_ON_PRESS); |
| 54 } | 54 } |
| 55 | 55 |
| 56 AppListButton::~AppListButton() {} | 56 AppListButton::~AppListButton() {} |
| 57 | 57 |
| 58 void AppListButton::OnAppListShown() { | 58 void AppListButton::OnAppListShown() { |
| 59 AnimateInkDrop(views::InkDropState::ACTIVATED, nullptr); | 59 if (ash::MaterialDesignController::IsShelfMaterial()) { |
| 60 AnimateInkDrop(views::InkDropState::ACTIVATED, nullptr); | |
| 61 } else { | |
|
James Cook
2016/07/07 17:34:26
nit: } { not needed
xiyuan
2016/07/07 17:38:29
Done.
| |
| 62 SchedulePaint(); | |
| 63 } | |
| 60 } | 64 } |
| 61 | 65 |
| 62 void AppListButton::OnAppListDismissed() { | 66 void AppListButton::OnAppListDismissed() { |
| 63 AnimateInkDrop(views::InkDropState::DEACTIVATED, nullptr); | 67 if (ash::MaterialDesignController::IsShelfMaterial()) { |
| 68 AnimateInkDrop(views::InkDropState::DEACTIVATED, nullptr); | |
| 69 } else { | |
| 70 SchedulePaint(); | |
| 71 } | |
| 64 } | 72 } |
| 65 | 73 |
| 66 bool AppListButton::OnMousePressed(const ui::MouseEvent& event) { | 74 bool AppListButton::OnMousePressed(const ui::MouseEvent& event) { |
| 67 ImageButton::OnMousePressed(event); | 75 ImageButton::OnMousePressed(event); |
| 68 shelf_view_->PointerPressedOnButton(this, ShelfView::MOUSE, event); | 76 shelf_view_->PointerPressedOnButton(this, ShelfView::MOUSE, event); |
| 69 return true; | 77 return true; |
| 70 } | 78 } |
| 71 | 79 |
| 72 void AppListButton::OnMouseReleased(const ui::MouseEvent& event) { | 80 void AppListButton::OnMouseReleased(const ui::MouseEvent& event) { |
| 73 ImageButton::OnMouseReleased(event); | 81 ImageButton::OnMouseReleased(event); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 275 } | 283 } |
| 276 | 284 |
| 277 void AppListButton::SetDrawBackgroundAsActive(bool draw_background_as_active) { | 285 void AppListButton::SetDrawBackgroundAsActive(bool draw_background_as_active) { |
| 278 if (draw_background_as_active_ == draw_background_as_active) | 286 if (draw_background_as_active_ == draw_background_as_active) |
| 279 return; | 287 return; |
| 280 draw_background_as_active_ = draw_background_as_active; | 288 draw_background_as_active_ = draw_background_as_active; |
| 281 SchedulePaint(); | 289 SchedulePaint(); |
| 282 } | 290 } |
| 283 | 291 |
| 284 } // namespace ash | 292 } // namespace ash |
| OLD | NEW |