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

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

Issue 2640983002: Rename paint data structures (Closed)
Patch Set: DrawingDisplayItem Created 3 years, 10 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/overflow_button.cc ('k') | ash/common/shelf/shelf_widget.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/material_design/material_design_controller.h" 10 #include "ash/common/material_design/material_design_controller.h"
11 #include "ash/common/shelf/ink_drop_button_listener.h" 11 #include "ash/common/shelf/ink_drop_button_listener.h"
12 #include "ash/common/shelf/shelf_constants.h" 12 #include "ash/common/shelf/shelf_constants.h"
13 #include "ash/common/shelf/shelf_view.h" 13 #include "ash/common/shelf/shelf_view.h"
14 #include "ash/common/shelf/wm_shelf.h" 14 #include "ash/common/shelf/wm_shelf.h"
15 #include "ash/common/shelf/wm_shelf_util.h" 15 #include "ash/common/shelf/wm_shelf_util.h"
16 #include "base/memory/ptr_util.h" 16 #include "base/memory/ptr_util.h"
17 #include "base/time/time.h" 17 #include "base/time/time.h"
18 #include "grit/ash_resources.h" 18 #include "grit/ash_resources.h"
19 #include "skia/ext/image_operations.h" 19 #include "skia/ext/image_operations.h"
20 #include "third_party/skia/include/core/SkPaint.h"
21 #include "ui/accessibility/ax_node_data.h" 20 #include "ui/accessibility/ax_node_data.h"
22 #include "ui/base/resource/resource_bundle.h" 21 #include "ui/base/resource/resource_bundle.h"
23 #include "ui/compositor/layer.h" 22 #include "ui/compositor/layer.h"
24 #include "ui/compositor/scoped_layer_animation_settings.h" 23 #include "ui/compositor/scoped_layer_animation_settings.h"
25 #include "ui/events/event_constants.h" 24 #include "ui/events/event_constants.h"
26 #include "ui/gfx/animation/animation_delegate.h" 25 #include "ui/gfx/animation/animation_delegate.h"
27 #include "ui/gfx/animation/throb_animation.h" 26 #include "ui/gfx/animation/throb_animation.h"
28 #include "ui/gfx/canvas.h" 27 #include "ui/gfx/canvas.h"
29 #include "ui/gfx/geometry/vector2d.h" 28 #include "ui/gfx/geometry/vector2d.h"
30 #include "ui/gfx/image/image.h" 29 #include "ui/gfx/image/image.h"
(...skipping 24 matching lines...) Expand all
55 54
56 // Padding from the edge of the shelf to the application icon when the shelf 55 // Padding from the edge of the shelf to the application icon when the shelf
57 // is horizontally and vertically aligned, respectively. 56 // is horizontally and vertically aligned, respectively.
58 const int kIconPaddingHorizontal = 5; 57 const int kIconPaddingHorizontal = 5;
59 const int kIconPaddingHorizontalMD = 7; 58 const int kIconPaddingHorizontalMD = 7;
60 const int kIconPaddingVertical = 6; 59 const int kIconPaddingVertical = 6;
61 const int kIconPaddingVerticalMD = 8; 60 const int kIconPaddingVerticalMD = 8;
62 61
63 // Paints an activity indicator on |canvas| whose |size| is specified in DIP. 62 // Paints an activity indicator on |canvas| whose |size| is specified in DIP.
64 void PaintIndicatorOnCanvas(gfx::Canvas* canvas, const gfx::Size& size) { 63 void PaintIndicatorOnCanvas(gfx::Canvas* canvas, const gfx::Size& size) {
65 SkPaint paint; 64 cc::PaintFlags paint;
66 paint.setColor(kIndicatorColor); 65 paint.setColor(kIndicatorColor);
67 paint.setFlags(SkPaint::kAntiAlias_Flag); 66 paint.setFlags(cc::PaintFlags::kAntiAlias_Flag);
68 canvas->DrawCircle( 67 canvas->DrawCircle(
69 gfx::Point(size.width() / 2, 68 gfx::Point(size.width() / 2,
70 size.height() - kIndicatorOffsetFromBottom - kIndicatorRadius), 69 size.height() - kIndicatorOffsetFromBottom - kIndicatorRadius),
71 kIndicatorRadius, paint); 70 kIndicatorRadius, paint);
72 } 71 }
73 72
74 // Simple AnimationDelegate that owns a single ThrobAnimation instance to 73 // Simple AnimationDelegate that owns a single ThrobAnimation instance to
75 // keep all Draw Attention animations in sync. 74 // keep all Draw Attention animations in sync.
76 class ShelfButtonAnimation : public gfx::AnimationDelegate { 75 class ShelfButtonAnimation : public gfx::AnimationDelegate {
77 public: 76 public:
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 bar_->SetHorizontalAlignment(views::ImageView::TRAILING); 597 bar_->SetHorizontalAlignment(views::ImageView::TRAILING);
599 bar_->SetVerticalAlignment(views::ImageView::CENTER); 598 bar_->SetVerticalAlignment(views::ImageView::CENTER);
600 break; 599 break;
601 } 600 }
602 bar_->SchedulePaint(); 601 bar_->SchedulePaint();
603 } 602 }
604 bar_->SetVisible(bar_id != 0 && state_ != STATE_NORMAL); 603 bar_->SetVisible(bar_id != 0 && state_ != STATE_NORMAL);
605 } 604 }
606 605
607 } // namespace ash 606 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/overflow_button.cc ('k') | ash/common/shelf/shelf_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698