| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/component_updater/ios_component_updater_configurato
r.h" | 5 #include "ios/chrome/browser/component_updater/ios_component_updater_configurato
r.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
| 11 #include "base/version.h" | 11 #include "base/version.h" |
| 12 #include "components/component_updater/configurator_impl.h" | 12 #include "components/component_updater/configurator_impl.h" |
| 13 #include "components/update_client/component_patcher_operation.h" | 13 #include "components/update_client/component_patcher_operation.h" |
| 14 #include "components/update_client/persisted_data.h" |
| 14 #include "components/update_client/update_query_params.h" | 15 #include "components/update_client/update_query_params.h" |
| 15 #include "ios/chrome/browser/application_context.h" | 16 #include "ios/chrome/browser/application_context.h" |
| 16 #include "ios/chrome/browser/google/google_brand.h" | 17 #include "ios/chrome/browser/google/google_brand.h" |
| 17 #include "ios/chrome/common/channel_info.h" | 18 #include "ios/chrome/common/channel_info.h" |
| 18 #include "ios/web/public/web_thread.h" | 19 #include "ios/web/public/web_thread.h" |
| 19 | 20 |
| 20 namespace component_updater { | 21 namespace component_updater { |
| 21 | 22 |
| 22 namespace { | 23 namespace { |
| 23 | 24 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 45 scoped_refptr<update_client::OutOfProcessPatcher> CreateOutOfProcessPatcher() | 46 scoped_refptr<update_client::OutOfProcessPatcher> CreateOutOfProcessPatcher() |
| 46 const override; | 47 const override; |
| 47 bool EnabledDeltas() const override; | 48 bool EnabledDeltas() const override; |
| 48 bool EnabledComponentUpdates() const override; | 49 bool EnabledComponentUpdates() const override; |
| 49 bool EnabledBackgroundDownloader() const override; | 50 bool EnabledBackgroundDownloader() const override; |
| 50 bool EnabledCupSigning() const override; | 51 bool EnabledCupSigning() const override; |
| 51 scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner() | 52 scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner() |
| 52 const override; | 53 const override; |
| 53 PrefService* GetPrefService() const override; | 54 PrefService* GetPrefService() const override; |
| 54 bool IsPerUserInstall() const override; | 55 bool IsPerUserInstall() const override; |
| 56 update_client::PersistedData* CreateMetadata() const override; |
| 55 | 57 |
| 56 private: | 58 private: |
| 57 friend class base::RefCountedThreadSafe<IOSConfigurator>; | 59 friend class base::RefCountedThreadSafe<IOSConfigurator>; |
| 58 | 60 |
| 59 ConfiguratorImpl configurator_impl_; | 61 ConfiguratorImpl configurator_impl_; |
| 60 | 62 |
| 61 ~IOSConfigurator() override {} | 63 ~IOSConfigurator() override {} |
| 62 }; | 64 }; |
| 63 | 65 |
| 64 // Allows the component updater to use non-encrypted communication with the | 66 // Allows the component updater to use non-encrypted communication with the |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 164 } |
| 163 | 165 |
| 164 PrefService* IOSConfigurator::GetPrefService() const { | 166 PrefService* IOSConfigurator::GetPrefService() const { |
| 165 return GetApplicationContext()->GetLocalState(); | 167 return GetApplicationContext()->GetLocalState(); |
| 166 } | 168 } |
| 167 | 169 |
| 168 bool IOSConfigurator::IsPerUserInstall() const { | 170 bool IOSConfigurator::IsPerUserInstall() const { |
| 169 return true; | 171 return true; |
| 170 } | 172 } |
| 171 | 173 |
| 174 update_client::PersistedData* IOSConfigurator::CreateMetadata() const { |
| 175 return new update_client::PersistedData(GetPrefService()); |
| 176 } |
| 177 |
| 172 } // namespace | 178 } // namespace |
| 173 | 179 |
| 174 scoped_refptr<update_client::Configurator> MakeIOSComponentUpdaterConfigurator( | 180 scoped_refptr<update_client::Configurator> MakeIOSComponentUpdaterConfigurator( |
| 175 const base::CommandLine* cmdline, | 181 const base::CommandLine* cmdline, |
| 176 net::URLRequestContextGetter* context_getter) { | 182 net::URLRequestContextGetter* context_getter) { |
| 177 return new IOSConfigurator(cmdline, context_getter); | 183 return new IOSConfigurator(cmdline, context_getter); |
| 178 } | 184 } |
| 179 | 185 |
| 180 } // namespace component_updater | 186 } // namespace component_updater |
| OLD | NEW |