| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/callback.h" |
| 10 |
| 11 // Interface implemented to expose per-platform updating functionality. |
| 12 class VersionUpdater { |
| 13 public: |
| 14 // Update process state machine. |
| 15 enum Status { |
| 16 CHECKING, |
| 17 UPDATING, |
| 18 NEARLY_UPDATED, |
| 19 UPDATED |
| 20 }; |
| 21 |
| 22 // Used to update the client of status changes. int parameter is the progress |
| 23 // and should only be non-zero for the UPDATING state. |
| 24 typedef base::Callback<void(Status, int)> StatusCallback; |
| 25 |
| 26 virtual ~VersionUpdater() {} |
| 27 |
| 28 // Sub-classes must implement this method to create the respective |
| 29 // specialization. |
| 30 static VersionUpdater* Create(); |
| 31 |
| 32 // Begins the update process. |callback| is called for each status update. |
| 33 virtual void CheckForUpdate(const StatusCallback& callback) = 0; |
| 34 |
| 35 // Relaunches the browser, generally after being updated. |
| 36 virtual void RelaunchBrowser() const = 0; |
| 37 }; |
| 38 |
| 39 #endif // CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_H_ |
| OLD | NEW |