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_WIN_H_ | |
6 #define CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_WIN_H_ | |
7 #pragma once | |
8 | |
9 #include "base/memory/ref_counted.h" | |
10 #include "base/memory/weak_ptr.h" | |
11 #include "base/string16.h" | |
12 #include "chrome/browser/google/google_update.h" | |
13 #include "chrome/browser/ui/webui/help/version_updater.h" | |
14 | |
15 class Version; | |
16 | |
17 class VersionUpdaterWin : public VersionUpdater, | |
18 public GoogleUpdateStatusListener { | |
19 public: | |
20 // Got the intalled version so we can complete the handling of the | |
21 // UPGRADE_ALREADY_UP_TO_DATE result case. | |
22 void GotInstalledVersion(Version* version); | |
Roger Tawa OOO till Jul 10th
2012/07/05 16:13:22
Could make this method private by declaring the Ve
MAD
2012/07/05 20:50:41
Yeah, I was hesitating... I was wondering which on
| |
23 | |
24 protected: | |
25 friend class VersionUpdater; | |
Roger Tawa OOO till Jul 10th
2012/07/05 16:13:22
do friends go in the private section?
MAD
2012/07/05 20:50:41
Done.
| |
26 | |
27 // Clients must use VersionUpdater::Create(). | |
28 VersionUpdaterWin(); | |
29 virtual ~VersionUpdaterWin(); | |
30 | |
31 private: | |
32 // VersionUpdater implementation. | |
33 virtual void CheckForUpdate(const StatusCallback& callback) OVERRIDE; | |
34 virtual void RelaunchBrowser() const OVERRIDE; | |
35 | |
36 // GoogleUpdateStatusListener implementation. | |
37 virtual void OnReportResults(GoogleUpdateUpgradeResult result, | |
38 GoogleUpdateErrorCode error_code, | |
39 const string16& error_message, | |
40 const string16& version) OVERRIDE; | |
41 | |
42 // Update the UI to show the status of the upgrade. | |
43 void UpdateStatus(GoogleUpdateUpgradeResult result, | |
44 GoogleUpdateErrorCode error_code, | |
45 const string16& error_message); | |
46 | |
47 // The class that communicates with Google Update to find out if an update is | |
48 // available and asks it to start an upgrade. | |
49 scoped_refptr<GoogleUpdate> google_updater_; | |
50 | |
51 // Used for callbacks. | |
52 base::WeakPtrFactory<VersionUpdaterWin> weak_factory_; | |
53 | |
54 // Callback used to communicate update status to the client. | |
55 StatusCallback callback_; | |
56 | |
57 DISALLOW_COPY_AND_ASSIGN(VersionUpdaterWin); | |
58 }; | |
59 | |
60 #endif // CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_WIN_H_ | |
OLD | NEW |