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

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 CR comments... Created 7 years, 11 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..305c2d290f93a4c2eabbf704e224ded33c84071c
--- /dev/null
+++ b/chrome/browser/ui/views/outdated_upgrade_bubble_view.h
@@ -0,0 +1,64 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
Finnur 2013/01/23 10:39:17 Happy new year! :)
MAD 2013/01/23 20:57:59 Hamingjusamur Nýtt Ár :-)
Finnur 2013/01/24 10:13:32 nit: It's Gleðilegt nýtt ár! :) On 2013/01/23 20
MAD 2013/01/24 17:29:35 :-)
+// 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 is a view that warns the user that an upgrade is
Finnur 2013/01/23 10:39:17 nit: 'is a view that' is redundant.
MAD 2013/01/23 20:57:59 Done.
+// long overdue. It is intended to be used as the content of a bubble anchored
+// off of the Chrome toolbar. Don't create a OutdatedUpgradeBubbleView directly,
+// instead use the static Show method.
+class OutdatedUpgradeBubbleView : public views::BubbleDelegateView,
+ public views::ButtonListener {
+ public:
+ static void ShowBubble(views::View* anchor_view, Browser* browser);
+ static bool IsShowing();
+
+ // 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();
+
+ // views::BubbleDelegateView method.
+ virtual void Init() OVERRIDE;
+
+ // views::ButtonListener method.
+ // Closes the bubble or opens the download Chrome URL.
Finnur 2013/01/23 10:39:17 nit: I'd probably drop this comment (line 41).
MAD 2013/01/23 20:57:59 Done.
+ 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_;
+
+ // Button for the user to reinstall Chrome now, by navigating to the
Finnur 2013/01/23 10:39:17 nit: More concise and to the point: // Button that
MAD 2013/01/23 20:57:59 Done.
+ // Download Chrome URL.
+ 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_

Powered by Google App Engine
This is Rietveld 408576698