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

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

Issue 57173002: Adds the concept of a 'safe mode' hotkey start (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 1 month 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/win/shortcut.h ('k') | chrome/browser/chrome_browser_main_win.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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 return false; 136 return false;
137 } 137 }
138 if (has_dual_mode && 138 if (has_dual_mode &&
139 !SetBooleanValueForPropertyStore(property_store, 139 !SetBooleanValueForPropertyStore(property_store,
140 PKEY_AppUserModel_IsDualMode, 140 PKEY_AppUserModel_IsDualMode,
141 properties.dual_mode)) { 141 properties.dual_mode)) {
142 return false; 142 return false;
143 } 143 }
144 } 144 }
145 145
146 if ((properties.options & ShortcutProperties::PROPERTIES_HOTKEY) &&
147 FAILED(i_shell_link->SetHotkey(LOWORD(properties.hotkey)))) {
148 return false;
149 }
150
146 // Release the interfaces to the old shortcut to make sure it doesn't prevent 151 // Release the interfaces to the old shortcut to make sure it doesn't prevent
147 // overwriting it if needed. 152 // overwriting it if needed.
148 old_i_persist_file.Release(); 153 old_i_persist_file.Release();
149 old_i_shell_link.Release(); 154 old_i_shell_link.Release();
150 155
151 HRESULT result = i_persist_file->Save(shortcut_path.value().c_str(), TRUE); 156 HRESULT result = i_persist_file->Save(shortcut_path.value().c_str(), TRUE);
152 157
153 // Release the interfaces in case the SHChangeNotify call below depends on 158 // Release the interfaces in case the SHChangeNotify call below depends on
154 // the operations above being fully completed. 159 // the operations above being fully completed.
155 i_persist_file.Release(); 160 i_persist_file.Release();
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 if (base::win::GetVersion() < base::win::VERSION_WIN7) 245 if (base::win::GetVersion() < base::win::VERSION_WIN7)
241 return false; 246 return false;
242 247
243 int result = reinterpret_cast<int>(ShellExecute(NULL, L"taskbarunpin", 248 int result = reinterpret_cast<int>(ShellExecute(NULL, L"taskbarunpin",
244 shortcut, NULL, NULL, 0)); 249 shortcut, NULL, NULL, 0));
245 return result > 32; 250 return result > 32;
246 } 251 }
247 252
248 } // namespace win 253 } // namespace win
249 } // namespace base 254 } // namespace base
OLDNEW
« no previous file with comments | « base/win/shortcut.h ('k') | chrome/browser/chrome_browser_main_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698