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

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

Issue 1128733002: Update from https://crrev.com/328418 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 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/scoped_variant_unittest.cc ('k') | base/win/startup_information.h » ('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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 return true; 314 return true;
315 } 315 }
316 316
317 bool TaskbarPinShortcutLink(const wchar_t* shortcut) { 317 bool TaskbarPinShortcutLink(const wchar_t* shortcut) {
318 base::ThreadRestrictions::AssertIOAllowed(); 318 base::ThreadRestrictions::AssertIOAllowed();
319 319
320 // "Pin to taskbar" is only supported after Win7. 320 // "Pin to taskbar" is only supported after Win7.
321 if (GetVersion() < VERSION_WIN7) 321 if (GetVersion() < VERSION_WIN7)
322 return false; 322 return false;
323 323
324 int result = reinterpret_cast<int>(ShellExecute(NULL, L"taskbarpin", shortcut, 324 intptr_t result = reinterpret_cast<intptr_t>(
325 NULL, NULL, 0)); 325 ShellExecute(NULL, L"taskbarpin", shortcut, NULL, NULL, 0));
326 return result > 32; 326 return result > 32;
327 } 327 }
328 328
329 bool TaskbarUnpinShortcutLink(const wchar_t* shortcut) { 329 bool TaskbarUnpinShortcutLink(const wchar_t* shortcut) {
330 base::ThreadRestrictions::AssertIOAllowed(); 330 base::ThreadRestrictions::AssertIOAllowed();
331 331
332 // "Unpin from taskbar" is only supported after Win7. 332 // "Unpin from taskbar" is only supported after Win7.
333 if (GetVersion() < VERSION_WIN7) 333 if (GetVersion() < VERSION_WIN7)
334 return false; 334 return false;
335 335
336 int result = reinterpret_cast<int>(ShellExecute(NULL, L"taskbarunpin", 336 intptr_t result = reinterpret_cast<intptr_t>(
337 shortcut, NULL, NULL, 0)); 337 ShellExecute(NULL, L"taskbarunpin", shortcut, NULL, NULL, 0));
338 return result > 32; 338 return result > 32;
339 } 339 }
340 340
341 } // namespace win 341 } // namespace win
342 } // namespace base 342 } // namespace base
OLDNEW
« no previous file with comments | « base/win/scoped_variant_unittest.cc ('k') | base/win/startup_information.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698