| 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 // This file defines a class that contains various method related to branding. | 5 // This file defines a class that contains various method related to branding. |
| 6 // It provides only default implementations of these methods. Usually to add | 6 // It provides only default implementations of these methods. Usually to add |
| 7 // specific branding, we will need to extend this class with a custom | 7 // specific branding, we will need to extend this class with a custom |
| 8 // implementation. | 8 // implementation. |
| 9 | 9 |
| 10 #include "chrome/installer/util/browser_distribution.h" | 10 #include "chrome/installer/util/browser_distribution.h" |
| 11 | 11 |
| 12 #include "base/atomicops.h" | 12 #include "base/atomicops.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/win/registry.h" | 16 #include "base/win/registry.h" |
| 17 #include "base/win/windows_version.h" | 17 #include "base/win/windows_version.h" |
| 18 #include "chrome/common/chrome_icon_resources_win.h" | 18 #include "chrome/common/chrome_icon_resources_win.h" |
| 19 #include "chrome/common/env_vars.h" | 19 #include "chrome/common/env_vars.h" |
| 20 #include "chrome/installer/util/app_registration_data.h" | 20 #include "chrome/installer/util/app_registration_data.h" |
| 21 #include "chrome/installer/util/chrome_app_host_distribution.h" | |
| 22 #include "chrome/installer/util/chrome_frame_distribution.h" | 21 #include "chrome/installer/util/chrome_frame_distribution.h" |
| 23 #include "chrome/installer/util/chromium_binaries_distribution.h" | 22 #include "chrome/installer/util/chromium_binaries_distribution.h" |
| 24 #include "chrome/installer/util/google_chrome_binaries_distribution.h" | 23 #include "chrome/installer/util/google_chrome_binaries_distribution.h" |
| 25 #include "chrome/installer/util/google_chrome_distribution.h" | 24 #include "chrome/installer/util/google_chrome_distribution.h" |
| 26 #include "chrome/installer/util/google_chrome_sxs_distribution.h" | 25 #include "chrome/installer/util/google_chrome_sxs_distribution.h" |
| 27 #include "chrome/installer/util/install_util.h" | 26 #include "chrome/installer/util/install_util.h" |
| 28 #include "chrome/installer/util/l10n_string_util.h" | 27 #include "chrome/installer/util/l10n_string_util.h" |
| 29 #include "chrome/installer/util/master_preferences.h" | 28 #include "chrome/installer/util/master_preferences.h" |
| 30 #include "chrome/installer/util/non_updating_app_registration_data.h" | 29 #include "chrome/installer/util/non_updating_app_registration_data.h" |
| 31 | 30 |
| 32 #include "installer_util_strings.h" // NOLINT | 31 #include "installer_util_strings.h" // NOLINT |
| 33 | 32 |
| 34 using installer::MasterPreferences; | 33 using installer::MasterPreferences; |
| 35 | 34 |
| 36 namespace { | 35 namespace { |
| 37 | 36 |
| 38 const wchar_t kChromiumActiveSetupGuid[] = | 37 const wchar_t kChromiumActiveSetupGuid[] = |
| 39 L"{7D2B3E1D-D096-4594-9D8F-A6667F12E0AC}"; | 38 L"{7D2B3E1D-D096-4594-9D8F-A6667F12E0AC}"; |
| 40 | 39 |
| 41 const wchar_t kCommandExecuteImplUuid[] = | 40 const wchar_t kCommandExecuteImplUuid[] = |
| 42 L"{A2DF06F9-A21A-44A8-8A99-8B9C84F29160}"; | 41 L"{A2DF06F9-A21A-44A8-8A99-8B9C84F29160}"; |
| 43 | 42 |
| 44 // The BrowserDistribution objects are never freed. | 43 // The BrowserDistribution objects are never freed. |
| 45 BrowserDistribution* g_browser_distribution = NULL; | 44 BrowserDistribution* g_browser_distribution = NULL; |
| 46 BrowserDistribution* g_chrome_frame_distribution = NULL; | 45 BrowserDistribution* g_chrome_frame_distribution = NULL; |
| 47 BrowserDistribution* g_binaries_distribution = NULL; | 46 BrowserDistribution* g_binaries_distribution = NULL; |
| 48 BrowserDistribution* g_chrome_app_host_distribution = NULL; | |
| 49 | 47 |
| 50 BrowserDistribution::Type GetCurrentDistributionType() { | 48 BrowserDistribution::Type GetCurrentDistributionType() { |
| 51 // TODO(erikwright): If the app host is installed, but not Chrome, perhaps | |
| 52 // this should return CHROME_APP_HOST. | |
| 53 return BrowserDistribution::CHROME_BROWSER; | 49 return BrowserDistribution::CHROME_BROWSER; |
| 54 } | 50 } |
| 55 | 51 |
| 56 } // end namespace | 52 } // end namespace |
| 57 | 53 |
| 58 BrowserDistribution::BrowserDistribution() | 54 BrowserDistribution::BrowserDistribution() |
| 59 : type_(CHROME_BROWSER), | 55 : type_(CHROME_BROWSER), |
| 60 app_reg_data_(make_scoped_ptr( | 56 app_reg_data_(make_scoped_ptr( |
| 61 new NonUpdatingAppRegistrationData(L"Software\\Chromium"))) { | 57 new NonUpdatingAppRegistrationData(L"Software\\Chromium"))) { |
| 62 } | 58 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 dist = GetOrCreateBrowserDistribution<BrowserDistribution>( | 101 dist = GetOrCreateBrowserDistribution<BrowserDistribution>( |
| 106 &g_browser_distribution); | 102 &g_browser_distribution); |
| 107 #endif | 103 #endif |
| 108 break; | 104 break; |
| 109 | 105 |
| 110 case CHROME_FRAME: | 106 case CHROME_FRAME: |
| 111 dist = GetOrCreateBrowserDistribution<ChromeFrameDistribution>( | 107 dist = GetOrCreateBrowserDistribution<ChromeFrameDistribution>( |
| 112 &g_chrome_frame_distribution); | 108 &g_chrome_frame_distribution); |
| 113 break; | 109 break; |
| 114 | 110 |
| 115 case CHROME_APP_HOST: | |
| 116 dist = GetOrCreateBrowserDistribution<ChromeAppHostDistribution>( | |
| 117 &g_chrome_app_host_distribution); | |
| 118 break; | |
| 119 | |
| 120 default: | 111 default: |
| 121 DCHECK_EQ(CHROME_BINARIES, type); | 112 DCHECK_EQ(CHROME_BINARIES, type); |
| 122 #if defined(GOOGLE_CHROME_BUILD) | 113 #if defined(GOOGLE_CHROME_BUILD) |
| 123 dist = GetOrCreateBrowserDistribution<GoogleChromeBinariesDistribution>( | 114 dist = GetOrCreateBrowserDistribution<GoogleChromeBinariesDistribution>( |
| 124 &g_binaries_distribution); | 115 &g_binaries_distribution); |
| 125 #else | 116 #else |
| 126 dist = GetOrCreateBrowserDistribution<ChromiumBinariesDistribution>( | 117 dist = GetOrCreateBrowserDistribution<ChromiumBinariesDistribution>( |
| 127 &g_binaries_distribution); | 118 &g_binaries_distribution); |
| 128 #endif | 119 #endif |
| 129 } | 120 } |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 return false; | 266 return false; |
| 276 } | 267 } |
| 277 | 268 |
| 278 bool BrowserDistribution::GetCommandExecuteImplClsid( | 269 bool BrowserDistribution::GetCommandExecuteImplClsid( |
| 279 base::string16* handler_class_uuid) { | 270 base::string16* handler_class_uuid) { |
| 280 if (handler_class_uuid) | 271 if (handler_class_uuid) |
| 281 *handler_class_uuid = kCommandExecuteImplUuid; | 272 *handler_class_uuid = kCommandExecuteImplUuid; |
| 282 return true; | 273 return true; |
| 283 } | 274 } |
| 284 | 275 |
| 285 bool BrowserDistribution::AppHostIsSupported() { | |
| 286 return false; | |
| 287 } | |
| 288 | |
| 289 void BrowserDistribution::UpdateInstallStatus(bool system_install, | 276 void BrowserDistribution::UpdateInstallStatus(bool system_install, |
| 290 installer::ArchiveType archive_type, | 277 installer::ArchiveType archive_type, |
| 291 installer::InstallStatus install_status) { | 278 installer::InstallStatus install_status) { |
| 292 } | 279 } |
| 293 | 280 |
| 294 bool BrowserDistribution::ShouldSetExperimentLabels() { | 281 bool BrowserDistribution::ShouldSetExperimentLabels() { |
| 295 return false; | 282 return false; |
| 296 } | 283 } |
| 297 | 284 |
| 298 bool BrowserDistribution::HasUserExperiments() { | 285 bool BrowserDistribution::HasUserExperiments() { |
| 299 return false; | 286 return false; |
| 300 } | 287 } |
| OLD | NEW |