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

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

Issue 10377122: Convert GdkPixbufFromSkBitmap and GdkPixbufToSkBitmap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 namespace bookmark_utils { 162 namespace bookmark_utils {
163 163
164 const char kBookmarkNode[] = "bookmark-node"; 164 const char kBookmarkNode[] = "bookmark-node";
165 165
166 GdkPixbuf* GetPixbufForNode(const BookmarkNode* node, BookmarkModel* model, 166 GdkPixbuf* GetPixbufForNode(const BookmarkNode* node, BookmarkModel* model,
167 bool native) { 167 bool native) {
168 GdkPixbuf* pixbuf; 168 GdkPixbuf* pixbuf;
169 169
170 if (node->is_url()) { 170 if (node->is_url()) {
171 if (model->GetFavicon(node).width() != 0) { 171 if (model->GetFavicon(node).width() != 0) {
172 pixbuf = gfx::GdkPixbufFromSkBitmap(&model->GetFavicon(node)); 172 pixbuf = gfx::GdkPixbufFromSkBitmap(model->GetFavicon(node));
173 } else { 173 } else {
174 pixbuf = GtkThemeService::GetDefaultFavicon(native)->ToGdkPixbuf(); 174 pixbuf = GtkThemeService::GetDefaultFavicon(native)->ToGdkPixbuf();
175 g_object_ref(pixbuf); 175 g_object_ref(pixbuf);
176 } 176 }
177 } else { 177 } else {
178 pixbuf = GtkThemeService::GetFolderIcon(native)->ToGdkPixbuf(); 178 pixbuf = GtkThemeService::GetFolderIcon(native)->ToGdkPixbuf();
179 g_object_ref(pixbuf); 179 g_object_ref(pixbuf);
180 } 180 }
181 181
182 return pixbuf; 182 return pixbuf;
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 GURL url; 449 GURL url;
450 string16 title; 450 string16 title;
451 if (!ui::ExtractNetscapeURL(selection_data, &url, &title)) 451 if (!ui::ExtractNetscapeURL(selection_data, &url, &title))
452 return false; 452 return false;
453 453
454 model->AddURL(parent, idx, title, url); 454 model->AddURL(parent, idx, title, url);
455 return true; 455 return true;
456 } 456 }
457 457
458 } // namespace bookmark_utils 458 } // namespace bookmark_utils
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/avatar_menu_item_gtk.cc ('k') | chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698