| OLD | NEW |
| 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/extensions/extension_action.h" | 5 #include "chrome/common/extensions/extension_action.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/gfx/canvas.h" | |
| 10 #include "app/gfx/font.h" | |
| 11 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 12 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 13 #include "chrome/app/chrome_dll_resource.h" | 11 #include "chrome/app/chrome_dll_resource.h" |
| 12 #include "gfx/canvas.h" |
| 13 #include "gfx/font.h" |
| 14 #include "gfx/rect.h" | 14 #include "gfx/rect.h" |
| 15 #include "grit/app_resources.h" | 15 #include "grit/app_resources.h" |
| 16 #include "third_party/skia/include/core/SkBitmap.h" | 16 #include "third_party/skia/include/core/SkBitmap.h" |
| 17 #include "third_party/skia/include/core/SkTypeface.h" | 17 #include "third_party/skia/include/core/SkTypeface.h" |
| 18 #include "third_party/skia/include/effects/SkGradientShader.h" | 18 #include "third_party/skia/include/effects/SkGradientShader.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_LINUX) && !defined(TOOLKIT_VIEWS) | 23 #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 // text was too large. | 183 // text was too large. |
| 184 rect.fLeft += kPadding; | 184 rect.fLeft += kPadding; |
| 185 rect.fRight -= kPadding; | 185 rect.fRight -= kPadding; |
| 186 canvas->clipRect(rect); | 186 canvas->clipRect(rect); |
| 187 canvas->drawText(text.c_str(), text.size(), | 187 canvas->drawText(text.c_str(), text.size(), |
| 188 rect.fLeft + (rect.width() - text_width) / 2, | 188 rect.fLeft + (rect.width() - text_width) / 2, |
| 189 rect.fTop + kTextSize + kTopTextPadding, | 189 rect.fTop + kTextSize + kTopTextPadding, |
| 190 *text_paint); | 190 *text_paint); |
| 191 canvas->restore(); | 191 canvas->restore(); |
| 192 } | 192 } |
| OLD | NEW |