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

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

Issue 480693002: Use a qualified path for ui_resources.h grit includes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: REBASE Created 6 years, 4 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/ui/webui/favicon_source.cc ('k') | content/DEPS » ('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) 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/badge_util.h" 5 #include "chrome/common/badge_util.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "grit/ui_resources.h"
12 #include "third_party/skia/include/core/SkPaint.h" 11 #include "third_party/skia/include/core/SkPaint.h"
13 #include "third_party/skia/include/core/SkTypeface.h" 12 #include "third_party/skia/include/core/SkTypeface.h"
14 #include "ui/base/resource/resource_bundle.h" 13 #include "ui/base/resource/resource_bundle.h"
15 #include "ui/gfx/canvas.h" 14 #include "ui/gfx/canvas.h"
16 #include "ui/gfx/font.h" 15 #include "ui/gfx/font.h"
17 #include "ui/gfx/rect.h" 16 #include "ui/gfx/rect.h"
18 #include "ui/gfx/size.h" 17 #include "ui/gfx/size.h"
18 #include "ui/resources/grit/ui_resources.h"
19 19
20 namespace { 20 namespace {
21 21
22 // Different platforms need slightly different constants to look good. 22 // Different platforms need slightly different constants to look good.
23 #if defined(OS_WIN) 23 #if defined(OS_WIN)
24 const float kTextSize = 10; 24 const float kTextSize = 10;
25 const int kBottomMarginBrowserAction = 0; 25 const int kBottomMarginBrowserAction = 0;
26 const int kBottomMarginPageAction = 2; 26 const int kBottomMarginPageAction = 2;
27 const int kPadding = 2; 27 const int kPadding = 2;
28 // The padding between the top of the badge and the top of the text. 28 // The padding between the top of the badge and the top of the text.
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 canvas->sk_canvas()->drawText( 187 canvas->sk_canvas()->drawText(
188 text.c_str(), text.size(), 188 text.c_str(), text.size(),
189 SkFloatToScalar(rect.x() + 189 SkFloatToScalar(rect.x() +
190 static_cast<float>(rect.width() - text_width) / 2), 190 static_cast<float>(rect.width() - text_width) / 2),
191 SkFloatToScalar(rect.y() + kTextSize + kTopTextPadding), 191 SkFloatToScalar(rect.y() + kTextSize + kTopTextPadding),
192 *text_paint); 192 *text_paint);
193 canvas->Restore(); 193 canvas->Restore();
194 } 194 }
195 195
196 } // namespace badge_util 196 } // namespace badge_util
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/favicon_source.cc ('k') | content/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698