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

Side by Side Diff: chrome/browser/bookmarks/bookmark_model.cc

Issue 10918065: Introduce structures to reduce the number of arguments in the FaviconService methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove the auxiliary structure for non-URL cases. Created 8 years, 3 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/bookmarks/bookmark_model.h" 5 #include "chrome/browser/bookmarks/bookmark_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 void BookmarkModel::LoadFavicon(BookmarkNode* node) { 794 void BookmarkModel::LoadFavicon(BookmarkNode* node) {
795 if (node->is_folder()) 795 if (node->is_folder())
796 return; 796 return;
797 797
798 DCHECK(node->url().is_valid()); 798 DCHECK(node->url().is_valid());
799 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile( 799 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile(
800 profile_, Profile::EXPLICIT_ACCESS); 800 profile_, Profile::EXPLICIT_ACCESS);
801 if (!favicon_service) 801 if (!favicon_service)
802 return; 802 return;
803 FaviconService::Handle handle = favicon_service->GetFaviconImageForURL( 803 FaviconService::Handle handle = favicon_service->GetFaviconImageForURL(
804 profile_, node->url(), history::FAVICON, gfx::kFaviconSize, 804 FaviconService::FaviconForURLParams(profile_, node->url(),
805 &load_consumer_, 805 history::FAVICON, gfx::kFaviconSize, &load_consumer_),
806 base::Bind(&BookmarkModel::OnFaviconDataAvailable, 806 base::Bind(&BookmarkModel::OnFaviconDataAvailable,
807 base::Unretained(this))); 807 base::Unretained(this)));
808 load_consumer_.SetClientData(favicon_service, handle, node); 808 load_consumer_.SetClientData(favicon_service, handle, node);
809 node->set_favicon_load_handle(handle); 809 node->set_favicon_load_handle(handle);
810 } 810 }
811 811
812 void BookmarkModel::FaviconLoaded(const BookmarkNode* node) { 812 void BookmarkModel::FaviconLoaded(const BookmarkNode* node) {
813 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_, 813 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_,
814 BookmarkNodeFaviconChanged(this, node)); 814 BookmarkNodeFaviconChanged(this, node));
815 } 815 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 BookmarkLoadDetails* BookmarkModel::CreateLoadDetails() { 869 BookmarkLoadDetails* BookmarkModel::CreateLoadDetails() {
870 BookmarkPermanentNode* bb_node = 870 BookmarkPermanentNode* bb_node =
871 CreatePermanentNode(BookmarkNode::BOOKMARK_BAR); 871 CreatePermanentNode(BookmarkNode::BOOKMARK_BAR);
872 BookmarkPermanentNode* other_node = 872 BookmarkPermanentNode* other_node =
873 CreatePermanentNode(BookmarkNode::OTHER_NODE); 873 CreatePermanentNode(BookmarkNode::OTHER_NODE);
874 BookmarkPermanentNode* mobile_node = 874 BookmarkPermanentNode* mobile_node =
875 CreatePermanentNode(BookmarkNode::MOBILE); 875 CreatePermanentNode(BookmarkNode::MOBILE);
876 return new BookmarkLoadDetails(bb_node, other_node, mobile_node, 876 return new BookmarkLoadDetails(bb_node, other_node, mobile_node,
877 new BookmarkIndex(profile_), next_node_id_); 877 new BookmarkIndex(profile_), next_node_id_);
878 } 878 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698