| 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 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 base::Bind(&JumpList::RunUpdate, this)); | 702 base::Bind(&JumpList::RunUpdate, this)); |
| 703 return; | 703 return; |
| 704 } | 704 } |
| 705 // Ask FaviconService if it has a favicon of a URL. | 705 // Ask FaviconService if it has a favicon of a URL. |
| 706 // When FaviconService has one, it will call OnFaviconDataAvailable(). | 706 // When FaviconService has one, it will call OnFaviconDataAvailable(). |
| 707 url = GURL(icon_urls_.front().first); | 707 url = GURL(icon_urls_.front().first); |
| 708 } | 708 } |
| 709 FaviconService* favicon_service = | 709 FaviconService* favicon_service = |
| 710 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); | 710 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); |
| 711 handle_ = favicon_service->GetFaviconImageForURL( | 711 handle_ = favicon_service->GetFaviconImageForURL( |
| 712 profile_, url, history::FAVICON, gfx::kFaviconSize, &favicon_consumer_, | 712 FaviconService::FaviconForURLParams(profile_, url, history::FAVICON, |
| 713 gfx::kFaviconSize, &favicon_consumer_), |
| 713 base::Bind(&JumpList::OnFaviconDataAvailable, base::Unretained(this))); | 714 base::Bind(&JumpList::OnFaviconDataAvailable, base::Unretained(this))); |
| 714 } | 715 } |
| 715 | 716 |
| 716 void JumpList::OnFaviconDataAvailable( | 717 void JumpList::OnFaviconDataAvailable( |
| 717 FaviconService::Handle handle, | 718 FaviconService::Handle handle, |
| 718 const history::FaviconImageResult& image_result) { | 719 const history::FaviconImageResult& image_result) { |
| 719 // If there is currently a favicon request in progress, it is now outdated, | 720 // If there is currently a favicon request in progress, it is now outdated, |
| 720 // as we have received another, so nullify the handle from the old request. | 721 // as we have received another, so nullify the handle from the old request. |
| 721 handle_ = NULL; | 722 handle_ = NULL; |
| 722 // lock the list to set icon data and pop the url | 723 // lock the list to set icon data and pop the url |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 } | 777 } |
| 777 | 778 |
| 778 void JumpList::CreateIconFiles(const ShellLinkItemList& item_list) { | 779 void JumpList::CreateIconFiles(const ShellLinkItemList& item_list) { |
| 779 for (ShellLinkItemList::const_iterator item = item_list.begin(); | 780 for (ShellLinkItemList::const_iterator item = item_list.begin(); |
| 780 item != item_list.end(); ++item) { | 781 item != item_list.end(); ++item) { |
| 781 FilePath icon_path; | 782 FilePath icon_path; |
| 782 if (CreateIconFile((*item)->data(), icon_dir_, &icon_path)) | 783 if (CreateIconFile((*item)->data(), icon_dir_, &icon_path)) |
| 783 (*item)->SetIcon(icon_path.value(), 0, true); | 784 (*item)->SetIcon(icon_path.value(), 0, true); |
| 784 } | 785 } |
| 785 } | 786 } |
| OLD | NEW |