| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_MAC_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_MAC_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_MAC_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_MAC_H_ |
| 7 | 7 |
| 8 #import <AppKit/AppKit.h> | 8 #import <AppKit/AppKit.h> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/mac/scoped_nsobject.h" | 11 #include "base/mac/scoped_nsobject.h" |
| 12 #include "chrome/browser/ui/webui/help/version_updater.h" | 12 #include "chrome/browser/ui/webui/help/version_updater.h" |
| 13 | 13 |
| 14 @class KeystoneObserver; | 14 @class KeystoneObserver; |
| 15 | 15 |
| 16 // OS X implementation of version update functionality, used by the WebUI | 16 // OS X implementation of version update functionality, used by the WebUI |
| 17 // About/Help page. | 17 // About/Help page. |
| 18 class VersionUpdaterMac : public VersionUpdater { | 18 class VersionUpdaterMac : public VersionUpdater { |
| 19 public: | 19 public: |
| 20 // VersionUpdater implementation. | 20 // VersionUpdater implementation. |
| 21 virtual void CheckForUpdate(const StatusCallback& status_callback, | 21 void CheckForUpdate(const StatusCallback& status_callback, |
| 22 const PromoteCallback& promote_callback) override; | 22 const PromoteCallback& promote_callback) override; |
| 23 virtual void PromoteUpdater() const override; | 23 void PromoteUpdater() const override; |
| 24 virtual void RelaunchBrowser() const override; | 24 void RelaunchBrowser() const override; |
| 25 | 25 |
| 26 // Process status updates received from Keystone. The dictionary will contain | 26 // Process status updates received from Keystone. The dictionary will contain |
| 27 // an AutoupdateStatus value as an intValue at key kAutoupdateStatusStatus. If | 27 // an AutoupdateStatus value as an intValue at key kAutoupdateStatusStatus. If |
| 28 // a version is available (see AutoupdateStatus), it will be present at key | 28 // a version is available (see AutoupdateStatus), it will be present at key |
| 29 // kAutoupdateStatusVersion. | 29 // kAutoupdateStatusVersion. |
| 30 void UpdateStatus(NSDictionary* status); | 30 void UpdateStatus(NSDictionary* status); |
| 31 | 31 |
| 32 protected: | 32 protected: |
| 33 friend class VersionUpdater; | 33 friend class VersionUpdater; |
| 34 | 34 |
| 35 // Clients must use VersionUpdater::Create(). | 35 // Clients must use VersionUpdater::Create(). |
| 36 VersionUpdaterMac(); | 36 VersionUpdaterMac(); |
| 37 virtual ~VersionUpdaterMac(); | 37 ~VersionUpdaterMac() override; |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 // Update the visibility state of promote button. | 40 // Update the visibility state of promote button. |
| 41 void UpdateShowPromoteButton(); | 41 void UpdateShowPromoteButton(); |
| 42 | 42 |
| 43 // Callback used to communicate update status to the client. | 43 // Callback used to communicate update status to the client. |
| 44 StatusCallback status_callback_; | 44 StatusCallback status_callback_; |
| 45 | 45 |
| 46 // Callback used to show or hide the promote UI elements. | 46 // Callback used to show or hide the promote UI elements. |
| 47 PromoteCallback promote_callback_; | 47 PromoteCallback promote_callback_; |
| 48 | 48 |
| 49 // The visible state of the promote button. | 49 // The visible state of the promote button. |
| 50 bool show_promote_button_; | 50 bool show_promote_button_; |
| 51 | 51 |
| 52 // The observer that will receive keystone status updates. | 52 // The observer that will receive keystone status updates. |
| 53 base::scoped_nsobject<KeystoneObserver> keystone_observer_; | 53 base::scoped_nsobject<KeystoneObserver> keystone_observer_; |
| 54 | 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(VersionUpdaterMac); | 55 DISALLOW_COPY_AND_ASSIGN(VersionUpdaterMac); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 #endif // CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_MAC_H_ | 58 #endif // CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_MAC_H_ |
| 59 | 59 |
| OLD | NEW |