| 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 <memory> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "chrome/browser/ui/session_crashed_bubble.h" | 11 #include "chrome/browser/ui/session_crashed_bubble.h" |
| 11 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 12 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
| 12 #include "content/public/browser/notification_observer.h" | 13 #include "content/public/browser/notification_observer.h" |
| 13 #include "content/public/browser/notification_registrar.h" | 14 #include "content/public/browser/notification_registrar.h" |
| 14 #include "content/public/browser/web_contents_observer.h" | 15 #include "content/public/browser/web_contents_observer.h" |
| 15 #include "ui/views/bubble/bubble_dialog_delegate.h" | 16 #include "ui/views/bubble/bubble_dialog_delegate.h" |
| 16 #include "ui/views/controls/styled_label_listener.h" | 17 #include "ui/views/controls/styled_label_listener.h" |
| 17 | 18 |
| 18 namespace views { | 19 namespace views { |
| 19 class Checkbox; | 20 class Checkbox; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 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 // A helper class that listens to browser removal event. | 42 // A helper class that listens to browser removal event. |
| 42 class BrowserRemovalObserver; | 43 class BrowserRemovalObserver; |
| 43 | 44 |
| 44 // Creates and shows the session crashed bubble, with |uma_opted_in_already| | 45 // Creates and shows the session crashed bubble, with |uma_opted_in_already| |
| 45 // indicating whether the user has already opted-in to UMA. It will be called | 46 // indicating whether the user has already opted-in to UMA. It will be called |
| 46 // by Show. It takes ownership of |browser_observer|. | 47 // by Show. It takes ownership of |browser_observer|. |
| 47 static void ShowForReal(scoped_ptr<BrowserRemovalObserver> browser_observer, | 48 static void ShowForReal( |
| 48 bool uma_opted_in_already); | 49 std::unique_ptr<BrowserRemovalObserver> browser_observer, |
| 50 bool uma_opted_in_already); |
| 49 | 51 |
| 50 private: | 52 private: |
| 51 SessionCrashedBubbleView(views::View* anchor_view, | 53 SessionCrashedBubbleView(views::View* anchor_view, |
| 52 Browser* browser, | 54 Browser* browser, |
| 53 content::WebContents* web_contents, | 55 content::WebContents* web_contents, |
| 54 bool offer_uma_optin); | 56 bool offer_uma_optin); |
| 55 ~SessionCrashedBubbleView() override; | 57 ~SessionCrashedBubbleView() override; |
| 56 | 58 |
| 57 // WidgetDelegateView methods. | 59 // WidgetDelegateView methods. |
| 58 base::string16 GetWindowTitle() const override; | 60 base::string16 GetWindowTitle() const override; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 bool started_navigation_; | 119 bool started_navigation_; |
| 118 | 120 |
| 119 // Whether or not the user chose to restore previous session. It is used to | 121 // Whether or not the user chose to restore previous session. It is used to |
| 120 // collect bubble usage stats. | 122 // collect bubble usage stats. |
| 121 bool restored_; | 123 bool restored_; |
| 122 | 124 |
| 123 DISALLOW_COPY_AND_ASSIGN(SessionCrashedBubbleView); | 125 DISALLOW_COPY_AND_ASSIGN(SessionCrashedBubbleView); |
| 124 }; | 126 }; |
| 125 | 127 |
| 126 #endif // CHROME_BROWSER_UI_VIEWS_SESSION_CRASHED_BUBBLE_VIEW_H_ | 128 #endif // CHROME_BROWSER_UI_VIEWS_SESSION_CRASHED_BUBBLE_VIEW_H_ |
| OLD | NEW |