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

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc

Issue 763903003: bookmarks: Only try to get favicon for URL nodes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « no previous file | components/bookmarks/browser/bookmark_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index 6e15ed2fc5549028995f88cea4fd3c83b565bab2..64cd97ba552b302fd3b2fa4d1134ac4d5b8bf547 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -1260,13 +1260,13 @@ void BookmarkBarView::WriteDragDataForView(View* sender,
for (int i = 0; i < GetBookmarkButtonCount(); ++i) {
if (sender == GetBookmarkButton(i)) {
const BookmarkNode* node = model_->bookmark_bar_node()->GetChild(i);
- const gfx::Image& image_from_model = model_->GetFavicon(node);
const gfx::ImageSkia* icon = nullptr;
- if (image_from_model.IsEmpty()) {
- icon = GetImageSkiaNamed(node->is_folder() ? IDR_BOOKMARK_BAR_FOLDER
- : IDR_DEFAULT_FAVICON);
+ if (node->is_url()) {
+ const gfx::Image& image = model_->GetFavicon(node);
+ icon = image.IsEmpty() ? GetImageSkiaNamed(IDR_DEFAULT_FAVICON)
+ : image.ToImageSkia();
} else {
- icon = image_from_model.ToImageSkia();
+ icon = GetImageSkiaNamed(IDR_BOOKMARK_BAR_FOLDER);
}
button_drag_utils::SetDragImage(node->url(),
« no previous file with comments | « no previous file | components/bookmarks/browser/bookmark_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698