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_browser_operations.h" | 5 #include "chrome/installer/util/chrome_browser_operations.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 BrowserDistribution* dist, | 108 BrowserDistribution* dist, |
109 const base::FilePath& target_exe, | 109 const base::FilePath& target_exe, |
110 ShellUtil::ShortcutProperties* properties) const { | 110 ShellUtil::ShortcutProperties* properties) const { |
111 if (!properties->has_target()) | 111 if (!properties->has_target()) |
112 properties->set_target(target_exe); | 112 properties->set_target(target_exe); |
113 | 113 |
114 if (!properties->has_icon()) { | 114 if (!properties->has_icon()) { |
115 int icon_index = dist->GetIconIndex(); | 115 int icon_index = dist->GetIconIndex(); |
116 base::FilePath prefs_path(target_exe.DirName().AppendASCII( | 116 base::FilePath prefs_path(target_exe.DirName().AppendASCII( |
117 installer::kDefaultMasterPrefs)); | 117 installer::kDefaultMasterPrefs)); |
118 if (file_util::PathExists(prefs_path)) { | 118 if (base::PathExists(prefs_path)) { |
119 installer::MasterPreferences prefs(prefs_path); | 119 installer::MasterPreferences prefs(prefs_path); |
120 prefs.GetInt(installer::master_preferences::kChromeShortcutIconIndex, | 120 prefs.GetInt(installer::master_preferences::kChromeShortcutIconIndex, |
121 &icon_index); | 121 &icon_index); |
122 } | 122 } |
123 properties->set_icon(target_exe, icon_index); | 123 properties->set_icon(target_exe, icon_index); |
124 } | 124 } |
125 | 125 |
126 if (!properties->has_app_id()) { | 126 if (!properties->has_app_id()) { |
127 bool is_per_user_install = | 127 bool is_per_user_install = |
128 InstallUtil::IsPerUserInstall(target_exe.value().c_str()); | 128 InstallUtil::IsPerUserInstall(target_exe.value().c_str()); |
129 properties->set_app_id( | 129 properties->set_app_id( |
130 ShellUtil::GetBrowserModelId(dist, is_per_user_install)); | 130 ShellUtil::GetBrowserModelId(dist, is_per_user_install)); |
131 } | 131 } |
132 | 132 |
133 if (!properties->has_description()) | 133 if (!properties->has_description()) |
134 properties->set_description(dist->GetAppDescription()); | 134 properties->set_description(dist->GetAppDescription()); |
135 } | 135 } |
136 | 136 |
137 void ChromeBrowserOperations::LaunchUserExperiment( | 137 void ChromeBrowserOperations::LaunchUserExperiment( |
138 const base::FilePath& setup_path, | 138 const base::FilePath& setup_path, |
139 const std::set<string16>& options, | 139 const std::set<string16>& options, |
140 InstallStatus status, | 140 InstallStatus status, |
141 bool system_level) const { | 141 bool system_level) const { |
142 CommandLine base_command(setup_path); | 142 CommandLine base_command(setup_path); |
143 AppendProductFlags(options, &base_command); | 143 AppendProductFlags(options, &base_command); |
144 installer::LaunchBrowserUserExperiment(base_command, status, system_level); | 144 installer::LaunchBrowserUserExperiment(base_command, status, system_level); |
145 } | 145 } |
146 | 146 |
147 } // namespace installer | 147 } // namespace installer |
OLD | NEW |