| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shelf_button.h" | 5 #include "ash/common/shelf/shelf_button.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/common/ash_constants.h" | 9 #include "ash/common/ash_constants.h" |
| 10 #include "ash/common/material_design/material_design_controller.h" | 10 #include "ash/common/material_design/material_design_controller.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // Padding from the edge of the shelf to the application icon when the shelf | 54 // Padding from the edge of the shelf to the application icon when the shelf |
| 55 // is horizontally and vertically aligned, respectively. | 55 // is horizontally and vertically aligned, respectively. |
| 56 const int kIconPaddingHorizontal = 5; | 56 const int kIconPaddingHorizontal = 5; |
| 57 const int kIconPaddingHorizontalMD = 7; | 57 const int kIconPaddingHorizontalMD = 7; |
| 58 const int kIconPaddingVertical = 6; | 58 const int kIconPaddingVertical = 6; |
| 59 const int kIconPaddingVerticalMD = 8; | 59 const int kIconPaddingVerticalMD = 8; |
| 60 | 60 |
| 61 // Paints an activity indicator on |canvas| whose |size| is specified in DIP. | 61 // Paints an activity indicator on |canvas| whose |size| is specified in DIP. |
| 62 void PaintIndicatorOnCanvas(gfx::Canvas* canvas, const gfx::Size& size) { | 62 void PaintIndicatorOnCanvas(gfx::Canvas* canvas, const gfx::Size& size) { |
| 63 cc::PaintFlags flags; | 63 cc::PaintFlags flags; |
| 64 flags.setAntiAlias(true); |
| 64 flags.setColor(kIndicatorColor); | 65 flags.setColor(kIndicatorColor); |
| 65 flags.setFlags(cc::PaintFlags::kAntiAlias_Flag); | |
| 66 canvas->DrawCircle( | 66 canvas->DrawCircle( |
| 67 gfx::Point(size.width() / 2, | 67 gfx::Point(size.width() / 2, |
| 68 size.height() - kIndicatorOffsetFromBottom - kIndicatorRadius), | 68 size.height() - kIndicatorOffsetFromBottom - kIndicatorRadius), |
| 69 kIndicatorRadius, flags); | 69 kIndicatorRadius, flags); |
| 70 } | 70 } |
| 71 | 71 |
| 72 // Simple AnimationDelegate that owns a single ThrobAnimation instance to | 72 // Simple AnimationDelegate that owns a single ThrobAnimation instance to |
| 73 // keep all Draw Attention animations in sync. | 73 // keep all Draw Attention animations in sync. |
| 74 class ShelfButtonAnimation : public gfx::AnimationDelegate { | 74 class ShelfButtonAnimation : public gfx::AnimationDelegate { |
| 75 public: | 75 public: |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 bar_->SetHorizontalAlignment(views::ImageView::TRAILING); | 595 bar_->SetHorizontalAlignment(views::ImageView::TRAILING); |
| 596 bar_->SetVerticalAlignment(views::ImageView::CENTER); | 596 bar_->SetVerticalAlignment(views::ImageView::CENTER); |
| 597 break; | 597 break; |
| 598 } | 598 } |
| 599 bar_->SchedulePaint(); | 599 bar_->SchedulePaint(); |
| 600 } | 600 } |
| 601 bar_->SetVisible(bar_id != 0 && state_ != STATE_NORMAL); | 601 bar_->SetVisible(bar_id != 0 && state_ != STATE_NORMAL); |
| 602 } | 602 } |
| 603 | 603 |
| 604 } // namespace ash | 604 } // namespace ash |
| OLD | NEW |