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

Side by Side Diff: chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc

Issue 10451102: fix a memory leak and add a suppression (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/ui/gtk/bookmarks/bookmark_utils_gtk.h" 5 #include "chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.h"
6 6
7 #include "base/pickle.h" 7 #include "base/pickle.h"
8 #include "base/string16.h" 8 #include "base/string16.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 const char kBookmarkNode[] = "bookmark-node"; 165 const char kBookmarkNode[] = "bookmark-node";
166 166
167 GdkPixbuf* GetPixbufForNode(const BookmarkNode* node, BookmarkModel* model, 167 GdkPixbuf* GetPixbufForNode(const BookmarkNode* node, BookmarkModel* model,
168 bool native) { 168 bool native) {
169 GdkPixbuf* pixbuf; 169 GdkPixbuf* pixbuf;
170 170
171 if (node->is_url()) { 171 if (node->is_url()) {
172 if (model->GetFavicon(node).width() != 0) { 172 if (model->GetFavicon(node).width() != 0) {
173 pixbuf = gfx::GdkPixbufFromSkBitmap(model->GetFavicon(node)); 173 pixbuf = gfx::GdkPixbufFromSkBitmap(model->GetFavicon(node));
174 } else { 174 } else {
175 pixbuf = GtkThemeService::GetDefaultFavicon(native)->ToGdkPixbuf(); 175 pixbuf = GtkThemeService::GetDefaultFavicon(native).ToGdkPixbuf();
176 g_object_ref(pixbuf); 176 g_object_ref(pixbuf);
177 } 177 }
178 } else { 178 } else {
179 pixbuf = GtkThemeService::GetFolderIcon(native)->ToGdkPixbuf(); 179 pixbuf = GtkThemeService::GetFolderIcon(native).ToGdkPixbuf();
180 g_object_ref(pixbuf); 180 g_object_ref(pixbuf);
181 } 181 }
182 182
183 return pixbuf; 183 return pixbuf;
184 } 184 }
185 185
186 GtkWidget* GetDragRepresentation(GdkPixbuf* pixbuf, 186 GtkWidget* GetDragRepresentation(GdkPixbuf* pixbuf,
187 const string16& title, 187 const string16& title,
188 GtkThemeService* provider) { 188 GtkThemeService* provider) {
189 GtkWidget* window = gtk_window_new(GTK_WINDOW_POPUP); 189 GtkWidget* window = gtk_window_new(GTK_WINDOW_POPUP);
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 GURL url; 450 GURL url;
451 string16 title; 451 string16 title;
452 if (!ui::ExtractNetscapeURL(selection_data, &url, &title)) 452 if (!ui::ExtractNetscapeURL(selection_data, &url, &title))
453 return false; 453 return false;
454 454
455 model->AddURL(parent, idx, title, url); 455 model->AddURL(parent, idx, title, url);
456 return true; 456 return true;
457 } 457 }
458 458
459 } // namespace bookmark_utils 459 } // namespace bookmark_utils
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/bookmarks/bookmark_tree_model.cc ('k') | chrome/browser/ui/gtk/gtk_theme_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698