| 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" | |
| 20 #include "chrome/installer/util/install_util.h" | 19 #include "chrome/installer/util/install_util.h" |
| 21 #include "chrome/installer/util/master_preferences.h" | 20 #include "chrome/installer/util/master_preferences.h" |
| 22 #include "chrome/installer/util/master_preferences_constants.h" | 21 #include "chrome/installer/util/master_preferences_constants.h" |
| 23 #include "chrome/installer/util/product_operations.h" | 22 #include "chrome/installer/util/product_operations.h" |
| 24 | 23 |
| 25 using base::win::RegKey; | 24 using base::win::RegKey; |
| 26 using installer::MasterPreferences; | 25 using installer::MasterPreferences; |
| 27 | 26 |
| 28 namespace installer { | 27 namespace installer { |
| 29 | 28 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 56 void Product::InitializeFromPreferences(const MasterPreferences& prefs) { | 55 void Product::InitializeFromPreferences(const MasterPreferences& prefs) { |
| 57 operations_->ReadOptions(prefs, &options_); | 56 operations_->ReadOptions(prefs, &options_); |
| 58 } | 57 } |
| 59 | 58 |
| 60 void Product::InitializeFromUninstallCommand( | 59 void Product::InitializeFromUninstallCommand( |
| 61 const CommandLine& uninstall_command) { | 60 const CommandLine& uninstall_command) { |
| 62 operations_->ReadOptions(uninstall_command, &options_); | 61 operations_->ReadOptions(uninstall_command, &options_); |
| 63 } | 62 } |
| 64 | 63 |
| 65 void Product::GetUserDataPaths(std::vector<base::FilePath>* paths) const { | 64 void Product::GetUserDataPaths(std::vector<base::FilePath>* paths) const { |
| 66 GetChromeUserDataPaths(distribution_, paths); | 65 distribution_->GetUserDataPaths(paths); |
| 67 } | 66 } |
| 68 | 67 |
| 69 bool Product::LaunchChrome(const base::FilePath& application_path) const { | 68 bool Product::LaunchChrome(const base::FilePath& application_path) const { |
| 70 bool success = !application_path.empty(); | 69 bool success = !application_path.empty(); |
| 71 if (success) { | 70 if (success) { |
| 72 CommandLine cmd(application_path.Append(installer::kChromeExe)); | 71 CommandLine cmd(application_path.Append(installer::kChromeExe)); |
| 73 success = base::LaunchProcess(cmd, base::LaunchOptions(), NULL); | 72 success = base::LaunchProcess(cmd, base::LaunchOptions(), NULL); |
| 74 } | 73 } |
| 75 return success; | 74 return success; |
| 76 } | 75 } |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 return operations_->SetChannelFlags(options_, set, channel_info); | 155 return operations_->SetChannelFlags(options_, set, channel_info); |
| 157 } | 156 } |
| 158 | 157 |
| 159 void Product::AddDefaultShortcutProperties( | 158 void Product::AddDefaultShortcutProperties( |
| 160 const base::FilePath& target_exe, | 159 const base::FilePath& target_exe, |
| 161 ShellUtil::ShortcutProperties* properties) const { | 160 ShellUtil::ShortcutProperties* properties) const { |
| 162 return operations_->AddDefaultShortcutProperties( | 161 return operations_->AddDefaultShortcutProperties( |
| 163 distribution_, target_exe, properties); | 162 distribution_, target_exe, properties); |
| 164 } | 163 } |
| 165 | 164 |
| 165 void Product::LaunchUserExperiment(const base::FilePath& setup_path, |
| 166 InstallStatus status, |
| 167 bool system_level) const { |
| 168 if (distribution_->HasUserExperiments()) { |
| 169 operations_->LaunchUserExperiment( |
| 170 setup_path, options_, distribution_, status, system_level); |
| 171 } |
| 172 } |
| 173 |
| 166 } // namespace installer | 174 } // namespace installer |
| OLD | NEW |