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

Side by Side Diff: chrome/common/icon_with_badge_image_source.cc

Issue 1349783006: Cleanup: Pass std::string as const reference if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert third_party changes Created 5 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/common/icon_with_badge_image_source.h" 5 #include "chrome/common/icon_with_badge_image_source.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "chrome/common/badge_util.h" 9 #include "chrome/common/badge_util.h"
10 #include "ui/gfx/canvas.h" 10 #include "ui/gfx/canvas.h"
11 #include "ui/gfx/geometry/rect.h" 11 #include "ui/gfx/geometry/rect.h"
12 #include "ui/gfx/image/image_skia_operations.h" 12 #include "ui/gfx/image/image_skia_operations.h"
13 13
14 IconWithBadgeImageSource::Badge::Badge(std::string text, 14 IconWithBadgeImageSource::Badge::Badge(const std::string& text,
15 SkColor text_color, 15 SkColor text_color,
16 SkColor background_color) 16 SkColor background_color)
17 : text(text), text_color(text_color), background_color(background_color) { 17 : text(text), text_color(text_color), background_color(background_color) {}
18 }
19 18
20 IconWithBadgeImageSource::Badge::~Badge() {} 19 IconWithBadgeImageSource::Badge::~Badge() {}
21 20
22 IconWithBadgeImageSource::IconWithBadgeImageSource(const gfx::Size& size) 21 IconWithBadgeImageSource::IconWithBadgeImageSource(const gfx::Size& size)
23 : gfx::CanvasImageSource(size, false), 22 : gfx::CanvasImageSource(size, false),
24 grayscale_(false), 23 grayscale_(false),
25 paint_decoration_(false) { 24 paint_decoration_(false) {
26 } 25 }
27 26
28 IconWithBadgeImageSource::~IconWithBadgeImageSource() { 27 IconWithBadgeImageSource::~IconWithBadgeImageSource() {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 72 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
74 canvas->DrawCircle(center_point, 73 canvas->DrawCircle(center_point,
75 major_radius, 74 major_radius,
76 paint); 75 paint);
77 paint.setColor(decoration_color); 76 paint.setColor(decoration_color);
78 canvas->DrawCircle(center_point, 77 canvas->DrawCircle(center_point,
79 minor_radius, 78 minor_radius,
80 paint); 79 paint);
81 } 80 }
82 81
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698