| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/browser/component_updater/origin_trials_component_installer.h" | 5 #include "chrome/browser/component_updater/origin_trials_component_installer.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 9 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 10 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 11 #include "base/values.h" | 13 #include "base/values.h" |
| 12 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
| 14 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 15 #include "components/component_updater/component_updater_paths.h" | 17 #include "components/component_updater/component_updater_paths.h" |
| 16 #include "components/prefs/pref_service.h" | 18 #include "components/prefs/pref_service.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 102 |
| 101 std::string OriginTrialsComponentInstallerTraits::GetName() const { | 103 std::string OriginTrialsComponentInstallerTraits::GetName() const { |
| 102 return "Origin Trials"; | 104 return "Origin Trials"; |
| 103 } | 105 } |
| 104 | 106 |
| 105 update_client::InstallerAttributes | 107 update_client::InstallerAttributes |
| 106 OriginTrialsComponentInstallerTraits::GetInstallerAttributes() const { | 108 OriginTrialsComponentInstallerTraits::GetInstallerAttributes() const { |
| 107 return update_client::InstallerAttributes(); | 109 return update_client::InstallerAttributes(); |
| 108 } | 110 } |
| 109 | 111 |
| 112 std::vector<std::string> OriginTrialsComponentInstallerTraits::GetMimeTypes() |
| 113 const { |
| 114 return std::vector<std::string>(); |
| 115 } |
| 116 |
| 110 void RegisterOriginTrialsComponent(ComponentUpdateService* cus, | 117 void RegisterOriginTrialsComponent(ComponentUpdateService* cus, |
| 111 const base::FilePath& user_data_dir) { | 118 const base::FilePath& user_data_dir) { |
| 112 std::unique_ptr<ComponentInstallerTraits> traits( | 119 std::unique_ptr<ComponentInstallerTraits> traits( |
| 113 new OriginTrialsComponentInstallerTraits()); | 120 new OriginTrialsComponentInstallerTraits()); |
| 114 // |cus| will take ownership of |installer| during installer->Register(cus). | 121 // |cus| will take ownership of |installer| during installer->Register(cus). |
| 115 DefaultComponentInstaller* installer = | 122 DefaultComponentInstaller* installer = |
| 116 new DefaultComponentInstaller(std::move(traits)); | 123 new DefaultComponentInstaller(std::move(traits)); |
| 117 installer->Register(cus, base::Closure()); | 124 installer->Register(cus, base::Closure()); |
| 118 } | 125 } |
| 119 | 126 |
| 120 } // namespace component_updater | 127 } // namespace component_updater |
| OLD | NEW |