blob: 753c40224cfca53850466e4523f70afd3d6f1d9b [file] [log] [blame]
Avi Drissman4a8573c2022-09-09 19:35:541// Copyright 2012 The Chromium Authors
[email protected]ea4d1c8742012-06-13 03:51:552// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Joshua Pawlicki1bab78d2024-02-13 15:06:565#include "chrome/browser/ui/webui/help/version_updater.h"
[email protected]ea4d1c8742012-06-13 03:51:556
Joshua Pawlicki1bab78d2024-02-13 15:06:567#include <memory>
Jan Wilken Dörriead587c32021-03-11 14:09:278#include <string>
9
Greg Thompson8bcd799b2018-08-10 09:49:3310#include "chrome/browser/upgrade_detector/upgrade_detector.h"
[email protected]ea4d1c8742012-06-13 03:51:5511
Joshua Pawlicki1bab78d2024-02-13 15:06:5612namespace {
[email protected]ea4d1c8742012-06-13 03:51:5513
Joshua Pawlicki1bab78d2024-02-13 15:06:5614// Bare bones implementation just checks if a new version is ready.
15class VersionUpdaterBasic : public VersionUpdater {
16 public:
17 VersionUpdaterBasic(const VersionUpdaterBasic&) = delete;
18 VersionUpdaterBasic& operator=(const VersionUpdaterBasic&) = delete;
19 VersionUpdaterBasic() = default;
20 ~VersionUpdaterBasic() override = default;
21
22 // VersionUpdater implementation.
23 void CheckForUpdate(StatusCallback callback, PromoteCallback) override {
24 const Status status = UpgradeDetector::GetInstance()->is_upgrade_available()
25 ? NEARLY_UPDATED
26 : DISABLED;
27 callback.Run(status, 0, false, false, std::string(), 0, std::u16string());
28 }
29};
30
31} // namespace
32
33std::unique_ptr<VersionUpdater> VersionUpdater::Create(
34 content::WebContents* web_contents) {
35 return std::make_unique<VersionUpdaterBasic>();
[email protected]ea4d1c8742012-06-13 03:51:5536}