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

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

Issue 331163003: [Refactor] Change FaviconService API to take in a desired pixel size (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 return false; 452 return false;
453 } 453 }
454 do { 454 do {
455 std::string url = bookmark_urls_.front(); 455 std::string url = bookmark_urls_.front();
456 // Filter out urls that we've already got favicon for. 456 // Filter out urls that we've already got favicon for.
457 URLFaviconMap::const_iterator iter = favicons_map_->find(url); 457 URLFaviconMap::const_iterator iter = favicons_map_->find(url);
458 if (favicons_map_->end() == iter) { 458 if (favicons_map_->end() == iter) {
459 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile( 459 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile(
460 profile_, Profile::EXPLICIT_ACCESS); 460 profile_, Profile::EXPLICIT_ACCESS);
461 favicon_service->GetRawFaviconForPageURL( 461 favicon_service->GetRawFaviconForPageURL(
462 FaviconService::FaviconForPageURLParams( 462 GURL(url),
463 GURL(url), favicon_base::FAVICON, gfx::kFaviconSize), 463 favicon_base::FAVICON,
464 1.0f, 464 gfx::kFaviconSize,
465 base::Bind(&BookmarkFaviconFetcher::OnFaviconDataAvailable, 465 base::Bind(&BookmarkFaviconFetcher::OnFaviconDataAvailable,
466 base::Unretained(this)), 466 base::Unretained(this)),
467 &cancelable_task_tracker_); 467 &cancelable_task_tracker_);
468 return true; 468 return true;
469 } else { 469 } else {
470 bookmark_urls_.pop_front(); 470 bookmark_urls_.pop_front();
471 } 471 }
472 } while (!bookmark_urls_.empty()); 472 } while (!bookmark_urls_.empty());
473 return false; 473 return false;
474 } 474 }
(...skipping 24 matching lines...) Expand all
499 // BookmarkModel isn't thread safe (nor would we want to lock it down 499 // BookmarkModel isn't thread safe (nor would we want to lock it down
500 // for the duration of the write), as such we make a copy of the 500 // for the duration of the write), as such we make a copy of the
501 // BookmarkModel using BookmarkCodec then write from that. 501 // BookmarkModel using BookmarkCodec then write from that.
502 if (fetcher == NULL) { 502 if (fetcher == NULL) {
503 fetcher = new BookmarkFaviconFetcher(profile, path, observer); 503 fetcher = new BookmarkFaviconFetcher(profile, path, observer);
504 fetcher->ExportBookmarks(); 504 fetcher->ExportBookmarks();
505 } 505 }
506 } 506 }
507 507
508 } // namespace bookmark_html_writer 508 } // namespace bookmark_html_writer
OLDNEW
« no previous file with comments | « chrome/browser/android/provider/chrome_browser_provider.cc ('k') | chrome/browser/bookmarks/chrome_bookmark_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698