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 <windows.h> | 7 #include <windows.h> |
8 #include <shobjidl.h> | 8 #include <shobjidl.h> |
9 #include <propkey.h> | 9 #include <propkey.h> |
10 #include <propvarutil.h> | 10 #include <propvarutil.h> |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 base::Bind(&JumpList::RunUpdate, this)); | 677 base::Bind(&JumpList::RunUpdate, this)); |
678 return; | 678 return; |
679 } | 679 } |
680 // Ask FaviconService if it has a favicon of a URL. | 680 // Ask FaviconService if it has a favicon of a URL. |
681 // When FaviconService has one, it will call OnFaviconDataAvailable(). | 681 // When FaviconService has one, it will call OnFaviconDataAvailable(). |
682 url = GURL(icon_urls_.front().first); | 682 url = GURL(icon_urls_.front().first); |
683 } | 683 } |
684 FaviconService* favicon_service = | 684 FaviconService* favicon_service = |
685 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); | 685 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); |
686 task_id_ = favicon_service->GetFaviconImageForURL( | 686 task_id_ = favicon_service->GetFaviconImageForURL( |
687 FaviconService::FaviconForURLParams(profile_, | 687 FaviconService::FaviconForURLParams(url, |
688 url, | |
689 chrome::FAVICON, | 688 chrome::FAVICON, |
690 gfx::kFaviconSize), | 689 gfx::kFaviconSize), |
691 base::Bind(&JumpList::OnFaviconDataAvailable, | 690 base::Bind(&JumpList::OnFaviconDataAvailable, |
692 base::Unretained(this)), | 691 base::Unretained(this)), |
693 &cancelable_task_tracker_); | 692 &cancelable_task_tracker_); |
694 } | 693 } |
695 | 694 |
696 void JumpList::OnFaviconDataAvailable( | 695 void JumpList::OnFaviconDataAvailable( |
697 const chrome::FaviconImageResult& image_result) { | 696 const chrome::FaviconImageResult& image_result) { |
698 // If there is currently a favicon request in progress, it is now outdated, | 697 // If there is currently a favicon request in progress, it is now outdated, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 } | 754 } |
756 | 755 |
757 void JumpList::CreateIconFiles(const ShellLinkItemList& item_list) { | 756 void JumpList::CreateIconFiles(const ShellLinkItemList& item_list) { |
758 for (ShellLinkItemList::const_iterator item = item_list.begin(); | 757 for (ShellLinkItemList::const_iterator item = item_list.begin(); |
759 item != item_list.end(); ++item) { | 758 item != item_list.end(); ++item) { |
760 base::FilePath icon_path; | 759 base::FilePath icon_path; |
761 if (CreateIconFile((*item)->data(), icon_dir_, &icon_path)) | 760 if (CreateIconFile((*item)->data(), icon_dir_, &icon_path)) |
762 (*item)->SetIcon(icon_path.value(), 0, true); | 761 (*item)->SetIcon(icon_path.value(), 0, true); |
763 } | 762 } |
764 } | 763 } |
OLD | NEW |