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_icon_manager.h" | 5 #include "chrome/browser/extensions/extension_icon_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "chrome/app/vector_icons/vector_icons.h" |
10 #include "extensions/browser/image_loader.h" | 11 #include "extensions/browser/image_loader.h" |
11 #include "extensions/common/constants.h" | 12 #include "extensions/common/constants.h" |
12 #include "extensions/common/extension.h" | 13 #include "extensions/common/extension.h" |
13 #include "extensions/common/extension_icon_set.h" | 14 #include "extensions/common/extension_icon_set.h" |
14 #include "extensions/common/extension_resource.h" | 15 #include "extensions/common/extension_resource.h" |
15 #include "extensions/common/manifest_handlers/icons_handler.h" | 16 #include "extensions/common/manifest_handlers/icons_handler.h" |
16 #include "skia/ext/image_operations.h" | 17 #include "skia/ext/image_operations.h" |
17 #include "ui/base/resource/resource_bundle.h" | 18 #include "ui/base/resource/resource_bundle.h" |
18 #include "ui/gfx/canvas.h" | 19 #include "ui/gfx/canvas.h" |
19 #include "ui/gfx/color_palette.h" | 20 #include "ui/gfx/color_palette.h" |
20 #include "ui/gfx/color_utils.h" | 21 #include "ui/gfx/color_utils.h" |
21 #include "ui/gfx/favicon_size.h" | 22 #include "ui/gfx/favicon_size.h" |
22 #include "ui/gfx/geometry/size.h" | 23 #include "ui/gfx/geometry/size.h" |
23 #include "ui/gfx/image/image.h" | 24 #include "ui/gfx/image/image.h" |
24 #include "ui/gfx/image/image_skia_operations.h" | 25 #include "ui/gfx/image/image_skia_operations.h" |
25 #include "ui/gfx/paint_vector_icon.h" | 26 #include "ui/gfx/paint_vector_icon.h" |
26 #include "ui/gfx/vector_icons_public.h" | |
27 #include "ui/native_theme/common_theme.h" | 27 #include "ui/native_theme/common_theme.h" |
28 #include "ui/native_theme/native_theme.h" | 28 #include "ui/native_theme/native_theme.h" |
29 | 29 |
30 ExtensionIconManager::ExtensionIconManager() | 30 ExtensionIconManager::ExtensionIconManager() |
31 : monochrome_(false), | 31 : monochrome_(false), |
32 weak_ptr_factory_(this) { | 32 weak_ptr_factory_(this) { |
33 } | 33 } |
34 | 34 |
35 ExtensionIconManager::~ExtensionIconManager() { | 35 ExtensionIconManager::~ExtensionIconManager() { |
36 } | 36 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 color_utils::HSL shift = {-1, 0, 0.6}; | 83 color_utils::HSL shift = {-1, 0, 0.6}; |
84 modified_image = gfx::Image(gfx::ImageSkiaOperations::CreateHSLShiftedImage( | 84 modified_image = gfx::Image(gfx::ImageSkiaOperations::CreateHSLShiftedImage( |
85 image.AsImageSkia(), shift)); | 85 image.AsImageSkia(), shift)); |
86 } | 86 } |
87 icons_[extension_id] = modified_image; | 87 icons_[extension_id] = modified_image; |
88 } | 88 } |
89 | 89 |
90 void ExtensionIconManager::EnsureDefaultIcon() { | 90 void ExtensionIconManager::EnsureDefaultIcon() { |
91 if (default_icon_.IsEmpty()) { | 91 if (default_icon_.IsEmpty()) { |
92 default_icon_ = gfx::Image(gfx::CreateVectorIcon( | 92 default_icon_ = gfx::Image(gfx::CreateVectorIcon( |
93 gfx::VectorIconId::EXTENSION, gfx::kFaviconSize, gfx::kChromeIconGrey)); | 93 kExtensionIcon, gfx::kFaviconSize, gfx::kChromeIconGrey)); |
94 } | 94 } |
95 } | 95 } |
OLD | NEW |