Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: chrome/browser/jumplist_win.cc

Issue 99923002: Move temp file functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 } 226 }
227 227
228 // Creates a temporary icon file to be shown in JumpList. 228 // Creates a temporary icon file to be shown in JumpList.
229 bool CreateIconFile(const SkBitmap& bitmap, 229 bool CreateIconFile(const SkBitmap& bitmap,
230 const base::FilePath& icon_dir, 230 const base::FilePath& icon_dir,
231 base::FilePath* icon_path) { 231 base::FilePath* icon_path) {
232 // Retrieve the path to a temporary file. 232 // Retrieve the path to a temporary file.
233 // We don't have to care about the extension of this temporary file because 233 // We don't have to care about the extension of this temporary file because
234 // JumpList does not care about it. 234 // JumpList does not care about it.
235 base::FilePath path; 235 base::FilePath path;
236 if (!file_util::CreateTemporaryFileInDir(icon_dir, &path)) 236 if (!base::CreateTemporaryFileInDir(icon_dir, &path))
237 return false; 237 return false;
238 238
239 // Create an icon file from the favicon attached to the given |page|, and 239 // Create an icon file from the favicon attached to the given |page|, and
240 // save it as the temporary file. 240 // save it as the temporary file.
241 gfx::ImageFamily image_family; 241 gfx::ImageFamily image_family;
242 image_family.Add(gfx::Image::CreateFrom1xBitmap(bitmap)); 242 image_family.Add(gfx::Image::CreateFrom1xBitmap(bitmap));
243 if (!IconUtil::CreateIconFileFromImageFamily(image_family, path)) 243 if (!IconUtil::CreateIconFileFromImageFamily(image_family, path))
244 return false; 244 return false;
245 245
246 // Add this icon file to the list and return its absolute path. 246 // Add this icon file to the list and return its absolute path.
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 } 754 }
755 755
756 void JumpList::CreateIconFiles(const ShellLinkItemList& item_list) { 756 void JumpList::CreateIconFiles(const ShellLinkItemList& item_list) {
757 for (ShellLinkItemList::const_iterator item = item_list.begin(); 757 for (ShellLinkItemList::const_iterator item = item_list.begin();
758 item != item_list.end(); ++item) { 758 item != item_list.end(); ++item) {
759 base::FilePath icon_path; 759 base::FilePath icon_path;
760 if (CreateIconFile((*item)->data(), icon_dir_, &icon_path)) 760 if (CreateIconFile((*item)->data(), icon_dir_, &icon_path))
761 (*item)->SetIcon(icon_path.value(), 0, true); 761 (*item)->SetIcon(icon_path.value(), 0, true);
762 } 762 }
763 } 763 }
OLDNEW
« no previous file with comments | « chrome/browser/history/redirect_browsertest.cc ('k') | chrome/browser/media/chrome_webrtc_audio_quality_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698