| 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" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 } | 274 } |
| 275 | 275 |
| 276 std::unique_ptr<views::InkDrop> AppListButton::CreateInkDrop() { | 276 std::unique_ptr<views::InkDrop> AppListButton::CreateInkDrop() { |
| 277 std::unique_ptr<views::InkDropImpl> ink_drop = | 277 std::unique_ptr<views::InkDropImpl> ink_drop = |
| 278 CustomButton::CreateDefaultInkDropImpl(); | 278 CustomButton::CreateDefaultInkDropImpl(); |
| 279 ink_drop->SetShowHighlightOnHover(false); | 279 ink_drop->SetShowHighlightOnHover(false); |
| 280 return std::move(ink_drop); | 280 return std::move(ink_drop); |
| 281 } | 281 } |
| 282 | 282 |
| 283 std::unique_ptr<views::InkDropMask> AppListButton::CreateInkDropMask() const { | 283 std::unique_ptr<views::InkDropMask> AppListButton::CreateInkDropMask() const { |
| 284 return base::MakeUnique<views::CircleInkDropMask>( | 284 return base::MakeUnique<views::CircleInkDropMask>(size(), GetCenterPoint(), |
| 285 GetLocalBounds(), GetCenterPoint(), kAppListButtonRadius); | 285 kAppListButtonRadius); |
| 286 } | 286 } |
| 287 | 287 |
| 288 void AppListButton::SetDrawBackgroundAsActive(bool draw_background_as_active) { | 288 void AppListButton::SetDrawBackgroundAsActive(bool draw_background_as_active) { |
| 289 if (draw_background_as_active_ == draw_background_as_active) | 289 if (draw_background_as_active_ == draw_background_as_active) |
| 290 return; | 290 return; |
| 291 draw_background_as_active_ = draw_background_as_active; | 291 draw_background_as_active_ = draw_background_as_active; |
| 292 SchedulePaint(); | 292 SchedulePaint(); |
| 293 } | 293 } |
| 294 | 294 |
| 295 gfx::Point AppListButton::GetCenterPoint() const { | 295 gfx::Point AppListButton::GetCenterPoint() const { |
| 296 gfx::Point center = GetContentsBounds().CenterPoint(); | 296 gfx::Point center = GetContentsBounds().CenterPoint(); |
| 297 if (!IsHorizontalAlignment(wm_shelf_->GetAlignment())) | 297 if (!IsHorizontalAlignment(wm_shelf_->GetAlignment())) |
| 298 center = gfx::Point(center.y(), center.x()); | 298 center = gfx::Point(center.y(), center.x()); |
| 299 return center; | 299 return center; |
| 300 } | 300 } |
| 301 | 301 |
| 302 } // namespace ash | 302 } // namespace ash |
| OLD | NEW |