Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / recovery / recovery_install_global_error.h
blob3e97f56f3fbe05c03c3e4b3df7265d7ed832596a
1 // Copyright (c) 2014 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_RECOVERY_RECOVERY_INSTALL_GLOBAL_ERROR_H_
6 #define CHROME_BROWSER_RECOVERY_RECOVERY_INSTALL_GLOBAL_ERROR_H_
8 #include <vector>
10 #include "base/prefs/pref_change_registrar.h"
11 #include "chrome/browser/ui/global_error/global_error.h"
12 #include "components/keyed_service/core/keyed_service.h"
14 class Profile;
16 // Shows elevation needed for recovery component install on the wrench menu
17 // using a bubble view and a menu item.
18 class RecoveryInstallGlobalError : public GlobalErrorWithStandardBubble,
19 public KeyedService {
20 public:
21 explicit RecoveryInstallGlobalError(Profile* profile);
22 ~RecoveryInstallGlobalError() override;
24 private:
25 // KeyedService:
26 void Shutdown() override;
28 // GlobalErrorWithStandardBubble:
29 Severity GetSeverity() override;
30 bool HasMenuItem() override;
31 int MenuItemCommandID() override;
32 base::string16 MenuItemLabel() override;
33 gfx::Image MenuItemIcon() override;
34 void ExecuteMenuItem(Browser* browser) override;
35 bool HasBubbleView() override;
36 bool HasShownBubbleView() override;
37 void ShowBubbleView(Browser* browser) override;
38 bool ShouldCloseOnDeactivate() const override;
39 gfx::Image GetBubbleViewIcon() override;
40 base::string16 GetBubbleViewTitle() override;
41 std::vector<base::string16> GetBubbleViewMessages() override;
42 base::string16 GetBubbleViewAcceptButtonLabel() override;
43 bool ShouldShowCloseButton() const override;
44 bool ShouldAddElevationIconToAcceptButton() override;
45 base::string16 GetBubbleViewCancelButtonLabel() override;
46 void OnBubbleViewDidClose(Browser* browser) override;
47 void BubbleViewAcceptButtonPressed(Browser* browser) override;
48 void BubbleViewCancelButtonPressed(Browser* browser) override;
50 bool HasElevationNotification() const;
51 void OnElevationRequirementChanged();
53 bool elevation_needed_;
55 // The Profile this service belongs to.
56 Profile* profile_;
58 // Monitors registry change for recovery component install.
59 PrefChangeRegistrar pref_registrar_;
61 bool has_shown_bubble_view_;
63 DISALLOW_COPY_AND_ASSIGN(RecoveryInstallGlobalError);
66 #endif // CHROME_BROWSER_RECOVERY_RECOVERY_INSTALL_GLOBAL_ERROR_H_