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/product.h" | 5 #include "chrome/installer/util/product.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 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_util.h" | 11 #include "base/process_util.h" |
| 12 #include "base/win/registry.h" | 12 #include "base/win/registry.h" |
| 13 #include "chrome/installer/util/chrome_app_host_operations.h" | 13 #include "chrome/installer/util/chrome_app_host_operations.h" |
| 14 #include "chrome/installer/util/chrome_binaries_operations.h" | 14 #include "chrome/installer/util/chrome_binaries_operations.h" |
| 15 #include "chrome/installer/util/chrome_browser_operations.h" | 15 #include "chrome/installer/util/chrome_browser_operations.h" |
| 16 #include "chrome/installer/util/chrome_browser_sxs_operations.h" | 16 #include "chrome/installer/util/chrome_browser_sxs_operations.h" |
| 17 #include "chrome/installer/util/chrome_frame_operations.h" | 17 #include "chrome/installer/util/chrome_frame_operations.h" |
| 18 #include "chrome/installer/util/google_update_constants.h" | 18 #include "chrome/installer/util/google_update_constants.h" |
| 19 #include "chrome/installer/util/helper.h" | 19 #include "chrome/installer/util/helper.h" |
| 20 #include "chrome/installer/util/install_util.h" | 20 #include "chrome/installer/util/install_util.h" |
| 21 #include "chrome/installer/util/master_preferences.h" | 21 #include "chrome/installer/util/master_preferences.h" |
| 22 #include "chrome/installer/util/master_preferences_constants.h" | 22 #include "chrome/installer/util/master_preferences_constants.h" |
| 23 #include "chrome/installer/util/product_operations.h" | 23 #include "chrome/installer/util/product_operations.h" |
| 24 #include "chrome/installer/util/user_experiment.h" | |
| 24 | 25 |
| 25 using base::win::RegKey; | 26 using base::win::RegKey; |
| 26 using installer::MasterPreferences; | 27 using installer::MasterPreferences; |
| 27 | 28 |
| 28 namespace installer { | 29 namespace installer { |
| 29 | 30 |
| 30 Product::Product(BrowserDistribution* distribution) | 31 Product::Product(BrowserDistribution* distribution) |
| 31 : distribution_(distribution) { | 32 : distribution_(distribution) { |
| 32 switch (distribution->GetType()) { | 33 switch (distribution->GetType()) { |
| 33 case BrowserDistribution::CHROME_BROWSER: | 34 case BrowserDistribution::CHROME_BROWSER: |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 156 return operations_->SetChannelFlags(options_, set, channel_info); | 157 return operations_->SetChannelFlags(options_, set, channel_info); |
| 157 } | 158 } |
| 158 | 159 |
| 159 void Product::AddDefaultShortcutProperties( | 160 void Product::AddDefaultShortcutProperties( |
| 160 const base::FilePath& target_exe, | 161 const base::FilePath& target_exe, |
| 161 ShellUtil::ShortcutProperties* properties) const { | 162 ShellUtil::ShortcutProperties* properties) const { |
| 162 return operations_->AddDefaultShortcutProperties( | 163 return operations_->AddDefaultShortcutProperties( |
| 163 distribution_, target_exe, properties); | 164 distribution_, target_exe, properties); |
| 164 } | 165 } |
| 165 | 166 |
| 167 void Product::LaunchUserExperiment(const base::FilePath& setup_path, | |
| 168 InstallStatus status, | |
| 169 bool system_level) const { | |
| 170 if (operations_->ShouldLaunchUserExperiment()) { | |
|
gab
2013/03/04 23:40:30
I'm really not a fan of having these two entry poi
grt (UTC plus 2)
2013/03/05 14:33:22
what i had in mind is:
if (distribution_->HasUse
gab
2013/03/05 14:58:00
Ah ok, the downside is that callers have to rememb
huangs
2013/03/05 15:38:00
Personally I'd prefer NOT changing Operations, sin
grt (UTC plus 2)
2013/03/05 16:30:49
If you want to avoid creating stub implementations
huangs
2013/03/05 16:48:34
Okay, I'm for making ProductOperationsImpl! Let's
| |
| 171 installer::user_experiment::LaunchUserExperiment(setup_path, status, | |
| 172 *this, system_level); | |
| 173 } | |
| 174 } | |
| 175 | |
| 166 } // namespace installer | 176 } // namespace installer |
| OLD | NEW |