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