Index: chrome/browser/ui/views/session_crashed_bubble_view.h |
diff --git a/chrome/browser/ui/views/session_crashed_bubble_view.h b/chrome/browser/ui/views/session_crashed_bubble_view.h |
index 8986da6c983bff5b01a1727d9b83bd3db93ab84b..109ab16178aa4be656f4d3aa6274a7229777e739 100644 |
--- a/chrome/browser/ui/views/session_crashed_bubble_view.h |
+++ b/chrome/browser/ui/views/session_crashed_bubble_view.h |
@@ -5,6 +5,7 @@ |
#ifndef CHROME_BROWSER_UI_VIEWS_SESSION_CRASHED_BUBBLE_VIEW_H_ |
#define CHROME_BROWSER_UI_VIEWS_SESSION_CRASHED_BUBBLE_VIEW_H_ |
+#include "base/memory/scoped_ptr.h" |
#include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
#include "content/public/browser/notification_observer.h" |
#include "content/public/browser/notification_registrar.h" |
@@ -41,11 +42,22 @@ class SessionCrashedBubbleView |
static void Show(Browser* browser); |
private: |
+ // A helper class that listens to browser removal event. |
+ class BrowserRemovalObserver; |
+ |
SessionCrashedBubbleView(views::View* anchor_view, |
Browser* browser, |
- content::WebContents* web_contents); |
+ content::WebContents* web_contents, |
+ bool offer_uma_optin); |
virtual ~SessionCrashedBubbleView(); |
+ // Creates and shows the session crashed bubble, with |offer_uma_optin| |
+ // indicating whether the UMA opt-in checkbox should be shown. Called |
+ // by Show after checking whether the UMA option should be presented and it |
+ // takes ownership of |browser_observer|. |
+ static void ShowForReal(scoped_ptr<BrowserRemovalObserver> browser_observer, |
+ bool offer_uma_optin); |
+ |
// WidgetDelegateView methods. |
virtual views::View* GetInitiallyFocusedView() OVERRIDE; |
@@ -112,6 +124,9 @@ class SessionCrashedBubbleView |
// Checkbox for the user to opt-in to UMA reporting. |
views::Checkbox* uma_option_; |
+ // Whether or not the UMA opt-in option should be shown. |
+ bool offer_uma_optin_; |
+ |
// Whether or not a navigation has started on current tab. |
bool started_navigation_; |