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

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

Issue 6263008: Move ResourceBundle, DataPack to ui/base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/utility_process_host.cc ('k') | chrome/common/common_glue.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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/badge_util.h" 5 #include "chrome/common/badge_util.h"
6 6
7 #include "app/resource_bundle.h"
8 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
9 #include "gfx/canvas_skia.h" 8 #include "gfx/canvas_skia.h"
10 #include "gfx/font.h" 9 #include "gfx/font.h"
11 #include "third_party/skia/include/core/SkPaint.h" 10 #include "third_party/skia/include/core/SkPaint.h"
12 #include "third_party/skia/include/core/SkTypeface.h" 11 #include "third_party/skia/include/core/SkTypeface.h"
12 #include "ui/base/resource/resource_bundle.h"
13 13
14 namespace badge_util { 14 namespace badge_util {
15 15
16 SkPaint* GetBadgeTextPaintSingleton() { 16 SkPaint* GetBadgeTextPaintSingleton() {
17 #if defined(OS_MACOSX) 17 #if defined(OS_MACOSX)
18 const char kPreferredTypeface[] = "Helvetica Bold"; 18 const char kPreferredTypeface[] = "Helvetica Bold";
19 #else 19 #else
20 const char kPreferredTypeface[] = "Arial"; 20 const char kPreferredTypeface[] = "Arial";
21 #endif 21 #endif
22 22
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // add 'font_size - 1' to the height. 90 // add 'font_size - 1' to the height.
91 SkScalar x = (badge_width - text_width)/2; 91 SkScalar x = (badge_width - text_width)/2;
92 SkScalar y = (icon.height() - font_size)/2 + font_size - 1; 92 SkScalar y = (icon.height() - font_size)/2 + font_size - 1;
93 canvas->drawText(badge_text.c_str(), badge_text.size(), x, y, *paint); 93 canvas->drawText(badge_text.c_str(), badge_text.size(), x, y, *paint);
94 94
95 // Return the generated image. 95 // Return the generated image.
96 return canvas->ExtractBitmap(); 96 return canvas->ExtractBitmap();
97 } 97 }
98 98
99 } // namespace badge_util 99 } // namespace badge_util
OLDNEW
« no previous file with comments | « chrome/browser/utility_process_host.cc ('k') | chrome/common/common_glue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698