OLD | NEW |
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/browser/extensions/extension_action.h" | 5 #include "chrome/browser/extensions/extension_action.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "chrome/common/badge_util.h" | 12 #include "chrome/common/badge_util.h" |
13 #include "chrome/common/icon_with_badge_image_source.h" | 13 #include "chrome/common/icon_with_badge_image_source.h" |
14 #include "extensions/common/constants.h" | 14 #include "extensions/common/constants.h" |
15 #include "grit/theme_resources.h" | 15 #include "grit/theme_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/SkCanvas.h" | 17 #include "third_party/skia/include/core/SkCanvas.h" |
18 #include "third_party/skia/include/core/SkPaint.h" | 18 #include "third_party/skia/include/core/SkPaint.h" |
19 #include "third_party/skia/include/effects/SkGradientShader.h" | 19 #include "third_party/skia/include/effects/SkGradientShader.h" |
20 #include "ui/base/resource/resource_bundle.h" | 20 #include "ui/base/resource/resource_bundle.h" |
21 #include "ui/gfx/animation/animation_delegate.h" | 21 #include "ui/gfx/animation/animation_delegate.h" |
22 #include "ui/gfx/canvas.h" | 22 #include "ui/gfx/canvas.h" |
23 #include "ui/gfx/color_utils.h" | 23 #include "ui/gfx/color_utils.h" |
24 #include "ui/gfx/image/image.h" | 24 #include "ui/gfx/image/image.h" |
25 #include "ui/gfx/image/image_skia.h" | 25 #include "ui/gfx/image/image_skia.h" |
26 #include "ui/gfx/image/image_skia_source.h" | 26 #include "ui/gfx/image/image_skia_source.h" |
27 #include "ui/gfx/rect.h" | 27 #include "ui/gfx/rect.h" |
28 #include "ui/gfx/size.h" | 28 #include "ui/gfx/size.h" |
29 #include "ui/gfx/skbitmap_operations.h" | 29 #include "ui/gfx/skbitmap_operations.h" |
30 #include "ui/resources/grit/ui_resources.h" | |
31 #include "url/gurl.h" | 30 #include "url/gurl.h" |
32 | 31 |
33 namespace { | 32 namespace { |
34 | 33 |
35 class GetAttentionImageSource : public gfx::ImageSkiaSource { | 34 class GetAttentionImageSource : public gfx::ImageSkiaSource { |
36 public: | 35 public: |
37 explicit GetAttentionImageSource(const gfx::ImageSkia& icon) | 36 explicit GetAttentionImageSource(const gfx::ImageSkia& icon) |
38 : icon_(icon) {} | 37 : icon_(icon) {} |
39 | 38 |
40 // gfx::ImageSkiaSource overrides: | 39 // gfx::ImageSkiaSource overrides: |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 // If there is a default icon, the icon width will be set depending on our | 245 // If there is a default icon, the icon width will be set depending on our |
247 // action type. | 246 // action type. |
248 if (default_icon_) | 247 if (default_icon_) |
249 return GetIconSizeForType(action_type()); | 248 return GetIconSizeForType(action_type()); |
250 | 249 |
251 // If no icon has been set and there is no default icon, we need favicon | 250 // If no icon has been set and there is no default icon, we need favicon |
252 // width. | 251 // width. |
253 return ui::ResourceBundle::GetSharedInstance().GetImageNamed( | 252 return ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
254 IDR_EXTENSIONS_FAVICON).ToImageSkia()->width(); | 253 IDR_EXTENSIONS_FAVICON).ToImageSkia()->width(); |
255 } | 254 } |
OLD | NEW |