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

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

Issue 11359133: Add default icon to app_host.exe, and use it in shortcuts during installation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixing comments. Created 8 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
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 "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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 dist, InstallUtil::IsPerUserInstall(chrome_exe.value().c_str())), 418 dist, InstallUtil::IsPerUserInstall(chrome_exe.value().c_str())),
419 profile_path); 419 profile_path);
420 } 420 }
421 421
422 string16 ShellIntegration::GetAppListAppModelIdForProfile( 422 string16 ShellIntegration::GetAppListAppModelIdForProfile(
423 const FilePath& profile_path) { 423 const FilePath& profile_path) {
424 return ShellIntegration::GetAppModelIdForProfile(kAppListAppName, 424 return ShellIntegration::GetAppModelIdForProfile(kAppListAppName,
425 profile_path); 425 profile_path);
426 } 426 }
427 427
428 string16 ShellIntegration::GetChromiumIconPath() { 428 string16 ShellIntegration::GetChromiumIconString() {
429 // Determine the app path. If we can't determine what that is, we have 429 // Determine the path to chrome.exe. If we can't determine what that is,
430 // bigger fish to fry... 430 // we have bigger fish to fry...
431 FilePath app_path; 431 FilePath chrome_exe;
432 if (!PathService::Get(base::FILE_EXE, &app_path)) { 432 if (!PathService::Get(base::FILE_EXE, &chrome_exe)) {
433 NOTREACHED(); 433 NOTREACHED();
434 return string16(); 434 return string16();
435 } 435 }
436 436
437 string16 icon_path(app_path.value()); 437 return ShellUtil::GetIconString(
438 icon_path.push_back(','); 438 chrome_exe.value(),
439 icon_path += base::IntToString16(
440 BrowserDistribution::GetDistribution()->GetIconIndex()); 439 BrowserDistribution::GetDistribution()->GetIconIndex());
441 return icon_path;
442 } 440 }
443 441
444 void ShellIntegration::MigrateChromiumShortcuts() { 442 void ShellIntegration::MigrateChromiumShortcuts() {
445 if (base::win::GetVersion() < base::win::VERSION_WIN7) 443 if (base::win::GetVersion() < base::win::VERSION_WIN7)
446 return; 444 return;
447 445
448 BrowserThread::PostTask( 446 BrowserThread::PostTask(
449 BrowserThread::FILE, FROM_HERE, 447 BrowserThread::FILE, FROM_HERE,
450 base::Bind(&MigrateChromiumShortcutsCallback)); 448 base::Bind(&MigrateChromiumShortcutsCallback));
451 } 449 }
(...skipping 18 matching lines...) Expand all
470 } 468 }
471 469
472 shortcut = shortcut.Append(shortcut_name).Append(shortcut_name + 470 shortcut = shortcut.Append(shortcut_name).Append(shortcut_name +
473 installer::kLnkExt); 471 installer::kLnkExt);
474 if (file_util::PathExists(shortcut)) 472 if (file_util::PathExists(shortcut))
475 return shortcut; 473 return shortcut;
476 } 474 }
477 475
478 return FilePath(); 476 return FilePath();
479 } 477 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698