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

Side by Side Diff: chrome/browser/shell_integration_win.cc

Issue 8418034: Make string_util::WriteInto() DCHECK() that the supplied |length_with_null| > 1, meaning that the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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
OLDNEW
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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 bool MigrateChromiumShortcutsTask::GetExpectedAppId( 198 bool MigrateChromiumShortcutsTask::GetExpectedAppId(
199 IShellLink* shell_link, 199 IShellLink* shell_link,
200 std::wstring* expected_app_id) const { 200 std::wstring* expected_app_id) const {
201 DCHECK(shell_link); 201 DCHECK(shell_link);
202 DCHECK(expected_app_id); 202 DCHECK(expected_app_id);
203 203
204 expected_app_id->clear(); 204 expected_app_id->clear();
205 205
206 // Check if the shortcut points to chrome_exe. 206 // Check if the shortcut points to chrome_exe.
207 std::wstring source; 207 std::wstring source;
208 if (FAILED(shell_link->GetPath(WriteInto(&source, MAX_PATH), 208 if (FAILED(shell_link->GetPath(WriteInto(&source, MAX_PATH), MAX_PATH, NULL,
209 MAX_PATH,
210 NULL,
211 SLGP_RAWPATH)) || 209 SLGP_RAWPATH)) ||
212 lstrcmpi(chrome_exe_.value().c_str(), source.c_str())) 210 lstrcmpi(chrome_exe_.value().c_str(), source.c_str()))
213 return false; 211 return false;
214 212
215 std::wstring arguments; 213 std::wstring arguments;
216 if (FAILED(shell_link->GetArguments(WriteInto(&arguments, MAX_PATH), 214 if (FAILED(shell_link->GetArguments(WriteInto(&arguments, MAX_PATH),
217 MAX_PATH))) 215 MAX_PATH)))
218 return false; 216 return false;
219 217
220 // Get expected app id from shortcut command line. 218 // Get expected app id from shortcut command line.
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 return icon_path; 535 return icon_path;
538 } 536 }
539 537
540 void ShellIntegration::MigrateChromiumShortcuts() { 538 void ShellIntegration::MigrateChromiumShortcuts() {
541 if (base::win::GetVersion() < base::win::VERSION_WIN7) 539 if (base::win::GetVersion() < base::win::VERSION_WIN7)
542 return; 540 return;
543 541
544 BrowserThread::PostTask( 542 BrowserThread::PostTask(
545 BrowserThread::FILE, FROM_HERE, new MigrateChromiumShortcutsTask()); 543 BrowserThread::FILE, FROM_HERE, new MigrateChromiumShortcutsTask());
546 } 544 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698