| 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/update_query_params.h" |
| 14 #include "ios/chrome/browser/application_context.h" | 15 #include "ios/chrome/browser/application_context.h" |
| 15 #include "ios/chrome/browser/google/google_brand.h" | 16 #include "ios/chrome/browser/google/google_brand.h" |
| 16 #include "ios/chrome/common/channel_info.h" | 17 #include "ios/chrome/common/channel_info.h" |
| 17 #include "ios/web/public/web_thread.h" | 18 #include "ios/web/public/web_thread.h" |
| 18 | 19 |
| 19 namespace component_updater { | 20 namespace component_updater { |
| 20 | 21 |
| 21 namespace { | 22 namespace { |
| 22 | 23 |
| 23 class IOSConfigurator : public update_client::Configurator { | 24 class IOSConfigurator : public update_client::Configurator { |
| 24 public: | 25 public: |
| 25 IOSConfigurator(const base::CommandLine* cmdline, | 26 IOSConfigurator(const base::CommandLine* cmdline, |
| 26 net::URLRequestContextGetter* url_request_getter); | 27 net::URLRequestContextGetter* url_request_getter); |
| 27 | 28 |
| 28 // update_client::Configurator overrides. | 29 // update_client::Configurator overrides. |
| 29 int InitialDelay() const override; | 30 int InitialDelay() const override; |
| 30 int NextCheckDelay() const override; | 31 int NextCheckDelay() const override; |
| 31 int StepDelay() const override; | 32 int StepDelay() const override; |
| 32 int OnDemandDelay() const override; | 33 int OnDemandDelay() const override; |
| 33 int UpdateDelay() const override; | 34 int UpdateDelay() const override; |
| 34 std::vector<GURL> UpdateUrl() const override; | 35 std::vector<GURL> UpdateUrl() const override; |
| 35 std::vector<GURL> PingUrl() const override; | 36 std::vector<GURL> PingUrl() const override; |
| 37 std::string GetProdId() const override; |
| 36 base::Version GetBrowserVersion() const override; | 38 base::Version GetBrowserVersion() const override; |
| 37 std::string GetChannel() const override; | 39 std::string GetChannel() const override; |
| 38 std::string GetBrand() const override; | 40 std::string GetBrand() const override; |
| 39 std::string GetLang() const override; | 41 std::string GetLang() const override; |
| 40 std::string GetOSLongName() const override; | 42 std::string GetOSLongName() const override; |
| 41 std::string ExtraRequestParams() const override; | 43 std::string ExtraRequestParams() const override; |
| 42 std::string GetDownloadPreference() const override; | 44 std::string GetDownloadPreference() const override; |
| 43 net::URLRequestContextGetter* RequestContext() const override; | 45 net::URLRequestContextGetter* RequestContext() const override; |
| 44 scoped_refptr<update_client::OutOfProcessPatcher> CreateOutOfProcessPatcher() | 46 scoped_refptr<update_client::OutOfProcessPatcher> CreateOutOfProcessPatcher() |
| 45 const override; | 47 const override; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 } | 90 } |
| 89 | 91 |
| 90 std::vector<GURL> IOSConfigurator::UpdateUrl() const { | 92 std::vector<GURL> IOSConfigurator::UpdateUrl() const { |
| 91 return configurator_impl_.UpdateUrl(); | 93 return configurator_impl_.UpdateUrl(); |
| 92 } | 94 } |
| 93 | 95 |
| 94 std::vector<GURL> IOSConfigurator::PingUrl() const { | 96 std::vector<GURL> IOSConfigurator::PingUrl() const { |
| 95 return configurator_impl_.PingUrl(); | 97 return configurator_impl_.PingUrl(); |
| 96 } | 98 } |
| 97 | 99 |
| 100 std::string IOSConfigurator::GetProdId() const { |
| 101 return update_client::UpdateQueryParams::GetProdIdString( |
| 102 update_client::UpdateQueryParams::ProdId::CHROME); |
| 103 } |
| 104 |
| 98 base::Version IOSConfigurator::GetBrowserVersion() const { | 105 base::Version IOSConfigurator::GetBrowserVersion() const { |
| 99 return configurator_impl_.GetBrowserVersion(); | 106 return configurator_impl_.GetBrowserVersion(); |
| 100 } | 107 } |
| 101 | 108 |
| 102 std::string IOSConfigurator::GetChannel() const { | 109 std::string IOSConfigurator::GetChannel() const { |
| 103 return GetChannelString(); | 110 return GetChannelString(); |
| 104 } | 111 } |
| 105 | 112 |
| 106 std::string IOSConfigurator::GetBrand() const { | 113 std::string IOSConfigurator::GetBrand() const { |
| 107 std::string brand; | 114 std::string brand; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 171 |
| 165 } // namespace | 172 } // namespace |
| 166 | 173 |
| 167 scoped_refptr<update_client::Configurator> MakeIOSComponentUpdaterConfigurator( | 174 scoped_refptr<update_client::Configurator> MakeIOSComponentUpdaterConfigurator( |
| 168 const base::CommandLine* cmdline, | 175 const base::CommandLine* cmdline, |
| 169 net::URLRequestContextGetter* context_getter) { | 176 net::URLRequestContextGetter* context_getter) { |
| 170 return new IOSConfigurator(cmdline, context_getter); | 177 return new IOSConfigurator(cmdline, context_getter); |
| 171 } | 178 } |
| 172 | 179 |
| 173 } // namespace component_updater | 180 } // namespace component_updater |
| OLD | NEW |