Chromium Code Reviews| Index: chrome/browser/ui/views/outdated_upgrade_bubble_view.h |
| diff --git a/chrome/browser/ui/views/outdated_upgrade_bubble_view.h b/chrome/browser/ui/views/outdated_upgrade_bubble_view.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..29a372c1a2532376da1ba0a5ab73e1973276d65d |
| --- /dev/null |
| +++ b/chrome/browser/ui/views/outdated_upgrade_bubble_view.h |
| @@ -0,0 +1,70 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_VIEWS_OUTDATED_UPGRADE_BUBBLE_VIEW_H_ |
| +#define CHROME_BROWSER_UI_VIEWS_OUTDATED_UPGRADE_BUBBLE_VIEW_H_ |
| + |
| +#include "ui/views/bubble/bubble_delegate.h" |
| +#include "ui/views/controls/button/button.h" |
| + |
| +namespace views { |
| +class TextButton; |
| +} |
| + |
| +class Browser; |
| + |
| +// OutdatedUpgradeBubbleView warns the user that an upgrade is long overdue. |
| +// It is intended to be used as the content of a bubble anchored off of the |
| +// Chrome toolbar. Don't create an OutdatedUpgradeBubbleView directly, |
| +// instead use the static ShowBubble method. |
| +class OutdatedUpgradeBubbleView : public views::BubbleDelegateView, |
| + public views::ButtonListener { |
| + public: |
| + static void ShowBubble(views::View* anchor_view, Browser* browser); |
| + |
| + // views::BubbleDelegateView method. |
| + virtual views::View* GetInitiallyFocusedView() OVERRIDE; |
| + |
| + // views::WidgetDelegate method. |
| + virtual void WindowClosing() OVERRIDE; |
| + |
| + private: |
| + OutdatedUpgradeBubbleView(views::View* anchor_view, Browser* browser); |
| + virtual ~OutdatedUpgradeBubbleView(); |
| + |
| + static bool IsShowing() { return upgrade_bubble_ != NULL; } |
| + |
| + // views::BubbleDelegateView method. |
| + virtual void Init() OVERRIDE; |
| + |
| + // views::ButtonListener method. |
| + virtual void ButtonPressed(views::Button* sender, |
| + const ui::Event& event) OVERRIDE; |
| + |
| + // Handle the message when the user presses a button. |
| + void HandleButtonPressed(views::Button* sender); |
| + |
| + // The upgrade bubble, if we're showing one. |
| + static OutdatedUpgradeBubbleView* upgrade_bubble_; |
| + |
| + // The numer of times the user ignored the bubble before it finally chose to |
|
Finnur
2013/02/05 10:52:19
Suggest: ... before finally choosing to reinstall.
MAD
2013/02/05 16:49:16
Done.
|
| + // reinstall. |
| + static int num_ignored_bubbles_; |
|
Finnur
2013/02/05 10:52:19
I'm a little confused as to why you are keeping tr
MAD
2013/02/05 16:49:16
There is a way to get the bubble back. Clicking on
Finnur
2013/02/05 22:14:50
Oh, I see. So the menu item stays and you can reca
|
| + |
| + // Identifies if the reinstall button was hit before closing the bubble. |
| + bool chose_to_reinstall_; |
| + |
| + // Button that takes the user to the Chrome download page. |
| + views::TextButton* reinstall_button_; |
| + |
| + // Button for the user to be reminded later about the outdated upgrade. |
| + views::TextButton* later_button_; |
| + |
| + // The browser to use for opening the Download Chrome URL. |
| + Browser* browser_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(OutdatedUpgradeBubbleView); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_VIEWS_OUTDATED_UPGRADE_BUBBLE_VIEW_H_ |