| 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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 namespace component_updater { | 38 namespace component_updater { |
| 39 | 39 |
| 40 namespace { | 40 namespace { |
| 41 | 41 |
| 42 static const char kManifestOriginTrialsKey[] = "origin-trials"; | 42 static const char kManifestOriginTrialsKey[] = "origin-trials"; |
| 43 static const char kManifestPublicKeyPath[] = "origin-trials.public-key"; | 43 static const char kManifestPublicKeyPath[] = "origin-trials.public-key"; |
| 44 static const char kManifestDisabledFeaturesPath[] = | 44 static const char kManifestDisabledFeaturesPath[] = |
| 45 "origin-trials.disabled-features"; | 45 "origin-trials.disabled-features"; |
| 46 | 46 |
| 47 // Extension id is kfoklmclfodeliojeaekpoflbkkhojea | 47 // Extension id is llkgjffcdpffmhiakmfcdcblohccpfmo |
| 48 const uint8_t kSha256Hash[] = {0xa5, 0xea, 0xbc, 0x2b, 0x5e, 0x34, 0xb8, 0xe9, | 48 const uint8_t kSha256Hash[] = {0xbb, 0xa6, 0x95, 0x52, 0x3f, 0x55, 0xc7, 0x80, |
| 49 0x40, 0x4a, 0xfe, 0x5b, 0x1a, 0xa7, 0xe9, 0x40, | 49 0xac, 0x52, 0x32, 0x1b, 0xe7, 0x22, 0xf5, 0xce, |
| 50 0xa8, 0xc5, 0xef, 0xa1, 0x9e, 0x20, 0x5a, 0x39, | 50 0x6a, 0xfd, 0x9c, 0x9e, 0xa9, 0x2a, 0x0b, 0x50, |
| 51 0x73, 0x98, 0x98, 0x0f, 0x7a, 0x76, 0x62, 0xfa}; | 51 0x60, 0x2b, 0x7f, 0x6c, 0x64, 0x80, 0x09, 0x04}; |
| 52 | 52 |
| 53 } // namespace | 53 } // namespace |
| 54 | 54 |
| 55 bool OriginTrialsComponentInstallerTraits::VerifyInstallation( | 55 bool OriginTrialsComponentInstallerTraits::VerifyInstallation( |
| 56 const base::DictionaryValue& manifest, | 56 const base::DictionaryValue& manifest, |
| 57 const base::FilePath& install_dir) const { | 57 const base::FilePath& install_dir) const { |
| 58 // Test if the "origin-trials" key is present in the manifest. | 58 // Test if the "origin-trials" key is present in the manifest. |
| 59 return manifest.HasKey(kManifestOriginTrialsKey); | 59 return manifest.HasKey(kManifestOriginTrialsKey); |
| 60 } | 60 } |
| 61 | 61 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 const base::FilePath& user_data_dir) { | 133 const base::FilePath& user_data_dir) { |
| 134 std::unique_ptr<ComponentInstallerTraits> traits( | 134 std::unique_ptr<ComponentInstallerTraits> traits( |
| 135 new OriginTrialsComponentInstallerTraits()); | 135 new OriginTrialsComponentInstallerTraits()); |
| 136 // |cus| will take ownership of |installer| during installer->Register(cus). | 136 // |cus| will take ownership of |installer| during installer->Register(cus). |
| 137 DefaultComponentInstaller* installer = | 137 DefaultComponentInstaller* installer = |
| 138 new DefaultComponentInstaller(std::move(traits)); | 138 new DefaultComponentInstaller(std::move(traits)); |
| 139 installer->Register(cus, base::Closure()); | 139 installer->Register(cus, base::Closure()); |
| 140 } | 140 } |
| 141 | 141 |
| 142 } // namespace component_updater | 142 } // namespace component_updater |
| OLD | NEW |