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/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 Loading... |
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 Loading... |
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 |
OLD | NEW |