| 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" |
| 14 #include "chrome/installer/util/chrome_binaries_operations.h" |
| 13 #include "chrome/installer/util/chrome_browser_operations.h" | 15 #include "chrome/installer/util/chrome_browser_operations.h" |
| 14 #include "chrome/installer/util/chrome_browser_sxs_operations.h" | 16 #include "chrome/installer/util/chrome_browser_sxs_operations.h" |
| 15 #include "chrome/installer/util/chrome_frame_operations.h" | 17 #include "chrome/installer/util/chrome_frame_operations.h" |
| 16 #include "chrome/installer/util/google_update_constants.h" | 18 #include "chrome/installer/util/google_update_constants.h" |
| 17 #include "chrome/installer/util/helper.h" | 19 #include "chrome/installer/util/helper.h" |
| 18 #include "chrome/installer/util/install_util.h" | 20 #include "chrome/installer/util/install_util.h" |
| 19 #include "chrome/installer/util/master_preferences.h" | 21 #include "chrome/installer/util/master_preferences.h" |
| 20 #include "chrome/installer/util/master_preferences_constants.h" | 22 #include "chrome/installer/util/master_preferences_constants.h" |
| 21 #include "chrome/installer/util/product_operations.h" | 23 #include "chrome/installer/util/product_operations.h" |
| 22 | 24 |
| 23 using base::win::RegKey; | 25 using base::win::RegKey; |
| 24 using installer::MasterPreferences; | 26 using installer::MasterPreferences; |
| 25 | 27 |
| 26 namespace installer { | 28 namespace installer { |
| 27 | 29 |
| 28 Product::Product(BrowserDistribution* distribution) | 30 Product::Product(BrowserDistribution* distribution) |
| 29 : distribution_(distribution) { | 31 : distribution_(distribution) { |
| 30 switch (distribution->GetType()) { | 32 switch (distribution->GetType()) { |
| 31 case BrowserDistribution::CHROME_BROWSER: | 33 case BrowserDistribution::CHROME_BROWSER: |
| 32 operations_.reset(InstallUtil::IsChromeSxSProcess() ? | 34 operations_.reset(InstallUtil::IsChromeSxSProcess() ? |
| 33 new ChromeBrowserSxSOperations() : | 35 new ChromeBrowserSxSOperations() : |
| 34 new ChromeBrowserOperations()); | 36 new ChromeBrowserOperations()); |
| 35 break; | 37 break; |
| 36 case BrowserDistribution::CHROME_FRAME: | 38 case BrowserDistribution::CHROME_FRAME: |
| 37 operations_.reset(new ChromeFrameOperations()); | 39 operations_.reset(new ChromeFrameOperations()); |
| 38 break; | 40 break; |
| 41 case BrowserDistribution::CHROME_APP_HOST: |
| 42 operations_.reset(new ChromeAppHostOperations()); |
| 43 break; |
| 44 case BrowserDistribution::CHROME_BINARIES: |
| 45 operations_.reset(new ChromeBinariesOperations()); |
| 46 break; |
| 39 default: | 47 default: |
| 40 NOTREACHED() << "Unsupported BrowserDistribution::Type: " | 48 NOTREACHED() << "Unsupported BrowserDistribution::Type: " |
| 41 << distribution->GetType(); | 49 << distribution->GetType(); |
| 42 } | 50 } |
| 43 } | 51 } |
| 44 | 52 |
| 45 Product::~Product() { | 53 Product::~Product() { |
| 46 } | 54 } |
| 47 | 55 |
| 48 void Product::InitializeFromPreferences(const MasterPreferences& prefs) { | 56 void Product::InitializeFromPreferences(const MasterPreferences& prefs) { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 150 |
| 143 void Product::AppendRenameFlags(CommandLine* command_line) const { | 151 void Product::AppendRenameFlags(CommandLine* command_line) const { |
| 144 operations_->AppendRenameFlags(options_, command_line); | 152 operations_->AppendRenameFlags(options_, command_line); |
| 145 } | 153 } |
| 146 | 154 |
| 147 bool Product::SetChannelFlags(bool set, ChannelInfo* channel_info) const { | 155 bool Product::SetChannelFlags(bool set, ChannelInfo* channel_info) const { |
| 148 return operations_->SetChannelFlags(options_, set, channel_info); | 156 return operations_->SetChannelFlags(options_, set, channel_info); |
| 149 } | 157 } |
| 150 | 158 |
| 151 } // namespace installer | 159 } // namespace installer |
| OLD | NEW |