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/host_desktop.h" | |
8 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 9 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
9 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
10 #include "content/public/browser/notification_registrar.h" | 11 #include "content/public/browser/notification_registrar.h" |
11 #include "content/public/browser/web_contents_observer.h" | 12 #include "content/public/browser/web_contents_observer.h" |
12 #include "ui/views/bubble/bubble_delegate.h" | 13 #include "ui/views/bubble/bubble_delegate.h" |
13 #include "ui/views/controls/button/button.h" | 14 #include "ui/views/controls/button/button.h" |
14 #include "ui/views/controls/styled_label_listener.h" | 15 #include "ui/views/controls/styled_label_listener.h" |
15 | 16 |
16 namespace views { | 17 namespace views { |
17 class Checkbox; | 18 class Checkbox; |
(...skipping 18 matching lines...) Expand all Loading... | |
36 public views::StyledLabelListener, | 37 public views::StyledLabelListener, |
37 public content::WebContentsObserver, | 38 public content::WebContentsObserver, |
38 public content::NotificationObserver, | 39 public content::NotificationObserver, |
39 public TabStripModelObserver { | 40 public TabStripModelObserver { |
40 public: | 41 public: |
41 static void Show(Browser* browser); | 42 static void Show(Browser* browser); |
42 | 43 |
43 private: | 44 private: |
44 SessionCrashedBubbleView(views::View* anchor_view, | 45 SessionCrashedBubbleView(views::View* anchor_view, |
45 Browser* browser, | 46 Browser* browser, |
46 content::WebContents* web_contents); | 47 content::WebContents* web_contents, |
48 bool offer_uma_optin); | |
47 virtual ~SessionCrashedBubbleView(); | 49 virtual ~SessionCrashedBubbleView(); |
48 | 50 |
51 // Creates and shows the session crashed bubble, with |offer_uma_optin| | |
52 // indicating whether the UMA opt-in checkbox should be shown. Called | |
53 // by Show() after checking whether the UMA option should be presented. | |
54 static void ShowForReal(Browser* browser, chrome::HostDesktopType type, | |
Alexei Svitkine (slow)
2014/05/15 22:50:49
Nit: 1 param per line.
yao
2014/05/20 15:48:40
Done.
| |
55 bool offer_uma_optin); | |
56 | |
49 // WidgetDelegateView methods. | 57 // WidgetDelegateView methods. |
50 virtual views::View* GetInitiallyFocusedView() OVERRIDE; | 58 virtual views::View* GetInitiallyFocusedView() OVERRIDE; |
51 | 59 |
52 // views::BubbleDelegateView methods. | 60 // views::BubbleDelegateView methods. |
53 virtual void Init() OVERRIDE; | 61 virtual void Init() OVERRIDE; |
54 | 62 |
55 // views::ButtonListener methods. | 63 // views::ButtonListener methods. |
56 virtual void ButtonPressed(views::Button* sender, | 64 virtual void ButtonPressed(views::Button* sender, |
57 const ui::Event& event) OVERRIDE; | 65 const ui::Event& event) OVERRIDE; |
58 | 66 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
105 | 113 |
106 // Button for the user to confirm a session restore. | 114 // Button for the user to confirm a session restore. |
107 views::LabelButton* restore_button_; | 115 views::LabelButton* restore_button_; |
108 | 116 |
109 // Button for the user to close this bubble. | 117 // Button for the user to close this bubble. |
110 views::LabelButton* close_; | 118 views::LabelButton* close_; |
111 | 119 |
112 // Checkbox for the user to opt-in to UMA reporting. | 120 // Checkbox for the user to opt-in to UMA reporting. |
113 views::Checkbox* uma_option_; | 121 views::Checkbox* uma_option_; |
114 | 122 |
123 // Whether or not the UMA opt-in option should be shown. | |
124 bool offer_uma_optin_; | |
125 | |
115 // Whether or not a navigation has started on current tab. | 126 // Whether or not a navigation has started on current tab. |
116 bool started_navigation_; | 127 bool started_navigation_; |
117 | 128 |
118 DISALLOW_COPY_AND_ASSIGN(SessionCrashedBubbleView); | 129 DISALLOW_COPY_AND_ASSIGN(SessionCrashedBubbleView); |
119 }; | 130 }; |
120 | 131 |
121 #endif // CHROME_BROWSER_UI_VIEWS_SESSION_CRASHED_BUBBLE_VIEW_H_ | 132 #endif // CHROME_BROWSER_UI_VIEWS_SESSION_CRASHED_BUBBLE_VIEW_H_ |
OLD | NEW |