Chromium Code Reviews| OLD | NEW |
|---|---|
| 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" | |
| 11 #include "chrome/installer/util/browser_distribution.h" | |
| 10 #include "chrome/installer/util/channel_info.h" | 12 #include "chrome/installer/util/channel_info.h" |
| 11 #include "chrome/installer/util/helper.h" | 13 #include "chrome/installer/util/helper.h" |
| 12 #include "chrome/installer/util/master_preferences.h" | 14 #include "chrome/installer/util/master_preferences.h" |
| 13 #include "chrome/installer/util/master_preferences_constants.h" | 15 #include "chrome/installer/util/master_preferences_constants.h" |
| 16 #include "chrome/installer/util/shell_util.h" | |
| 14 #include "chrome/installer/util/util_constants.h" | 17 #include "chrome/installer/util/util_constants.h" |
| 15 | 18 |
| 16 namespace installer { | 19 namespace installer { |
| 17 | 20 |
| 18 void ChromeAppHostOperations::ReadOptions( | 21 void ChromeAppHostOperations::ReadOptions( |
| 19 const MasterPreferences& prefs, | 22 const MasterPreferences& prefs, |
| 20 std::set<std::wstring>* options) const { | 23 std::set<std::wstring>* options) const { |
| 21 DCHECK(options); | 24 DCHECK(options); |
| 22 | 25 |
| 23 bool pref_value; | 26 bool pref_value; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 108 | 111 |
| 109 bool ChromeAppHostOperations::ShouldCreateUninstallEntry( | 112 bool ChromeAppHostOperations::ShouldCreateUninstallEntry( |
| 110 const std::set<std::wstring>& options) const { | 113 const std::set<std::wstring>& options) const { |
| 111 return (options.find(kOptionAppHostIsLauncher) != options.end()); | 114 return (options.find(kOptionAppHostIsLauncher) != options.end()); |
| 112 } | 115 } |
| 113 | 116 |
| 114 void ChromeAppHostOperations::AddDefaultShortcutProperties( | 117 void ChromeAppHostOperations::AddDefaultShortcutProperties( |
| 115 BrowserDistribution* dist, | 118 BrowserDistribution* dist, |
| 116 const FilePath& target_exe, | 119 const FilePath& target_exe, |
| 117 ShellUtil::ShortcutProperties* properties) const { | 120 ShellUtil::ShortcutProperties* properties) const { |
| 118 NOTREACHED() << "App Host does not create shortcuts."; | 121 if (!properties->has_target()) |
| 122 properties->set_target(target_exe); | |
| 123 if (!properties->has_arguments()) { | |
| 124 CommandLine app_host_args(CommandLine::NO_PROGRAM); | |
| 125 app_host_args.AppendSwitch(::switches::kShowAppList); | |
| 126 properties->set_arguments(app_host_args.GetCommandLineString()); | |
| 127 } | |
| 128 if (!properties->has_app_id()) { | |
| 129 std::vector<string16> components; | |
| 130 string16 suffix; | |
| 131 ShellUtil::GetUserSpecificRegistrySuffix(&suffix); | |
| 132 string16 baseAppId(dist->GetBaseAppId()); | |
|
gab
2012/11/08 00:40:07
nit: base_app_id (always user lower case, separate
huangs
2012/11/08 00:44:47
Done.
| |
| 133 baseAppId.append(suffix); | |
| 134 components.push_back(baseAppId); | |
| 135 properties->set_app_id(ShellUtil::BuildAppModelId(components)); | |
| 136 } | |
| 119 } | 137 } |
| 120 | 138 |
| 121 } // namespace installer | 139 } // namespace installer |
| OLD | NEW |