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

Unified Diff: chrome/browser/ui/libgtk2ui/gtk2_ui.cc

Issue 13497002: Crop images from custom themes before storing them into the theme pack (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 8 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/browser/ui/libgtk2ui/gtk2_ui.h ('k') | ui/linux_ui/linux_ui.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/libgtk2ui/gtk2_ui.cc
diff --git a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
index 7f8e18fad311f6f9571668f3f6d72ea6d4d6f1f0..9e6443bcf6da2fc88a2caee0665e9c6c96ef92e8 100644
--- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
+++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
@@ -309,20 +309,20 @@ bool Gtk2UI::UseNativeTheme() const {
return true;
}
-gfx::Image* Gtk2UI::GetThemeImageNamed(int id) const {
+gfx::Image Gtk2UI::GetThemeImageNamed(int id) const {
// Try to get our cached version:
ImageCache::const_iterator it = gtk_images_.find(id);
if (it != gtk_images_.end())
return it->second;
if (/*use_gtk_ && */ IsOverridableImage(id)) {
- gfx::Image* image = new gfx::Image(
+ gfx::Image image = gfx::Image(
gfx::ImageSkia::CreateFrom1xBitmap(GenerateGtkThemeBitmap(id)));
gtk_images_[id] = image;
return image;
}
- return NULL;
+ return gfx::Image();
}
bool Gtk2UI::GetColor(int id, SkColor* color) const {
@@ -795,7 +795,7 @@ SkBitmap Gtk2UI::GenerateFrameImage(
}
SkBitmap Gtk2UI::GenerateTabImage(int base_id) const {
- const SkBitmap* base_image = GetThemeImageNamed(base_id)->ToSkBitmap();
+ const SkBitmap* base_image = GetThemeImageNamed(base_id).ToSkBitmap();
SkBitmap bg_tint = SkBitmapOperations::CreateHSLShiftedBitmap(
*base_image, GetDefaultTint(ThemeProperties::TINT_BACKGROUND_TAB));
return SkBitmapOperations::CreateTiledBitmap(
@@ -973,7 +973,7 @@ SkBitmap Gtk2UI::DrawGtkButtonBorder(int gtk_state,
}
void Gtk2UI::ClearAllThemeData() {
- STLDeleteValues(&gtk_images_);
+ gtk_images_.clear();
}
} // namespace libgtk2ui
« no previous file with comments | « chrome/browser/ui/libgtk2ui/gtk2_ui.h ('k') | ui/linux_ui/linux_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698