| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |