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

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

Issue 1550493002: Switch to standard integer types in base/win/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
« no previous file with comments | « base/win/shortcut.h ('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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 } else { 176 } else {
177 SHChangeNotify(SHCNE_CREATE, SHCNF_PATH, shortcut_path.value().c_str(), 177 SHChangeNotify(SHCNE_CREATE, SHCNF_PATH, shortcut_path.value().c_str(),
178 NULL); 178 NULL);
179 } 179 }
180 } 180 }
181 181
182 return succeeded; 182 return succeeded;
183 } 183 }
184 184
185 bool ResolveShortcutProperties(const FilePath& shortcut_path, 185 bool ResolveShortcutProperties(const FilePath& shortcut_path,
186 uint32 options, 186 uint32_t options,
187 ShortcutProperties* properties) { 187 ShortcutProperties* properties) {
188 DCHECK(options && properties); 188 DCHECK(options && properties);
189 base::ThreadRestrictions::AssertIOAllowed(); 189 base::ThreadRestrictions::AssertIOAllowed();
190 190
191 if (options & ~ShortcutProperties::PROPERTIES_ALL) 191 if (options & ~ShortcutProperties::PROPERTIES_ALL)
192 NOTREACHED() << "Unhandled property is used."; 192 NOTREACHED() << "Unhandled property is used.";
193 193
194 ScopedComPtr<IShellLink> i_shell_link; 194 ScopedComPtr<IShellLink> i_shell_link;
195 195
196 // Get pointer to the IShellLink interface. 196 // Get pointer to the IShellLink interface.
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 } 289 }
290 } 290 }
291 } 291 }
292 292
293 return true; 293 return true;
294 } 294 }
295 295
296 bool ResolveShortcut(const FilePath& shortcut_path, 296 bool ResolveShortcut(const FilePath& shortcut_path,
297 FilePath* target_path, 297 FilePath* target_path,
298 string16* args) { 298 string16* args) {
299 uint32 options = 0; 299 uint32_t options = 0;
300 if (target_path) 300 if (target_path)
301 options |= ShortcutProperties::PROPERTIES_TARGET; 301 options |= ShortcutProperties::PROPERTIES_TARGET;
302 if (args) 302 if (args)
303 options |= ShortcutProperties::PROPERTIES_ARGUMENTS; 303 options |= ShortcutProperties::PROPERTIES_ARGUMENTS;
304 DCHECK(options); 304 DCHECK(options);
305 305
306 ShortcutProperties properties; 306 ShortcutProperties properties;
307 if (!ResolveShortcutProperties(shortcut_path, options, &properties)) 307 if (!ResolveShortcutProperties(shortcut_path, options, &properties))
308 return false; 308 return false;
309 309
(...skipping 27 matching lines...) Expand all
337 if (GetVersion() < VERSION_WIN7) 337 if (GetVersion() < VERSION_WIN7)
338 return false; 338 return false;
339 339
340 intptr_t result = reinterpret_cast<intptr_t>(ShellExecute( 340 intptr_t result = reinterpret_cast<intptr_t>(ShellExecute(
341 NULL, L"taskbarunpin", shortcut.value().c_str(), NULL, NULL, 0)); 341 NULL, L"taskbarunpin", shortcut.value().c_str(), NULL, NULL, 0));
342 return result > 32; 342 return result > 32;
343 } 343 }
344 344
345 } // namespace win 345 } // namespace win
346 } // namespace base 346 } // namespace base
OLDNEW
« no previous file with comments | « base/win/shortcut.h ('k') | base/win/shortcut_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698