Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 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_UPGRADE_BUBBLE_VIEW_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_UPGRADE_BUBBLE_VIEW_H_ | |
| 7 | |
| 8 #include "ui/views/bubble/bubble_delegate.h" | |
| 9 #include "ui/views/controls/button/button.h" | |
| 10 | |
| 11 namespace views { | |
| 12 class TextButton; | |
| 13 } | |
| 14 | |
| 15 class Browser; | |
| 16 | |
| 17 // UpgradeBubbleView is a view intended to be used as the content of a | |
| 18 // Bubble. UpgradeBubbleView provides views for warning the user that an | |
| 19 // 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.
| |
| 20 // instead use the static Show method. | |
| 21 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.
| |
| 22 public views::ButtonListener { | |
| 23 public: | |
| 24 static void ShowBubble(views::View* anchor_view, Browser* browser); | |
| 25 | |
| 26 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
| |
| 27 | |
| 28 // views::BubbleDelegateView method. | |
| 29 virtual views::View* GetInitiallyFocusedView() OVERRIDE; | |
| 30 | |
| 31 // views::WidgetDelegate method. | |
| 32 virtual void WindowClosing() OVERRIDE; | |
| 33 | |
| 34 // views::View method. | |
| 35 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | |
| 36 | |
| 37 protected: | |
| 38 // views::BubbleDelegateView method. | |
| 39 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
| |
| 40 | |
| 41 private: | |
| 42 static bool IsShowing(); | |
| 43 | |
| 44 // Creates a UpgradeBubbleView. | |
| 45 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.
| |
| 46 | |
| 47 // 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.
| |
| 48 // Closes the bubble or opens the download Chrome URL. | |
| 49 virtual void ButtonPressed(views::Button* sender, | |
| 50 const ui::Event& event) OVERRIDE; | |
| 51 | |
| 52 // Handle the message when the user presses a button. | |
| 53 void HandleButtonPressed(views::Button* sender); | |
| 54 | |
| 55 // The upgrade bubble, if we're showing one. | |
| 56 static UpgradeBubbleView* upgrade_bubble_; | |
| 57 | |
| 58 // Button to reinstall now. | |
| 59 views::TextButton* reinstall_button_; | |
| 60 | |
| 61 // 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.
| |
| 62 views::TextButton* later_button_; | |
| 63 | |
| 64 // 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.
| |
| 65 Browser* browser_; | |
| 66 | |
| 67 DISALLOW_COPY_AND_ASSIGN(UpgradeBubbleView); | |
| 68 }; | |
| 69 | |
| 70 #endif // CHROME_BROWSER_UI_VIEWS_UPGRADE_BUBBLE_VIEW_H_ | |
| OLD | NEW |