| 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 <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_binaries_operations.h" | 13 #include "chrome/installer/util/chrome_binaries_operations.h" |
| 14 #include "chrome/installer/util/chrome_browser_operations.h" | 14 #include "chrome/installer/util/chrome_browser_operations.h" |
| 15 #include "chrome/installer/util/chrome_browser_sxs_operations.h" | 15 #include "chrome/installer/util/chrome_browser_sxs_operations.h" |
| 16 #include "chrome/installer/util/chrome_frame_operations.h" | |
| 17 #include "chrome/installer/util/google_update_constants.h" | 16 #include "chrome/installer/util/google_update_constants.h" |
| 18 #include "chrome/installer/util/helper.h" | |
| 19 #include "chrome/installer/util/install_util.h" | 17 #include "chrome/installer/util/install_util.h" |
| 20 #include "chrome/installer/util/master_preferences.h" | 18 #include "chrome/installer/util/master_preferences.h" |
| 21 #include "chrome/installer/util/master_preferences_constants.h" | 19 #include "chrome/installer/util/master_preferences_constants.h" |
| 22 #include "chrome/installer/util/product_operations.h" | 20 #include "chrome/installer/util/product_operations.h" |
| 23 | 21 |
| 24 using base::win::RegKey; | 22 using base::win::RegKey; |
| 25 using installer::MasterPreferences; | 23 using installer::MasterPreferences; |
| 26 | 24 |
| 27 namespace installer { | 25 namespace installer { |
| 28 | 26 |
| 29 Product::Product(BrowserDistribution* distribution) | 27 Product::Product(BrowserDistribution* distribution) |
| 30 : distribution_(distribution) { | 28 : distribution_(distribution) { |
| 31 switch (distribution->GetType()) { | 29 switch (distribution->GetType()) { |
| 32 case BrowserDistribution::CHROME_BROWSER: | 30 case BrowserDistribution::CHROME_BROWSER: |
| 33 operations_.reset(InstallUtil::IsChromeSxSProcess() ? | 31 operations_.reset(InstallUtil::IsChromeSxSProcess() ? |
| 34 new ChromeBrowserSxSOperations() : | 32 new ChromeBrowserSxSOperations() : |
| 35 new ChromeBrowserOperations()); | 33 new ChromeBrowserOperations()); |
| 36 break; | 34 break; |
| 37 case BrowserDistribution::CHROME_FRAME: | |
| 38 operations_.reset(new ChromeFrameOperations()); | |
| 39 break; | |
| 40 case BrowserDistribution::CHROME_BINARIES: | 35 case BrowserDistribution::CHROME_BINARIES: |
| 41 operations_.reset(new ChromeBinariesOperations()); | 36 operations_.reset(new ChromeBinariesOperations()); |
| 42 break; | 37 break; |
| 43 default: | 38 default: |
| 44 NOTREACHED() << "Unsupported BrowserDistribution::Type: " | 39 NOTREACHED() << "Unsupported BrowserDistribution::Type: " |
| 45 << distribution->GetType(); | 40 << distribution->GetType(); |
| 46 } | 41 } |
| 47 } | 42 } |
| 48 | 43 |
| 49 Product::~Product() { | 44 Product::~Product() { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 } | 123 } |
| 129 | 124 |
| 130 bool Product::ShouldCreateUninstallEntry() const { | 125 bool Product::ShouldCreateUninstallEntry() const { |
| 131 return operations_->ShouldCreateUninstallEntry(options_); | 126 return operations_->ShouldCreateUninstallEntry(options_); |
| 132 } | 127 } |
| 133 | 128 |
| 134 void Product::AddKeyFiles(std::vector<base::FilePath>* key_files) const { | 129 void Product::AddKeyFiles(std::vector<base::FilePath>* key_files) const { |
| 135 operations_->AddKeyFiles(options_, key_files); | 130 operations_->AddKeyFiles(options_, key_files); |
| 136 } | 131 } |
| 137 | 132 |
| 138 void Product::AddComDllList(std::vector<base::FilePath>* com_dll_list) const { | |
| 139 operations_->AddComDllList(options_, com_dll_list); | |
| 140 } | |
| 141 | |
| 142 void Product::AppendProductFlags(base::CommandLine* command_line) const { | 133 void Product::AppendProductFlags(base::CommandLine* command_line) const { |
| 143 operations_->AppendProductFlags(options_, command_line); | 134 operations_->AppendProductFlags(options_, command_line); |
| 144 } | 135 } |
| 145 | 136 |
| 146 void Product::AppendRenameFlags(base::CommandLine* command_line) const { | 137 void Product::AppendRenameFlags(base::CommandLine* command_line) const { |
| 147 operations_->AppendRenameFlags(options_, command_line); | 138 operations_->AppendRenameFlags(options_, command_line); |
| 148 } | 139 } |
| 149 | 140 |
| 150 bool Product::SetChannelFlags(bool set, ChannelInfo* channel_info) const { | 141 bool Product::SetChannelFlags(bool set, ChannelInfo* channel_info) const { |
| 151 return operations_->SetChannelFlags(options_, set, channel_info); | 142 return operations_->SetChannelFlags(options_, set, channel_info); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 164 if (distribution_->HasUserExperiments()) { | 155 if (distribution_->HasUserExperiments()) { |
| 165 VLOG(1) << "LaunchUserExperiment status: " << status << " product: " | 156 VLOG(1) << "LaunchUserExperiment status: " << status << " product: " |
| 166 << distribution_->GetDisplayName() | 157 << distribution_->GetDisplayName() |
| 167 << " system_level: " << system_level; | 158 << " system_level: " << system_level; |
| 168 operations_->LaunchUserExperiment( | 159 operations_->LaunchUserExperiment( |
| 169 setup_path, options_, status, system_level); | 160 setup_path, options_, status, system_level); |
| 170 } | 161 } |
| 171 } | 162 } |
| 172 | 163 |
| 173 } // namespace installer | 164 } // namespace installer |
| OLD | NEW |