Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_SESSION_CRASHED_BUBBLE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_SESSION_CRASHED_BUBBLE_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_SESSION_CRASHED_BUBBLE_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_SESSION_CRASHED_BUBBLE_VIEW_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 8 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
| 9 #include "content/public/browser/notification_observer.h" | 9 #include "content/public/browser/notification_observer.h" |
| 10 #include "content/public/browser/notification_registrar.h" | 10 #include "content/public/browser/notification_registrar.h" |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 : public views::BubbleDelegateView, | 34 : public views::BubbleDelegateView, |
| 35 public views::ButtonListener, | 35 public views::ButtonListener, |
| 36 public views::StyledLabelListener, | 36 public views::StyledLabelListener, |
| 37 public content::WebContentsObserver, | 37 public content::WebContentsObserver, |
| 38 public content::NotificationObserver, | 38 public content::NotificationObserver, |
| 39 public TabStripModelObserver { | 39 public TabStripModelObserver { |
| 40 public: | 40 public: |
| 41 static void Show(Browser* browser); | 41 static void Show(Browser* browser); |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 // A helper class that listens to browser removal event. | |
| 45 class BrowserRemovalObserver; | |
| 46 | |
| 44 SessionCrashedBubbleView(views::View* anchor_view, | 47 SessionCrashedBubbleView(views::View* anchor_view, |
| 45 Browser* browser, | 48 Browser* browser, |
| 46 content::WebContents* web_contents); | 49 content::WebContents* web_contents, |
| 50 bool offer_uma_optin); | |
| 47 virtual ~SessionCrashedBubbleView(); | 51 virtual ~SessionCrashedBubbleView(); |
| 48 | 52 |
| 53 // Creates and shows the session crashed bubble, with |offer_uma_optin| | |
| 54 // indicating whether the UMA opt-in checkbox should be shown. Called | |
| 55 // by Show() after checking whether the UMA option should be presented. | |
|
Alexei Svitkine (slow)
2014/05/21 07:23:00
Nit: Expand comment to mention that it takes owner
yao
2014/05/21 14:13:20
Done.
| |
| 56 static void ShowForReal(BrowserRemovalObserver* browser_observer, | |
| 57 bool offer_uma_optin); | |
| 58 | |
| 49 // WidgetDelegateView methods. | 59 // WidgetDelegateView methods. |
| 50 virtual views::View* GetInitiallyFocusedView() OVERRIDE; | 60 virtual views::View* GetInitiallyFocusedView() OVERRIDE; |
| 51 | 61 |
| 52 // views::BubbleDelegateView methods. | 62 // views::BubbleDelegateView methods. |
| 53 virtual void Init() OVERRIDE; | 63 virtual void Init() OVERRIDE; |
| 54 | 64 |
| 55 // views::ButtonListener methods. | 65 // views::ButtonListener methods. |
| 56 virtual void ButtonPressed(views::Button* sender, | 66 virtual void ButtonPressed(views::Button* sender, |
| 57 const ui::Event& event) OVERRIDE; | 67 const ui::Event& event) OVERRIDE; |
| 58 | 68 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 | 115 |
| 106 // Button for the user to confirm a session restore. | 116 // Button for the user to confirm a session restore. |
| 107 views::LabelButton* restore_button_; | 117 views::LabelButton* restore_button_; |
| 108 | 118 |
| 109 // Button for the user to close this bubble. | 119 // Button for the user to close this bubble. |
| 110 views::LabelButton* close_; | 120 views::LabelButton* close_; |
| 111 | 121 |
| 112 // Checkbox for the user to opt-in to UMA reporting. | 122 // Checkbox for the user to opt-in to UMA reporting. |
| 113 views::Checkbox* uma_option_; | 123 views::Checkbox* uma_option_; |
| 114 | 124 |
| 125 // Whether or not the UMA opt-in option should be shown. | |
| 126 bool offer_uma_optin_; | |
| 127 | |
| 115 // Whether or not a navigation has started on current tab. | 128 // Whether or not a navigation has started on current tab. |
| 116 bool started_navigation_; | 129 bool started_navigation_; |
| 117 | 130 |
| 118 DISALLOW_COPY_AND_ASSIGN(SessionCrashedBubbleView); | 131 DISALLOW_COPY_AND_ASSIGN(SessionCrashedBubbleView); |
| 119 }; | 132 }; |
| 120 | 133 |
| 121 #endif // CHROME_BROWSER_UI_VIEWS_SESSION_CRASHED_BUBBLE_VIEW_H_ | 134 #endif // CHROME_BROWSER_UI_VIEWS_SESSION_CRASHED_BUBBLE_VIEW_H_ |
| OLD | NEW |