OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 bool JumpList::StartLoadingFavIcon() { | 681 bool JumpList::StartLoadingFavIcon() { |
682 if (icon_urls_.empty()) | 682 if (icon_urls_.empty()) |
683 return false; | 683 return false; |
684 | 684 |
685 // Ask FaviconService if it has a favicon of a URL. | 685 // Ask FaviconService if it has a favicon of a URL. |
686 // When FaviconService has one, it will call OnFavIconDataAvailable(). | 686 // When FaviconService has one, it will call OnFavIconDataAvailable(). |
687 GURL url(icon_urls_.front().first); | 687 GURL url(icon_urls_.front().first); |
688 FaviconService* favicon_service = | 688 FaviconService* favicon_service = |
689 profile_->GetFaviconService(Profile::EXPLICIT_ACCESS); | 689 profile_->GetFaviconService(Profile::EXPLICIT_ACCESS); |
690 FaviconService::Handle handle = favicon_service->GetFaviconForURL( | 690 FaviconService::Handle handle = favicon_service->GetFaviconForURL( |
691 url, &fav_icon_consumer_, | 691 url, &favicon_consumer_, |
692 NewCallback(this, &JumpList::OnFavIconDataAvailable)); | 692 NewCallback(this, &JumpList::OnFavIconDataAvailable)); |
693 return true; | 693 return true; |
694 } | 694 } |
695 | 695 |
696 void JumpList::OnSegmentUsageAvailable( | 696 void JumpList::OnSegmentUsageAvailable( |
697 CancelableRequestProvider::Handle handle, | 697 CancelableRequestProvider::Handle handle, |
698 std::vector<PageUsageData*>* data) { | 698 std::vector<PageUsageData*>* data) { |
699 // Create a list of ShellLinkItem objects from the given list of | 699 // Create a list of ShellLinkItem objects from the given list of |
700 // PageUsageData objects. | 700 // PageUsageData objects. |
701 // The command that opens a web page with chrome is: | 701 // The command that opens a web page with chrome is: |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 // the file thread. | 775 // the file thread. |
776 BrowserThread::PostTask( | 776 BrowserThread::PostTask( |
777 BrowserThread::FILE, FROM_HERE, | 777 BrowserThread::FILE, FROM_HERE, |
778 new JumpListUpdateTask(app_id_.c_str(), icon_dir_, most_visited_pages_, | 778 new JumpListUpdateTask(app_id_.c_str(), icon_dir_, most_visited_pages_, |
779 recently_closed_pages_)); | 779 recently_closed_pages_)); |
780 | 780 |
781 // Delete all items in these lists since we don't need these lists any longer. | 781 // Delete all items in these lists since we don't need these lists any longer. |
782 most_visited_pages_.clear(); | 782 most_visited_pages_.clear(); |
783 recently_closed_pages_.clear(); | 783 recently_closed_pages_.clear(); |
784 } | 784 } |
OLD | NEW |