OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_RECOVERY_COMPONENT_BUBBLE_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_RECOVERY_COMPONENT_BUBBLE_VIEW_H_ |
| 7 |
| 8 #include "ui/views/bubble/bubble_delegate.h" |
| 9 #include "ui/views/controls/button/button.h" |
| 10 |
| 11 class ElevationIconSetter; |
| 12 |
| 13 namespace views { |
| 14 class LabelButton; |
| 15 } |
| 16 |
| 17 // RecoveryComponentBubbleView warns the user that elevation is needed to |
| 18 // recovery Chrome upgrade channel (Omaha). It is intended to be used as the |
| 19 // content of a bubble anchored off of the Chrome toolbar. Don't create an |
| 20 // RecoveryComponentBubbleView directly, instead use the static ShowBubble |
| 21 // method. |
| 22 class RecoveryComponentBubbleView : public views::BubbleDelegateView, |
| 23 public views::ButtonListener { |
| 24 public: |
| 25 static void ShowBubble(views::View* anchor_view); |
| 26 |
| 27 // Identifies if we are running a build that supports the |
| 28 // outdated upgrade bubble view. |
| 29 static bool IsAvailable(); |
| 30 |
| 31 // views::BubbleDelegateView method. |
| 32 virtual views::View* GetInitiallyFocusedView() OVERRIDE; |
| 33 |
| 34 // views::WidgetDelegate method. |
| 35 virtual void WindowClosing() OVERRIDE; |
| 36 |
| 37 private: |
| 38 explicit RecoveryComponentBubbleView(views::View* anchor_view); |
| 39 virtual ~RecoveryComponentBubbleView(); |
| 40 |
| 41 static bool IsShowing() { return recovery_component_bubble_ != NULL; } |
| 42 |
| 43 // views::BubbleDelegateView method. |
| 44 virtual void Init() OVERRIDE; |
| 45 |
| 46 // views::ButtonListener method. |
| 47 virtual void ButtonPressed(views::Button* sender, |
| 48 const ui::Event& event) OVERRIDE; |
| 49 |
| 50 // Handle the message when the user presses a button. |
| 51 void HandleButtonPressed(views::Button* sender); |
| 52 |
| 53 // The upgrade bubble, if we're showing one. |
| 54 static RecoveryComponentBubbleView* recovery_component_bubble_; |
| 55 |
| 56 // Button that lets the user accept the proposal, which is to install |
| 57 // recovery component as an elevated admin. |
| 58 views::LabelButton* accept_button_; |
| 59 |
| 60 // Button that lets the user deny the proposal, which is to install |
| 61 // recovery component as an elevated admin. |
| 62 views::LabelButton* decline_button_; |
| 63 |
| 64 scoped_ptr<ElevationIconSetter> elevation_icon_setter_; |
| 65 |
| 66 DISALLOW_COPY_AND_ASSIGN(RecoveryComponentBubbleView); |
| 67 }; |
| 68 |
| 69 #endif // CHROME_BROWSER_UI_VIEWS_RECOVERY_COMPONENT_BUBBLE_VIEW_H_ |
OLD | NEW |