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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 | 631 |
632 bool JumpList::AddTab(const TabRestoreService::Tab* tab, | 632 bool JumpList::AddTab(const TabRestoreService::Tab* tab, |
633 ShellLinkItemList* list, | 633 ShellLinkItemList* list, |
634 size_t max_items) { | 634 size_t max_items) { |
635 // This code adds the URL and the title strings of the given tab to the | 635 // This code adds the URL and the title strings of the given tab to the |
636 // specified list. | 636 // specified list. |
637 if (list->size() >= max_items) | 637 if (list->size() >= max_items) |
638 return false; | 638 return false; |
639 | 639 |
640 scoped_refptr<ShellLinkItem> link(new ShellLinkItem); | 640 scoped_refptr<ShellLinkItem> link(new ShellLinkItem); |
641 const TabNavigation& current_navigation = | 641 const sessions::SerializedNavigationEntry& current_navigation = |
642 tab->navigations.at(tab->current_navigation_index); | 642 tab->navigations.at(tab->current_navigation_index); |
643 std::string url = current_navigation.virtual_url().spec(); | 643 std::string url = current_navigation.virtual_url().spec(); |
644 link->SetArguments(UTF8ToWide(url)); | 644 link->SetArguments(UTF8ToWide(url)); |
645 link->SetTitle(current_navigation.title()); | 645 link->SetTitle(current_navigation.title()); |
646 list->push_back(link); | 646 list->push_back(link); |
647 icon_urls_.push_back(make_pair(url, link)); | 647 icon_urls_.push_back(make_pair(url, link)); |
648 return true; | 648 return true; |
649 } | 649 } |
650 | 650 |
651 void JumpList::AddWindow(const TabRestoreService::Window* window, | 651 void JumpList::AddWindow(const TabRestoreService::Window* window, |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 } | 751 } |
752 | 752 |
753 void JumpList::CreateIconFiles(const ShellLinkItemList& item_list) { | 753 void JumpList::CreateIconFiles(const ShellLinkItemList& item_list) { |
754 for (ShellLinkItemList::const_iterator item = item_list.begin(); | 754 for (ShellLinkItemList::const_iterator item = item_list.begin(); |
755 item != item_list.end(); ++item) { | 755 item != item_list.end(); ++item) { |
756 base::FilePath icon_path; | 756 base::FilePath icon_path; |
757 if (CreateIconFile((*item)->data(), icon_dir_, &icon_path)) | 757 if (CreateIconFile((*item)->data(), icon_dir_, &icon_path)) |
758 (*item)->SetIcon(icon_path.value(), 0, true); | 758 (*item)->SetIcon(icon_path.value(), 0, true); |
759 } | 759 } |
760 } | 760 } |
OLD | NEW |