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 "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 9 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
10 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 private: | 44 private: |
45 // A helper class that listens to browser removal event. | 45 // A helper class that listens to browser removal event. |
46 class BrowserRemovalObserver; | 46 class BrowserRemovalObserver; |
47 | 47 |
48 SessionCrashedBubbleView(views::View* anchor_view, | 48 SessionCrashedBubbleView(views::View* anchor_view, |
49 Browser* browser, | 49 Browser* browser, |
50 content::WebContents* web_contents, | 50 content::WebContents* web_contents, |
51 bool offer_uma_optin); | 51 bool offer_uma_optin); |
52 virtual ~SessionCrashedBubbleView(); | 52 virtual ~SessionCrashedBubbleView(); |
53 | 53 |
54 // Creates and shows the session crashed bubble, with |offer_uma_optin| | 54 // Creates and shows the session crashed bubble, with |uma_opted_in_already| |
55 // indicating whether the UMA opt-in checkbox should be shown. Called | 55 // indicating whether the user has already opted-in to UMA. It will be called |
56 // by Show after checking whether the UMA option should be presented and it | 56 // by Show. It takes ownership of |browser_observer|. |
57 // takes ownership of |browser_observer|. | |
58 static void ShowForReal(scoped_ptr<BrowserRemovalObserver> browser_observer, | 57 static void ShowForReal(scoped_ptr<BrowserRemovalObserver> browser_observer, |
59 bool offer_uma_optin); | 58 bool uma_opted_in_already); |
60 | 59 |
61 // WidgetDelegateView methods. | 60 // WidgetDelegateView methods. |
62 virtual views::View* GetInitiallyFocusedView() OVERRIDE; | 61 virtual views::View* GetInitiallyFocusedView() OVERRIDE; |
63 virtual base::string16 GetWindowTitle() const OVERRIDE; | 62 virtual base::string16 GetWindowTitle() const OVERRIDE; |
64 virtual bool ShouldShowWindowTitle() const OVERRIDE; | 63 virtual bool ShouldShowWindowTitle() const OVERRIDE; |
65 virtual bool ShouldShowCloseButton() const OVERRIDE; | 64 virtual bool ShouldShowCloseButton() const OVERRIDE; |
66 | 65 |
67 // views::BubbleDelegateView methods. | 66 // views::BubbleDelegateView methods. |
68 virtual void Init() OVERRIDE; | 67 virtual void Init() OVERRIDE; |
69 | 68 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // Whether or not the UMA opt-in option should be shown. | 126 // Whether or not the UMA opt-in option should be shown. |
128 bool offer_uma_optin_; | 127 bool offer_uma_optin_; |
129 | 128 |
130 // Whether or not a navigation has started on current tab. | 129 // Whether or not a navigation has started on current tab. |
131 bool started_navigation_; | 130 bool started_navigation_; |
132 | 131 |
133 DISALLOW_COPY_AND_ASSIGN(SessionCrashedBubbleView); | 132 DISALLOW_COPY_AND_ASSIGN(SessionCrashedBubbleView); |
134 }; | 133 }; |
135 | 134 |
136 #endif // CHROME_BROWSER_UI_VIEWS_SESSION_CRASHED_BUBBLE_VIEW_H_ | 135 #endif // CHROME_BROWSER_UI_VIEWS_SESSION_CRASHED_BUBBLE_VIEW_H_ |
OLD | NEW |