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/jumplist_win.h" | 5 #include "chrome/browser/jumplist_win.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 base::Bind(&JumpList::RunUpdate, this)); | 390 base::Bind(&JumpList::RunUpdate, this)); |
391 return; | 391 return; |
392 } | 392 } |
393 // Ask FaviconService if it has a favicon of a URL. | 393 // Ask FaviconService if it has a favicon of a URL. |
394 // When FaviconService has one, it will call OnFaviconDataAvailable(). | 394 // When FaviconService has one, it will call OnFaviconDataAvailable(). |
395 url = GURL(icon_urls_.front().first); | 395 url = GURL(icon_urls_.front().first); |
396 } | 396 } |
397 FaviconService* favicon_service = | 397 FaviconService* favicon_service = |
398 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); | 398 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); |
399 task_id_ = favicon_service->GetFaviconImageForPageURL( | 399 task_id_ = favicon_service->GetFaviconImageForPageURL( |
400 FaviconService::FaviconForPageURLParams( | 400 url, |
401 url, favicon_base::FAVICON, gfx::kFaviconSize), | |
402 base::Bind(&JumpList::OnFaviconDataAvailable, base::Unretained(this)), | 401 base::Bind(&JumpList::OnFaviconDataAvailable, base::Unretained(this)), |
403 &cancelable_task_tracker_); | 402 &cancelable_task_tracker_); |
404 } | 403 } |
405 | 404 |
406 void JumpList::OnFaviconDataAvailable( | 405 void JumpList::OnFaviconDataAvailable( |
407 const favicon_base::FaviconImageResult& image_result) { | 406 const favicon_base::FaviconImageResult& image_result) { |
408 // If there is currently a favicon request in progress, it is now outdated, | 407 // If there is currently a favicon request in progress, it is now outdated, |
409 // as we have received another, so nullify the handle from the old request. | 408 // as we have received another, so nullify the handle from the old request. |
410 task_id_ = base::CancelableTaskTracker::kBadTaskId; | 409 task_id_ = base::CancelableTaskTracker::kBadTaskId; |
411 // lock the list to set icon data and pop the url | 410 // lock the list to set icon data and pop the url |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 } | 464 } |
466 | 465 |
467 void JumpList::CreateIconFiles(const ShellLinkItemList& item_list) { | 466 void JumpList::CreateIconFiles(const ShellLinkItemList& item_list) { |
468 for (ShellLinkItemList::const_iterator item = item_list.begin(); | 467 for (ShellLinkItemList::const_iterator item = item_list.begin(); |
469 item != item_list.end(); ++item) { | 468 item != item_list.end(); ++item) { |
470 base::FilePath icon_path; | 469 base::FilePath icon_path; |
471 if (CreateIconFile((*item)->icon_data(), icon_dir_, &icon_path)) | 470 if (CreateIconFile((*item)->icon_data(), icon_dir_, &icon_path)) |
472 (*item)->set_icon(icon_path.value(), 0); | 471 (*item)->set_icon(icon_path.value(), 0); |
473 } | 472 } |
474 } | 473 } |
OLD | NEW |