OLD | NEW |
---|---|
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 Loading... | |
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), |
tfarina
2013/11/02 02:36:55
one less |profile_| usage! that is good. thanks fo
| |
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 Loading... | |
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 |
OLD | NEW |