| 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 FilePath* icon_path) { | 256 FilePath* icon_path) { |
| 257 // Retrieve the path to a temporary file. | 257 // Retrieve the path to a temporary file. |
| 258 // We don't have to care about the extension of this temporary file because | 258 // We don't have to care about the extension of this temporary file because |
| 259 // JumpList does not care about it. | 259 // JumpList does not care about it. |
| 260 FilePath path; | 260 FilePath path; |
| 261 if (!file_util::CreateTemporaryFileInDir(icon_dir, &path)) | 261 if (!file_util::CreateTemporaryFileInDir(icon_dir, &path)) |
| 262 return false; | 262 return false; |
| 263 | 263 |
| 264 // Create an icon file from the favicon attached to the given |page|, and | 264 // Create an icon file from the favicon attached to the given |page|, and |
| 265 // save it as the temporary file. | 265 // save it as the temporary file. |
| 266 if (!IconUtil::CreateIconFileFromSkBitmap(bitmap, path)) | 266 if (!IconUtil::CreateIconFileFromSkBitmap(bitmap, SkBitmap(), path)) |
| 267 return false; | 267 return false; |
| 268 | 268 |
| 269 // Add this icon file to the list and return its absolute path. | 269 // Add this icon file to the list and return its absolute path. |
| 270 // The IShellLink::SetIcon() function needs the absolute path to an icon. | 270 // The IShellLink::SetIcon() function needs the absolute path to an icon. |
| 271 *icon_path = path; | 271 *icon_path = path; |
| 272 return true; | 272 return true; |
| 273 } | 273 } |
| 274 | 274 |
| 275 // Updates a specified category of an application JumpList. | 275 // Updates a specified category of an application JumpList. |
| 276 // This function cannot update registered categories (such as "Tasks") because | 276 // This function cannot update registered categories (such as "Tasks") because |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 } | 778 } |
| 779 | 779 |
| 780 void JumpList::CreateIconFiles(const ShellLinkItemList& item_list) { | 780 void JumpList::CreateIconFiles(const ShellLinkItemList& item_list) { |
| 781 for (ShellLinkItemList::const_iterator item = item_list.begin(); | 781 for (ShellLinkItemList::const_iterator item = item_list.begin(); |
| 782 item != item_list.end(); ++item) { | 782 item != item_list.end(); ++item) { |
| 783 FilePath icon_path; | 783 FilePath icon_path; |
| 784 if (CreateIconFile((*item)->data(), icon_dir_, &icon_path)) | 784 if (CreateIconFile((*item)->data(), icon_dir_, &icon_path)) |
| 785 (*item)->SetIcon(icon_path.value(), 0, true); | 785 (*item)->SetIcon(icon_path.value(), 0, true); |
| 786 } | 786 } |
| 787 } | 787 } |
| OLD | NEW |