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

Side by Side Diff: chrome/browser/ui/views/session_crashed_bubble_view.h

Issue 287653004: Schedule posttask to decide Uma optin option offering (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove debug bits. Created 6 years, 7 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 unified diff | Download patch
OLDNEW
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 20 matching lines...) Expand all
31 // crashed. It also presents an option to enable metrics reporting, if it not 31 // crashed. It also presents an option to enable metrics reporting, if it not
32 // enabled already. 32 // enabled already.
33 class SessionCrashedBubbleView 33 class SessionCrashedBubbleView
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 // Schedule a posttask to find out whether or not uma optin option should be
42 // offered. After it finishes, calls ShowForReal to show the bubble.
Alexei Svitkine (slow) 2014/05/14 21:17:02 Nit: This comment is talking about an implementati
yao 2014/05/14 21:24:31 Done.
41 static void Show(Browser* browser); 43 static void Show(Browser* browser);
42 44
43 private: 45 private:
44 SessionCrashedBubbleView(views::View* anchor_view, 46 SessionCrashedBubbleView(views::View* anchor_view,
45 Browser* browser, 47 Browser* browser,
46 content::WebContents* web_contents); 48 content::WebContents* web_contents,
49 bool offer_uma_optin);
47 virtual ~SessionCrashedBubbleView(); 50 virtual ~SessionCrashedBubbleView();
48 51
52 // Called by Show(Browser* browser) after knowing whether or not uma optin
53 // option should be offered, it creates and shows the session crashed bubble.
Alexei Svitkine (slow) 2014/05/14 21:17:02 Nit: Seems like you have two sentences jammed toge
yao 2014/05/14 21:24:31 Done.
54 static void ShowForReal(Browser* browser, bool offer_uma_optin);
55
49 // WidgetDelegateView methods. 56 // WidgetDelegateView methods.
50 virtual views::View* GetInitiallyFocusedView() OVERRIDE; 57 virtual views::View* GetInitiallyFocusedView() OVERRIDE;
51 58
52 // views::BubbleDelegateView methods. 59 // views::BubbleDelegateView methods.
53 virtual void Init() OVERRIDE; 60 virtual void Init() OVERRIDE;
54 61
55 // views::ButtonListener methods. 62 // views::ButtonListener methods.
56 virtual void ButtonPressed(views::Button* sender, 63 virtual void ButtonPressed(views::Button* sender,
57 const ui::Event& event) OVERRIDE; 64 const ui::Event& event) OVERRIDE;
58 65
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 112
106 // Button for the user to confirm a session restore. 113 // Button for the user to confirm a session restore.
107 views::LabelButton* restore_button_; 114 views::LabelButton* restore_button_;
108 115
109 // Button for the user to close this bubble. 116 // Button for the user to close this bubble.
110 views::LabelButton* close_; 117 views::LabelButton* close_;
111 118
112 // Checkbox for the user to opt-in to UMA reporting. 119 // Checkbox for the user to opt-in to UMA reporting.
113 views::Checkbox* uma_option_; 120 views::Checkbox* uma_option_;
114 121
122 // Whether or not should offer UMA opt-in option.
Alexei Svitkine (slow) 2014/05/14 21:17:02 Nit: "Whether or not the UMA opt-in option should
yao 2014/05/14 21:24:31 Done.
123 bool offer_uma_optin_;
124
115 // Whether or not a navigation has started on current tab. 125 // Whether or not a navigation has started on current tab.
116 bool started_navigation_; 126 bool started_navigation_;
117 127
118 DISALLOW_COPY_AND_ASSIGN(SessionCrashedBubbleView); 128 DISALLOW_COPY_AND_ASSIGN(SessionCrashedBubbleView);
119 }; 129 };
120 130
121 #endif // CHROME_BROWSER_UI_VIEWS_SESSION_CRASHED_BUBBLE_VIEW_H_ 131 #endif // CHROME_BROWSER_UI_VIEWS_SESSION_CRASHED_BUBBLE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698