Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: ash/common/shelf/shelf_button.cc

Issue 2717943002: Fix cc/paint skia type mismatches (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/common/shelf/app_list_button.cc ('k') | ash/common/system/chromeos/network/network_icon.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/shelf/ink_drop_button_listener.h" 10 #include "ash/common/shelf/ink_drop_button_listener.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 const int kInkDropLargeSize = 60; 46 const int kInkDropLargeSize = 60;
47 47
48 // Padding from the edge of the shelf to the application icon when the shelf 48 // Padding from the edge of the shelf to the application icon when the shelf
49 // is horizontally and vertically aligned, respectively. 49 // is horizontally and vertically aligned, respectively.
50 const int kIconPaddingHorizontal = 7; 50 const int kIconPaddingHorizontal = 7;
51 const int kIconPaddingVertical = 8; 51 const int kIconPaddingVertical = 8;
52 52
53 // Paints an activity indicator on |canvas| whose |size| is specified in DIP. 53 // Paints an activity indicator on |canvas| whose |size| is specified in DIP.
54 void PaintIndicatorOnCanvas(gfx::Canvas* canvas, const gfx::Size& size) { 54 void PaintIndicatorOnCanvas(gfx::Canvas* canvas, const gfx::Size& size) {
55 cc::PaintFlags flags; 55 cc::PaintFlags flags;
56 flags.setAntiAlias(true);
56 flags.setColor(kIndicatorColor); 57 flags.setColor(kIndicatorColor);
57 flags.setFlags(cc::PaintFlags::kAntiAlias_Flag);
58 canvas->DrawCircle( 58 canvas->DrawCircle(
59 gfx::Point(size.width() / 2, 59 gfx::Point(size.width() / 2,
60 size.height() - kIndicatorOffsetFromBottom - kIndicatorRadius), 60 size.height() - kIndicatorOffsetFromBottom - kIndicatorRadius),
61 kIndicatorRadius, flags); 61 kIndicatorRadius, flags);
62 } 62 }
63 63
64 // Simple AnimationDelegate that owns a single ThrobAnimation instance to 64 // Simple AnimationDelegate that owns a single ThrobAnimation instance to
65 // keep all Draw Attention animations in sync. 65 // keep all Draw Attention animations in sync.
66 class ShelfButtonAnimation : public gfx::AnimationDelegate { 66 class ShelfButtonAnimation : public gfx::AnimationDelegate {
67 public: 67 public:
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 bar_->SetVerticalAlignment(views::ImageView::CENTER); 568 bar_->SetVerticalAlignment(views::ImageView::CENTER);
569 break; 569 break;
570 } 570 }
571 bar_->SchedulePaint(); 571 bar_->SchedulePaint();
572 } 572 }
573 573
574 bar_->SetVisible(draw_bar); 574 bar_->SetVisible(draw_bar);
575 } 575 }
576 576
577 } // namespace ash 577 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/app_list_button.cc ('k') | ash/common/system/chromeos/network/network_icon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698