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

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

Issue 839193002: Move ServiceAccessType into //components/keyed_service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation on android Created 5 years, 11 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
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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 bool BookmarkFaviconFetcher::FetchNextFavicon() { 451 bool BookmarkFaviconFetcher::FetchNextFavicon() {
452 if (bookmark_urls_.empty()) { 452 if (bookmark_urls_.empty()) {
453 return false; 453 return false;
454 } 454 }
455 do { 455 do {
456 std::string url = bookmark_urls_.front(); 456 std::string url = bookmark_urls_.front();
457 // Filter out urls that we've already got favicon for. 457 // Filter out urls that we've already got favicon for.
458 URLFaviconMap::const_iterator iter = favicons_map_->find(url); 458 URLFaviconMap::const_iterator iter = favicons_map_->find(url);
459 if (favicons_map_->end() == iter) { 459 if (favicons_map_->end() == iter) {
460 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile( 460 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile(
461 profile_, Profile::EXPLICIT_ACCESS); 461 profile_, ServiceAccessType::EXPLICIT_ACCESS);
462 favicon_service->GetRawFaviconForPageURL( 462 favicon_service->GetRawFaviconForPageURL(
463 GURL(url), 463 GURL(url),
464 favicon_base::FAVICON, 464 favicon_base::FAVICON,
465 gfx::kFaviconSize, 465 gfx::kFaviconSize,
466 base::Bind(&BookmarkFaviconFetcher::OnFaviconDataAvailable, 466 base::Bind(&BookmarkFaviconFetcher::OnFaviconDataAvailable,
467 base::Unretained(this)), 467 base::Unretained(this)),
468 &cancelable_task_tracker_); 468 &cancelable_task_tracker_);
469 return true; 469 return true;
470 } else { 470 } else {
471 bookmark_urls_.pop_front(); 471 bookmark_urls_.pop_front();
(...skipping 28 matching lines...) Expand all
500 // BookmarkModel isn't thread safe (nor would we want to lock it down 500 // BookmarkModel isn't thread safe (nor would we want to lock it down
501 // for the duration of the write), as such we make a copy of the 501 // for the duration of the write), as such we make a copy of the
502 // BookmarkModel using BookmarkCodec then write from that. 502 // BookmarkModel using BookmarkCodec then write from that.
503 if (fetcher == NULL) { 503 if (fetcher == NULL) {
504 fetcher = new BookmarkFaviconFetcher(profile, path, observer); 504 fetcher = new BookmarkFaviconFetcher(profile, path, observer);
505 fetcher->ExportBookmarks(); 505 fetcher->ExportBookmarks();
506 } 506 }
507 } 507 }
508 508
509 } // namespace bookmark_html_writer 509 } // namespace bookmark_html_writer
OLDNEW
« no previous file with comments | « chrome/browser/autofill/personal_data_manager_factory.cc ('k') | chrome/browser/bookmarks/bookmark_html_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698