Joshua Pawlicki | 58a597ed | 2021-06-10 17:00:52 | [diff] [blame^] | 1 | // Copyright 2021 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "chrome/updater/external_constants_default.h" |
| 6 | |
| 7 | #include "chrome/updater/constants.h" |
| 8 | #include "chrome/updater/external_constants.h" |
| 9 | #include "chrome/updater/updater_branding.h" |
| 10 | #include "url/gurl.h" |
| 11 | |
| 12 | namespace updater { |
| 13 | namespace { |
| 14 | |
| 15 | class DefaultExternalConstants : public ExternalConstants { |
| 16 | public: |
| 17 | DefaultExternalConstants() : ExternalConstants(nullptr) {} |
| 18 | ~DefaultExternalConstants() override = default; |
| 19 | |
| 20 | // Overrides of ExternalConstants: |
| 21 | std::vector<GURL> UpdateURL() const override { |
| 22 | return std::vector<GURL>{GURL(UPDATE_CHECK_URL)}; |
| 23 | } |
| 24 | |
| 25 | bool UseCUP() const override { return true; } |
| 26 | |
| 27 | double InitialDelay() const override { return kInitialDelay; } |
| 28 | |
| 29 | int ServerKeepAliveSeconds() const override { |
| 30 | return kServerKeepAliveSeconds; |
| 31 | } |
| 32 | }; |
| 33 | |
| 34 | } // namespace |
| 35 | |
| 36 | std::unique_ptr<ExternalConstants> CreateDefaultExternalConstants() { |
| 37 | return std::make_unique<DefaultExternalConstants>(); |
| 38 | } |
| 39 | |
| 40 | } // namespace updater |