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

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

Issue 56143002: Make FaviconService() use Porfile as parameter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unit test but break the DEPS Created 7 years, 1 month 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
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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
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( 464 favicon_service->GetRawFaviconForURL(
465 FaviconService::FaviconForURLParams( 465 FaviconService::FaviconForURLParams(
466 profile_, GURL(url), chrome::FAVICON, gfx::kFaviconSize), 466 GURL(url), chrome::FAVICON, gfx::kFaviconSize),
467 ui::SCALE_FACTOR_100P, 467 ui::SCALE_FACTOR_100P,
468 base::Bind(&BookmarkFaviconFetcher::OnFaviconDataAvailable, 468 base::Bind(&BookmarkFaviconFetcher::OnFaviconDataAvailable,
469 base::Unretained(this)), 469 base::Unretained(this)),
470 &cancelable_task_tracker_); 470 &cancelable_task_tracker_);
471 return true; 471 return true;
472 } else { 472 } else {
473 bookmark_urls_.pop_front(); 473 bookmark_urls_.pop_front();
474 } 474 }
475 } while (!bookmark_urls_.empty()); 475 } while (!bookmark_urls_.empty());
476 return false; 476 return false;
(...skipping 25 matching lines...) Expand all
502 // 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
503 // 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
504 // BookmarkModel using BookmarkCodec then write from that. 504 // BookmarkModel using BookmarkCodec then write from that.
505 if (fetcher == NULL) { 505 if (fetcher == NULL) {
506 fetcher = new BookmarkFaviconFetcher(profile, path, observer); 506 fetcher = new BookmarkFaviconFetcher(profile, path, observer);
507 fetcher->ExportBookmarks(); 507 fetcher->ExportBookmarks();
508 } 508 }
509 } 509 }
510 510
511 } // namespace bookmark_html_writer 511 } // namespace bookmark_html_writer
OLDNEW
« no previous file with comments | « chrome/browser/android/provider/chrome_browser_provider.cc ('k') | chrome/browser/bookmarks/bookmark_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698