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

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

Issue 11440020: Add an outdated upgrade bubble view. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/upgrade_bubble_view.h
diff --git a/chrome/browser/ui/views/upgrade_bubble_view.h b/chrome/browser/ui/views/upgrade_bubble_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..1e5c5c1e3f747b16869a6c55726baf115b20bae5
--- /dev/null
+++ b/chrome/browser/ui/views/upgrade_bubble_view.h
@@ -0,0 +1,70 @@
+// Copyright (c) 2012 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_UPGRADE_BUBBLE_VIEW_H_
+#define CHROME_BROWSER_UI_VIEWS_UPGRADE_BUBBLE_VIEW_H_
+
+#include "ui/views/bubble/bubble_delegate.h"
+#include "ui/views/controls/button/button.h"
+
+namespace views {
+class TextButton;
+}
+
+class Browser;
+
+// UpgradeBubbleView is a view intended to be used as the content of a
+// Bubble. UpgradeBubbleView provides views for warning the user that an
+// upgrade is long overdue. Don't create a UpgradeBubbleView directly,
Finnur 2012/12/06 19:53:16 nit: Perhaps reword: UpgradeBubbleView is a view t
MAD 2013/01/22 15:18:29 Done.
+// instead use the static Show method.
+class UpgradeBubbleView : public views::BubbleDelegateView,
Finnur 2012/12/06 19:53:16 Hmm... I find this name a little bit too general a
MAD 2013/01/22 15:18:29 Done.
+ public views::ButtonListener {
+ public:
+ static void ShowBubble(views::View* anchor_view, Browser* browser);
+
+ virtual ~UpgradeBubbleView();
Finnur 2012/12/06 19:53:16 I forget... Didn't we have a rule of thumb to move
MAD 2013/01/22 15:18:29 Done. I just followed what was done with the boo
+
+ // views::BubbleDelegateView method.
+ virtual views::View* GetInitiallyFocusedView() OVERRIDE;
+
+ // views::WidgetDelegate method.
+ virtual void WindowClosing() OVERRIDE;
+
+ // views::View method.
+ virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
+
+ protected:
+ // views::BubbleDelegateView method.
+ virtual void Init() OVERRIDE;
Finnur 2012/12/06 19:53:16 Why protected?
MAD 2013/01/22 15:18:29 Done. Again, as is done in bookmark bubble view, s
Finnur 2013/01/23 10:39:17 So... I would probably contact the owner of that v
+
+ private:
+ static bool IsShowing();
+
+ // Creates a UpgradeBubbleView.
+ UpgradeBubbleView(views::View* anchor_view, Browser* browser);
Finnur 2012/12/06 19:53:16 Constructor before static methods, according to st
MAD 2013/01/22 15:18:29 Done.
+
+ // Overridden from views::ButtonListener:
Finnur 2012/12/06 19:53:16 nit: You've used 'foo method.' convention above, s
MAD 2013/01/22 15:18:29 Done.
+ // Closes the bubble or opens the download Chrome URL.
+ 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 UpgradeBubbleView* upgrade_bubble_;
+
+ // Button to reinstall now.
+ views::TextButton* reinstall_button_;
+
+ // Button to be reminded later.
Finnur 2012/12/06 19:53:16 nit: What does the button need to be reminded of?
MAD 2013/01/22 15:18:29 Done.
+ views::TextButton* later_button_;
+
+ // The browser to use for opening the download Chrome URL.
Finnur 2012/12/06 19:53:16 nit: Suggest capitalize d in Download
MAD 2013/01/22 15:18:29 Done.
+ Browser* browser_;
+
+ DISALLOW_COPY_AND_ASSIGN(UpgradeBubbleView);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_UPGRADE_BUBBLE_VIEW_H_

Powered by Google App Engine
This is Rietveld 408576698