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