blob: ebcef5637b150bae26ed47e46fafd6b8fa39f128 [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 <memory>
Jan Wilken Dörriead587c32021-03-11 14:09:276#include <string>
7
Peter Kastinga4863242024-12-23 00:19:438#include "chrome/browser/ui/webui/help/version_updater.h"
Greg Thompson8bcd799b2018-08-10 09:49:339#include "chrome/browser/upgrade_detector/upgrade_detector.h"
[email protected]ea4d1c8742012-06-13 03:51:5510
Joshua Pawlicki1bab78d2024-02-13 15:06:5611namespace {
[email protected]ea4d1c8742012-06-13 03:51:5512
Joshua Pawlicki1bab78d2024-02-13 15:06:5613// Bare bones implementation just checks if a new version is ready.
14class VersionUpdaterBasic : public VersionUpdater {
15 public:
16 VersionUpdaterBasic(const VersionUpdaterBasic&) = delete;
17 VersionUpdaterBasic& operator=(const VersionUpdaterBasic&) = delete;
18 VersionUpdaterBasic() = default;
19 ~VersionUpdaterBasic() override = default;
20
21 // VersionUpdater implementation.
22 void CheckForUpdate(StatusCallback callback, PromoteCallback) override {
23 const Status status = UpgradeDetector::GetInstance()->is_upgrade_available()
24 ? NEARLY_UPDATED
25 : DISABLED;
26 callback.Run(status, 0, false, false, std::string(), 0, std::u16string());
27 }
28};
29
30} // namespace
31
32std::unique_ptr<VersionUpdater> VersionUpdater::Create(
33 content::WebContents* web_contents) {
34 return std::make_unique<VersionUpdaterBasic>();
[email protected]ea4d1c8742012-06-13 03:51:5535}