| 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> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 } // namespace | 48 } // namespace |
| 49 | 49 |
| 50 bool OriginTrialsComponentInstallerTraits::VerifyInstallation( | 50 bool OriginTrialsComponentInstallerTraits::VerifyInstallation( |
| 51 const base::DictionaryValue& manifest, | 51 const base::DictionaryValue& manifest, |
| 52 const base::FilePath& install_dir) const { | 52 const base::FilePath& install_dir) const { |
| 53 // Test if the "origin-trials" key is present in the manifest. | 53 // Test if the "origin-trials" key is present in the manifest. |
| 54 return manifest.HasKey("origin-trials"); | 54 return manifest.HasKey("origin-trials"); |
| 55 } | 55 } |
| 56 | 56 |
| 57 bool OriginTrialsComponentInstallerTraits::CanAutoUpdate() const { | 57 bool OriginTrialsComponentInstallerTraits:: |
| 58 return true; | 58 SupportsGroupPolicyEnabledComponentUpdates() const { |
| 59 return false; |
| 59 } | 60 } |
| 60 | 61 |
| 61 bool OriginTrialsComponentInstallerTraits::RequiresNetworkEncryption() const { | 62 bool OriginTrialsComponentInstallerTraits::RequiresNetworkEncryption() const { |
| 62 return true; | 63 return true; |
| 63 } | 64 } |
| 64 | 65 |
| 65 bool OriginTrialsComponentInstallerTraits::OnCustomInstall( | 66 bool OriginTrialsComponentInstallerTraits::OnCustomInstall( |
| 66 const base::DictionaryValue& manifest, | 67 const base::DictionaryValue& manifest, |
| 67 const base::FilePath& install_dir) { | 68 const base::FilePath& install_dir) { |
| 68 return true; | 69 return true; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 const base::FilePath& user_data_dir) { | 119 const base::FilePath& user_data_dir) { |
| 119 std::unique_ptr<ComponentInstallerTraits> traits( | 120 std::unique_ptr<ComponentInstallerTraits> traits( |
| 120 new OriginTrialsComponentInstallerTraits()); | 121 new OriginTrialsComponentInstallerTraits()); |
| 121 // |cus| will take ownership of |installer| during installer->Register(cus). | 122 // |cus| will take ownership of |installer| during installer->Register(cus). |
| 122 DefaultComponentInstaller* installer = | 123 DefaultComponentInstaller* installer = |
| 123 new DefaultComponentInstaller(std::move(traits)); | 124 new DefaultComponentInstaller(std::move(traits)); |
| 124 installer->Register(cus, base::Closure()); | 125 installer->Register(cus, base::Closure()); |
| 125 } | 126 } |
| 126 | 127 |
| 127 } // namespace component_updater | 128 } // namespace component_updater |
| OLD | NEW |