| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Windows implementation of version update functionality, used by the WebUI | 5 // Windows implementation of version update functionality, used by the WebUI |
| 6 // About/Help page. | 6 // About/Help page. |
| 7 | 7 |
| 8 #ifndef CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_WIN_H_ | 8 #ifndef CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_WIN_H_ |
| 9 #define CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_WIN_H_ | 9 #define CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_WIN_H_ |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "chrome/browser/google/google_update_win.h" | 14 #include "chrome/browser/google/google_update_win.h" |
| 15 #include "chrome/browser/ui/webui/help/version_updater.h" | 15 #include "chrome/browser/ui/webui/help/version_updater.h" |
| 16 | 16 |
| 17 class VersionUpdaterWin : public VersionUpdater, | 17 class VersionUpdaterWin : public VersionUpdater, |
| 18 public UpdateCheckDelegate { | 18 public UpdateCheckDelegate { |
| 19 public: | 19 public: |
| 20 // |owner_widget| is the parent widget hosting the update check UI. Any UI | 20 // |owner_widget| is the parent widget hosting the update check UI. Any UI |
| 21 // needed to install an update (e.g., a UAC prompt for a system-level install) | 21 // needed to install an update (e.g., a UAC prompt for a system-level install) |
| 22 // will be parented to this widget. |owner_widget| may be given a value of | 22 // will be parented to this widget. |owner_widget| may be given a value of |
| 23 // nullptr in which case the UAC prompt will be parented to the desktop. | 23 // nullptr in which case the UAC prompt will be parented to the desktop. |
| 24 explicit VersionUpdaterWin(gfx::AcceleratedWidget owner_widget); | 24 explicit VersionUpdaterWin(gfx::AcceleratedWidget owner_widget); |
| 25 ~VersionUpdaterWin() override; | 25 ~VersionUpdaterWin() override; |
| 26 | 26 |
| 27 // VersionUpdater: | 27 // VersionUpdater: |
| 28 void CheckForUpdate(const StatusCallback& callback, | 28 void CheckForUpdate(const StatusCallback& callback, |
| 29 const PromoteCallback&) override; | 29 const PromoteCallback&) override; |
| 30 void RelaunchBrowser() const override; | |
| 31 | 30 |
| 32 // UpdateCheckDelegate: | 31 // UpdateCheckDelegate: |
| 33 void OnUpdateCheckComplete(const base::string16& new_version) override; | 32 void OnUpdateCheckComplete(const base::string16& new_version) override; |
| 34 void OnUpgradeProgress(int progress, | 33 void OnUpgradeProgress(int progress, |
| 35 const base::string16& new_version) override; | 34 const base::string16& new_version) override; |
| 36 void OnUpgradeComplete(const base::string16& new_version) override; | 35 void OnUpgradeComplete(const base::string16& new_version) override; |
| 37 void OnError(GoogleUpdateErrorCode error_code, | 36 void OnError(GoogleUpdateErrorCode error_code, |
| 38 const base::string16& html_error_message, | 37 const base::string16& html_error_message, |
| 39 const base::string16& new_version) override; | 38 const base::string16& new_version) override; |
| 40 | 39 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 51 // Callback used to communicate update status to the client. | 50 // Callback used to communicate update status to the client. |
| 52 StatusCallback callback_; | 51 StatusCallback callback_; |
| 53 | 52 |
| 54 // Used for callbacks. | 53 // Used for callbacks. |
| 55 base::WeakPtrFactory<VersionUpdaterWin> weak_factory_; | 54 base::WeakPtrFactory<VersionUpdaterWin> weak_factory_; |
| 56 | 55 |
| 57 DISALLOW_COPY_AND_ASSIGN(VersionUpdaterWin); | 56 DISALLOW_COPY_AND_ASSIGN(VersionUpdaterWin); |
| 58 }; | 57 }; |
| 59 | 58 |
| 60 #endif // CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_WIN_H_ | 59 #endif // CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_WIN_H_ |
| OLD | NEW |