OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/shell_integration.h" | 5 #include "chrome/browser/shell_integration.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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 bool MigrateChromiumShortcutsTask::GetExpectedAppId( | 200 bool MigrateChromiumShortcutsTask::GetExpectedAppId( |
201 IShellLink* shell_link, | 201 IShellLink* shell_link, |
202 std::wstring* expected_app_id) const { | 202 std::wstring* expected_app_id) const { |
203 DCHECK(shell_link); | 203 DCHECK(shell_link); |
204 DCHECK(expected_app_id); | 204 DCHECK(expected_app_id); |
205 | 205 |
206 expected_app_id->clear(); | 206 expected_app_id->clear(); |
207 | 207 |
208 // Check if the shortcut points to chrome_exe. | 208 // Check if the shortcut points to chrome_exe. |
209 std::wstring source; | 209 std::wstring source; |
210 if (FAILED(shell_link->GetPath(WriteInto(&source, MAX_PATH), | 210 if (FAILED(shell_link->GetPath(WriteInto(&source, MAX_PATH), MAX_PATH, NULL, |
211 MAX_PATH, | |
212 NULL, | |
213 SLGP_RAWPATH)) || | 211 SLGP_RAWPATH)) || |
214 lstrcmpi(chrome_exe_.value().c_str(), source.c_str())) | 212 lstrcmpi(chrome_exe_.value().c_str(), source.c_str())) |
215 return false; | 213 return false; |
216 | 214 |
217 std::wstring arguments; | 215 std::wstring arguments; |
218 if (FAILED(shell_link->GetArguments(WriteInto(&arguments, MAX_PATH), | 216 if (FAILED(shell_link->GetArguments(WriteInto(&arguments, MAX_PATH), |
219 MAX_PATH))) | 217 MAX_PATH))) |
220 return false; | 218 return false; |
221 | 219 |
222 // Get expected app id from shortcut command line. | 220 // Get expected app id from shortcut command line. |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 return icon_path; | 537 return icon_path; |
540 } | 538 } |
541 | 539 |
542 void ShellIntegration::MigrateChromiumShortcuts() { | 540 void ShellIntegration::MigrateChromiumShortcuts() { |
543 if (base::win::GetVersion() < base::win::VERSION_WIN7) | 541 if (base::win::GetVersion() < base::win::VERSION_WIN7) |
544 return; | 542 return; |
545 | 543 |
546 BrowserThread::PostTask( | 544 BrowserThread::PostTask( |
547 BrowserThread::FILE, FROM_HERE, new MigrateChromiumShortcutsTask()); | 545 BrowserThread::FILE, FROM_HERE, new MigrateChromiumShortcutsTask()); |
548 } | 546 } |
OLD | NEW |