| 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 <utility> | 12 #include <utility> |
| 13 | 13 |
| 14 #include "base/atomicops.h" | 14 #include "base/atomicops.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
| 17 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/memory/ptr_util.h" |
| 18 #include "base/win/registry.h" | 19 #include "base/win/registry.h" |
| 19 #include "base/win/windows_version.h" | 20 #include "base/win/windows_version.h" |
| 20 #include "chrome/common/chrome_icon_resources_win.h" | 21 #include "chrome/common/chrome_icon_resources_win.h" |
| 21 #include "chrome/common/env_vars.h" | 22 #include "chrome/common/env_vars.h" |
| 22 #include "chrome/installer/util/app_registration_data.h" | 23 #include "chrome/installer/util/app_registration_data.h" |
| 23 #include "chrome/installer/util/chrome_frame_distribution.h" | 24 #include "chrome/installer/util/chrome_frame_distribution.h" |
| 24 #include "chrome/installer/util/chromium_binaries_distribution.h" | 25 #include "chrome/installer/util/chromium_binaries_distribution.h" |
| 25 #include "chrome/installer/util/google_chrome_binaries_distribution.h" | 26 #include "chrome/installer/util/google_chrome_binaries_distribution.h" |
| 26 #include "chrome/installer/util/google_chrome_distribution.h" | 27 #include "chrome/installer/util/google_chrome_distribution.h" |
| 27 #include "chrome/installer/util/google_chrome_sxs_distribution.h" | 28 #include "chrome/installer/util/google_chrome_sxs_distribution.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 47 BrowserDistribution* g_binaries_distribution = NULL; | 48 BrowserDistribution* g_binaries_distribution = NULL; |
| 48 | 49 |
| 49 BrowserDistribution::Type GetCurrentDistributionType() { | 50 BrowserDistribution::Type GetCurrentDistributionType() { |
| 50 return BrowserDistribution::CHROME_BROWSER; | 51 return BrowserDistribution::CHROME_BROWSER; |
| 51 } | 52 } |
| 52 | 53 |
| 53 } // namespace | 54 } // namespace |
| 54 | 55 |
| 55 BrowserDistribution::BrowserDistribution() | 56 BrowserDistribution::BrowserDistribution() |
| 56 : type_(CHROME_BROWSER), | 57 : type_(CHROME_BROWSER), |
| 57 app_reg_data_(make_scoped_ptr( | 58 app_reg_data_(base::WrapUnique( |
| 58 new NonUpdatingAppRegistrationData(L"Software\\Chromium"))) { | 59 new NonUpdatingAppRegistrationData(L"Software\\Chromium"))) {} |
| 59 } | |
| 60 | 60 |
| 61 BrowserDistribution::BrowserDistribution( | 61 BrowserDistribution::BrowserDistribution( |
| 62 Type type, | 62 Type type, |
| 63 scoped_ptr<AppRegistrationData> app_reg_data) | 63 std::unique_ptr<AppRegistrationData> app_reg_data) |
| 64 : type_(type), app_reg_data_(std::move(app_reg_data)) {} | 64 : type_(type), app_reg_data_(std::move(app_reg_data)) {} |
| 65 | 65 |
| 66 BrowserDistribution::~BrowserDistribution() {} | 66 BrowserDistribution::~BrowserDistribution() {} |
| 67 | 67 |
| 68 template<class DistributionClass> | 68 template<class DistributionClass> |
| 69 BrowserDistribution* BrowserDistribution::GetOrCreateBrowserDistribution( | 69 BrowserDistribution* BrowserDistribution::GetOrCreateBrowserDistribution( |
| 70 BrowserDistribution** dist) { | 70 BrowserDistribution** dist) { |
| 71 if (!*dist) { | 71 if (!*dist) { |
| 72 DistributionClass* temp = new DistributionClass(); | 72 DistributionClass* temp = new DistributionClass(); |
| 73 if (base::subtle::NoBarrier_CompareAndSwap( | 73 if (base::subtle::NoBarrier_CompareAndSwap( |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 installer::InstallStatus install_status) { | 265 installer::InstallStatus install_status) { |
| 266 } | 266 } |
| 267 | 267 |
| 268 bool BrowserDistribution::ShouldSetExperimentLabels() { | 268 bool BrowserDistribution::ShouldSetExperimentLabels() { |
| 269 return false; | 269 return false; |
| 270 } | 270 } |
| 271 | 271 |
| 272 bool BrowserDistribution::HasUserExperiments() { | 272 bool BrowserDistribution::HasUserExperiments() { |
| 273 return false; | 273 return false; |
| 274 } | 274 } |
| OLD | NEW |