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

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: Clean up to get Program and Features uninstall icon to work more generally. 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 427
428 string16 ShellIntegration::GetChromiumIconPath() { 428 string16 ShellIntegration::GetChromiumIconPath() {
429 // Determine the app path. If we can't determine what that is, we have 429 // Determine the app path. If we can't determine what that is, we have
430 // bigger fish to fry... 430 // bigger fish to fry...
431 FilePath app_path; 431 FilePath app_path;
432 if (!PathService::Get(base::FILE_EXE, &app_path)) { 432 if (!PathService::Get(base::FILE_EXE, &app_path)) {
433 NOTREACHED(); 433 NOTREACHED();
434 return string16(); 434 return string16();
435 } 435 }
436 436
437 string16 icon_path(app_path.value()); 437 return ShellUtil::GetChromeIcon(BrowserDistribution::GetDistribution(),
438 icon_path.push_back(','); 438 app_path.value());
gab 2012/11/13 14:15:12 If this call is going to be used this way (i.e. to
huangs 2012/11/13 20:41:54 Done, calling it GetResourceString() per F2F. Als
grt (UTC plus 2) 2012/11/14 15:55:14 What resource types other than icons are typically
grt (UTC plus 2) 2012/11/14 18:31:09 ping
huangs 2012/11/14 20:35:55 Yeah, GetIconString() sounds more appropriate. Al
439 icon_path += base::IntToString16(
440 BrowserDistribution::GetDistribution()->GetIconIndex());
441 return icon_path;
442 } 439 }
443 440
444 void ShellIntegration::MigrateChromiumShortcuts() { 441 void ShellIntegration::MigrateChromiumShortcuts() {
445 if (base::win::GetVersion() < base::win::VERSION_WIN7) 442 if (base::win::GetVersion() < base::win::VERSION_WIN7)
446 return; 443 return;
447 444
448 BrowserThread::PostTask( 445 BrowserThread::PostTask(
449 BrowserThread::FILE, FROM_HERE, 446 BrowserThread::FILE, FROM_HERE,
450 base::Bind(&MigrateChromiumShortcutsCallback)); 447 base::Bind(&MigrateChromiumShortcutsCallback));
451 } 448 }
(...skipping 18 matching lines...) Expand all
470 } 467 }
471 468
472 shortcut = shortcut.Append(shortcut_name).Append(shortcut_name + 469 shortcut = shortcut.Append(shortcut_name).Append(shortcut_name +
473 installer::kLnkExt); 470 installer::kLnkExt);
474 if (file_util::PathExists(shortcut)) 471 if (file_util::PathExists(shortcut))
475 return shortcut; 472 return shortcut;
476 } 473 }
477 474
478 return FilePath(); 475 return FilePath();
479 } 476 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698