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

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

Issue 2622883002: Remove BrowserDistribution::Type. (Closed)
Patch Set: Created 3 years, 11 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/product.h" 5 #include "chrome/installer/util/product.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/process/launch.h" 11 #include "base/process/launch.h"
12 #include "base/win/registry.h" 12 #include "base/win/registry.h"
13 #include "chrome/installer/util/chrome_browser_operations.h" 13 #include "chrome/installer/util/chrome_browser_operations.h"
14 #include "chrome/installer/util/chrome_browser_sxs_operations.h" 14 #include "chrome/installer/util/chrome_browser_sxs_operations.h"
15 #include "chrome/installer/util/google_update_constants.h" 15 #include "chrome/installer/util/google_update_constants.h"
16 #include "chrome/installer/util/install_util.h" 16 #include "chrome/installer/util/install_util.h"
17 #include "chrome/installer/util/master_preferences.h" 17 #include "chrome/installer/util/master_preferences.h"
18 #include "chrome/installer/util/master_preferences_constants.h" 18 #include "chrome/installer/util/master_preferences_constants.h"
19 #include "chrome/installer/util/product_operations.h" 19 #include "chrome/installer/util/product_operations.h"
20 20
21 using base::win::RegKey; 21 using base::win::RegKey;
22 using installer::MasterPreferences; 22 using installer::MasterPreferences;
23 23
24 namespace installer { 24 namespace installer {
25 25
26 Product::Product(BrowserDistribution* distribution) 26 Product::Product(BrowserDistribution* distribution)
27 : distribution_(distribution) { 27 : distribution_(distribution),
28 switch (distribution->GetType()) { 28 operations_(InstallUtil::IsChromeSxSProcess()
29 case BrowserDistribution::CHROME_BROWSER: 29 ? new ChromeBrowserSxSOperations()
30 operations_.reset(InstallUtil::IsChromeSxSProcess() ? 30 : new ChromeBrowserOperations()) {}
31 new ChromeBrowserSxSOperations() :
32 new ChromeBrowserOperations());
33 break;
34 default:
35 NOTREACHED() << "Unsupported BrowserDistribution::Type: "
36 << distribution->GetType();
37 }
38 }
39 31
40 Product::~Product() { 32 Product::~Product() {
41 } 33 }
42 34
43 void Product::InitializeFromPreferences(const MasterPreferences& prefs) { 35 void Product::InitializeFromPreferences(const MasterPreferences& prefs) {
44 operations_->ReadOptions(prefs, &options_); 36 operations_->ReadOptions(prefs, &options_);
45 } 37 }
46 38
47 void Product::InitializeFromUninstallCommand( 39 void Product::InitializeFromUninstallCommand(
48 const base::CommandLine& uninstall_command) { 40 const base::CommandLine& uninstall_command) {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 if (distribution_->HasUserExperiments()) { 139 if (distribution_->HasUserExperiments()) {
148 VLOG(1) << "LaunchUserExperiment status: " << status << " product: " 140 VLOG(1) << "LaunchUserExperiment status: " << status << " product: "
149 << distribution_->GetDisplayName() 141 << distribution_->GetDisplayName()
150 << " system_level: " << system_level; 142 << " system_level: " << system_level;
151 operations_->LaunchUserExperiment( 143 operations_->LaunchUserExperiment(
152 setup_path, options_, status, system_level); 144 setup_path, options_, status, system_level);
153 } 145 }
154 } 146 }
155 147
156 } // namespace installer 148 } // namespace installer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698