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

Side by Side Diff: chrome/installer/util/chrome_app_host_operations.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/installer/util/chrome_app_host_operations.h" 5 #include "chrome/installer/util/chrome_app_host_operations.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 ShellUtil::ShortcutProperties* properties) const { 120 ShellUtil::ShortcutProperties* properties) const {
121 if (!properties->has_target()) 121 if (!properties->has_target())
122 properties->set_target(target_exe); 122 properties->set_target(target_exe);
123 123
124 if (!properties->has_arguments()) { 124 if (!properties->has_arguments()) {
125 CommandLine app_host_args(CommandLine::NO_PROGRAM); 125 CommandLine app_host_args(CommandLine::NO_PROGRAM);
126 app_host_args.AppendSwitch(::switches::kShowAppList); 126 app_host_args.AppendSwitch(::switches::kShowAppList);
127 properties->set_arguments(app_host_args.GetCommandLineString()); 127 properties->set_arguments(app_host_args.GetCommandLineString());
128 } 128 }
129 129
130 if (!properties->has_icon()) { 130 if (!properties->has_icon())
131 // Currently the App Launcher icon is inside chrome.exe, which we assume 131 properties->set_icon(target_exe, dist->GetIconIndex());
grt (UTC plus 2) 2012/11/13 16:19:32 target_exe -> dist->GetIconFile()
huangs 2012/11/13 20:41:54 Cannot do this, since target_exe has the full path
grt (UTC plus 2) 2012/11/14 15:55:14 Oh yeah, duh.
132 // to be located in the same directory as app_host.exe.
133 // TODO(huangs): Cause the icon to also be embedded in app_host.exe,
134 // and then point at this (as chrome.exe is _not_ in the same folder
135 // for system-level chrome installs, or may even be uninstalled).
136 FilePath chrome_exe(target_exe.DirName().Append(kChromeExe));
137 properties->set_icon(chrome_exe, dist->GetIconIndex());
138 }
139 132
140 if (!properties->has_app_id()) { 133 if (!properties->has_app_id()) {
141 std::vector<string16> components; 134 std::vector<string16> components;
142 string16 suffix; 135 string16 suffix;
143 ShellUtil::GetUserSpecificRegistrySuffix(&suffix); 136 ShellUtil::GetUserSpecificRegistrySuffix(&suffix);
144 string16 base_app_id(dist->GetBaseAppId()); 137 string16 base_app_id(dist->GetBaseAppId());
145 base_app_id.append(suffix); 138 base_app_id.append(suffix);
146 components.push_back(base_app_id); 139 components.push_back(base_app_id);
147 properties->set_app_id(ShellUtil::BuildAppModelId(components)); 140 properties->set_app_id(ShellUtil::BuildAppModelId(components));
148 } 141 }
149 } 142 }
150 143
151 } // namespace installer 144 } // namespace installer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698