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

Side by Side Diff: base/win/shortcut.cc

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months 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
« no previous file with comments | « base/test/test_file_util_win.cc ('k') | base/win/shortcut_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/win/shortcut.h" 5 #include "base/win/shortcut.h"
6 6
7 #include <shellapi.h> 7 #include <shellapi.h>
8 #include <shlobj.h> 8 #include <shlobj.h>
9 #include <propkey.h> 9 #include <propkey.h>
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 ShortcutOperation operation) { 46 ShortcutOperation operation) {
47 base::ThreadRestrictions::AssertIOAllowed(); 47 base::ThreadRestrictions::AssertIOAllowed();
48 48
49 // A target is required unless |operation| is SHORTCUT_UPDATE_EXISTING. 49 // A target is required unless |operation| is SHORTCUT_UPDATE_EXISTING.
50 if (operation != SHORTCUT_UPDATE_EXISTING && 50 if (operation != SHORTCUT_UPDATE_EXISTING &&
51 !(properties.options & ShortcutProperties::PROPERTIES_TARGET)) { 51 !(properties.options & ShortcutProperties::PROPERTIES_TARGET)) {
52 NOTREACHED(); 52 NOTREACHED();
53 return false; 53 return false;
54 } 54 }
55 55
56 bool shortcut_existed = file_util::PathExists(shortcut_path); 56 bool shortcut_existed = PathExists(shortcut_path);
57 57
58 // Interfaces to the old shortcut when replacing an existing shortcut. 58 // Interfaces to the old shortcut when replacing an existing shortcut.
59 ScopedComPtr<IShellLink> old_i_shell_link; 59 ScopedComPtr<IShellLink> old_i_shell_link;
60 ScopedComPtr<IPersistFile> old_i_persist_file; 60 ScopedComPtr<IPersistFile> old_i_persist_file;
61 61
62 // Interfaces to the shortcut being created/updated. 62 // Interfaces to the shortcut being created/updated.
63 ScopedComPtr<IShellLink> i_shell_link; 63 ScopedComPtr<IShellLink> i_shell_link;
64 ScopedComPtr<IPersistFile> i_persist_file; 64 ScopedComPtr<IPersistFile> i_persist_file;
65 switch (operation) { 65 switch (operation) {
66 case SHORTCUT_CREATE_ALWAYS: 66 case SHORTCUT_CREATE_ALWAYS:
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 if (base::win::GetVersion() < base::win::VERSION_WIN7) 240 if (base::win::GetVersion() < base::win::VERSION_WIN7)
241 return false; 241 return false;
242 242
243 int result = reinterpret_cast<int>(ShellExecute(NULL, L"taskbarunpin", 243 int result = reinterpret_cast<int>(ShellExecute(NULL, L"taskbarunpin",
244 shortcut, NULL, NULL, 0)); 244 shortcut, NULL, NULL, 0));
245 return result > 32; 245 return result > 32;
246 } 246 }
247 247
248 } // namespace win 248 } // namespace win
249 } // namespace base 249 } // namespace base
OLDNEW
« no previous file with comments | « base/test/test_file_util_win.cc ('k') | base/win/shortcut_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698