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

Side by Side Diff: chrome/installer/util/chrome_browser_operations.cc

Issue 15255004: Refactor of BrowserDistribution. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rework Created 7 years, 5 months 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_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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 // - app_id: the browser model id for the current install. 105 // - app_id: the browser model id for the current install.
106 // - description: |dist|'s description. 106 // - description: |dist|'s description.
107 void ChromeBrowserOperations::AddDefaultShortcutProperties( 107 void ChromeBrowserOperations::AddDefaultShortcutProperties(
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 =
116 dist->GetIconIndex(BrowserDistribution::SHORTCUT_CHROME);
116 base::FilePath prefs_path(target_exe.DirName().AppendASCII( 117 base::FilePath prefs_path(target_exe.DirName().AppendASCII(
117 installer::kDefaultMasterPrefs)); 118 installer::kDefaultMasterPrefs));
118 if (file_util::PathExists(prefs_path)) { 119 if (file_util::PathExists(prefs_path)) {
119 installer::MasterPreferences prefs(prefs_path); 120 installer::MasterPreferences prefs(prefs_path);
120 prefs.GetInt(installer::master_preferences::kChromeShortcutIconIndex, 121 prefs.GetInt(installer::master_preferences::kChromeShortcutIconIndex,
121 &icon_index); 122 &icon_index);
122 } 123 }
123 properties->set_icon(target_exe, icon_index); 124 properties->set_icon(target_exe, icon_index);
124 } 125 }
125 126
(...skipping 12 matching lines...) Expand all
138 const base::FilePath& setup_path, 139 const base::FilePath& setup_path,
139 const std::set<string16>& options, 140 const std::set<string16>& options,
140 InstallStatus status, 141 InstallStatus status,
141 bool system_level) const { 142 bool system_level) const {
142 CommandLine base_command(setup_path); 143 CommandLine base_command(setup_path);
143 AppendProductFlags(options, &base_command); 144 AppendProductFlags(options, &base_command);
144 installer::LaunchBrowserUserExperiment(base_command, status, system_level); 145 installer::LaunchBrowserUserExperiment(base_command, status, system_level);
145 } 146 }
146 147
147 } // namespace installer 148 } // namespace installer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698