Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Unified Diff: chrome/browser/ui/views/outdated_upgrade_bubble_view.h

Issue 11440020: Add an outdated upgrade bubble view. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed OWNERS comments... Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..8ed3249016d89de947c4f8147065647abc65167f
--- /dev/null
+++ b/chrome/browser/ui/views/outdated_upgrade_bubble_view.h
@@ -0,0 +1,78 @@
+// 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;
+}
+
+namespace content {
+class PageNavigator;
+}
+
+// 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,
+ content::PageNavigator* navigator);
+
+ // Identifies if we are running a build that supports the
+ // outdated upgrade bubble view.
+ static bool IsAvailable();
+
+ // views::BubbleDelegateView method.
+ virtual views::View* GetInitiallyFocusedView() OVERRIDE;
+
+ // views::WidgetDelegate method.
+ virtual void WindowClosing() OVERRIDE;
+
+ private:
+ OutdatedUpgradeBubbleView(views::View* anchor_view,
+ content::PageNavigator* navigator);
+ 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 finally choosing to
+ // reinstall.
+ static int num_ignored_bubbles_;
+
+ // 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 PageNavigator to use for opening the Download Chrome URL.
+ content::PageNavigator* navigator_;
+
+ DISALLOW_COPY_AND_ASSIGN(OutdatedUpgradeBubbleView);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_OUTDATED_UPGRADE_BUBBLE_VIEW_H_
« no previous file with comments | « chrome/browser/ui/toolbar/wrench_menu_model.cc ('k') | chrome/browser/ui/views/outdated_upgrade_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698