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

Side by Side Diff: chrome/browser/bookmarks/bookmark_html_writer.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_html_writer.h" 5 #include "chrome/browser/bookmarks/bookmark_html_writer.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 if (bookmark_urls_.empty()) { 454 if (bookmark_urls_.empty()) {
455 return false; 455 return false;
456 } 456 }
457 do { 457 do {
458 std::string url = bookmark_urls_.front(); 458 std::string url = bookmark_urls_.front();
459 // Filter out urls that we've already got favicon for. 459 // Filter out urls that we've already got favicon for.
460 URLFaviconMap::const_iterator iter = favicons_map_->find(url); 460 URLFaviconMap::const_iterator iter = favicons_map_->find(url);
461 if (favicons_map_->end() == iter) { 461 if (favicons_map_->end() == iter) {
462 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile( 462 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile(
463 profile_, Profile::EXPLICIT_ACCESS); 463 profile_, Profile::EXPLICIT_ACCESS);
464 favicon_service->GetRawFaviconForURL(profile_, GURL(url), 464 favicon_service->GetRawFaviconForURL(
465 history::FAVICON, gfx::kFaviconSize, ui::SCALE_FACTOR_100P, 465 FaviconService::FaviconForURLParams(profile_, GURL(url),
466 &favicon_consumer_, 466 history::FAVICON, gfx::kFaviconSize, &favicon_consumer_),
467 ui::SCALE_FACTOR_100P,
467 base::Bind(&BookmarkFaviconFetcher::OnFaviconDataAvailable, 468 base::Bind(&BookmarkFaviconFetcher::OnFaviconDataAvailable,
468 base::Unretained(this))); 469 base::Unretained(this)));
469 return true; 470 return true;
470 } else { 471 } else {
471 bookmark_urls_.pop_front(); 472 bookmark_urls_.pop_front();
472 } 473 }
473 } while (!bookmark_urls_.empty()); 474 } while (!bookmark_urls_.empty());
474 return false; 475 return false;
475 } 476 }
476 477
(...skipping 24 matching lines...) Expand all
501 // BookmarkModel isn't thread safe (nor would we want to lock it down 502 // BookmarkModel isn't thread safe (nor would we want to lock it down
502 // for the duration of the write), as such we make a copy of the 503 // for the duration of the write), as such we make a copy of the
503 // BookmarkModel using BookmarkCodec then write from that. 504 // BookmarkModel using BookmarkCodec then write from that.
504 if (fetcher == NULL) { 505 if (fetcher == NULL) {
505 fetcher = new BookmarkFaviconFetcher(profile, path, observer); 506 fetcher = new BookmarkFaviconFetcher(profile, path, observer);
506 fetcher->ExportBookmarks(); 507 fetcher->ExportBookmarks();
507 } 508 }
508 } 509 }
509 510
510 } // namespace bookmark_html_writer 511 } // namespace bookmark_html_writer
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/bookmarks/bookmark_model.cc » ('j') | chrome/browser/ui/webui/ntp/app_launcher_handler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698