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

Unified Diff: chrome/browser/extensions/extension_icon_manager.cc

Issue 1262513002: Use vectorized icon for default extensions icons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove resource Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/theme/theme_resources.grd ('k') | chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_icon_manager.cc
diff --git a/chrome/browser/extensions/extension_icon_manager.cc b/chrome/browser/extensions/extension_icon_manager.cc
index a15b1795d6e1cad03d6e4d18b2bb6f4671d28208..d1b58fdf859cbeabf8e0a41bcf06c8074e109ecf 100644
--- a/chrome/browser/extensions/extension_icon_manager.cc
+++ b/chrome/browser/extensions/extension_icon_manager.cc
@@ -21,7 +21,11 @@
#include "ui/gfx/favicon_size.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/image/image.h"
+#include "ui/gfx/paint_vector_icon.h"
#include "ui/gfx/skbitmap_operations.h"
+#include "ui/gfx/vector_icons_public2.h"
+#include "ui/native_theme/common_theme.h"
+#include "ui/native_theme/native_theme.h"
namespace {
@@ -108,9 +112,15 @@ void ExtensionIconManager::OnImageLoaded(const std::string& extension_id,
void ExtensionIconManager::EnsureDefaultIcon() {
if (default_icon_.empty()) {
- ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- SkBitmap src = rb.GetImageNamed(IDR_EXTENSIONS_SECTION).AsBitmap();
- default_icon_ = ApplyTransforms(src);
+ SkColor icon_color;
+ ui::CommonThemeGetSystemColor(ui::NativeTheme::kColorId_ChromeIconGrey,
+ &icon_color);
+ // TODO(estade): use correct scale factor instead of 1x.
Evan Stade 2015/07/27 23:34:21 (note this didn't work correctly before this CL ei
+ default_icon_ =
+ ApplyPadding(*gfx::CreateVectorIcon(gfx::VectorIconId::EXTENSION,
+ gfx::kFaviconSize, icon_color)
+ .bitmap(),
+ padding_);
}
}
« no previous file with comments | « chrome/app/theme/theme_resources.grd ('k') | chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698