Chromium Code Reviews| 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> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 bool offer_uma_optin); | 55 bool offer_uma_optin); |
| 56 ~SessionCrashedBubbleView() override; | 56 ~SessionCrashedBubbleView() override; |
| 57 | 57 |
| 58 // WidgetDelegateView methods. | 58 // WidgetDelegateView methods. |
| 59 base::string16 GetWindowTitle() const override; | 59 base::string16 GetWindowTitle() const override; |
| 60 bool ShouldShowWindowTitle() const override; | 60 bool ShouldShowWindowTitle() const override; |
| 61 bool ShouldShowCloseButton() const override; | 61 bool ShouldShowCloseButton() const override; |
| 62 void OnWidgetDestroying(views::Widget* widget) override; | 62 void OnWidgetDestroying(views::Widget* widget) override; |
| 63 views::View* CreateFootnoteView() override; | 63 views::View* CreateFootnoteView() override; |
| 64 bool Accept() override; | 64 bool Accept() override; |
| 65 bool Cancel() override; | |
| 65 bool Close() override; | 66 bool Close() override; |
| 66 int GetDialogButtons() const override; | 67 int GetDialogButtons() const override; |
| 67 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | 68 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; |
| 68 | 69 |
| 69 // views::BubbleDialogDelegateView methods. | 70 // views::BubbleDialogDelegateView methods. |
| 70 void Init() override; | 71 void Init() override; |
| 71 | 72 |
| 72 // views::StyledLabelListener methods. | 73 // views::StyledLabelListener methods. |
| 73 void StyledLabelLinkClicked(views::StyledLabel* label, | 74 void StyledLabelLinkClicked(views::StyledLabel* label, |
| 74 const gfx::Range& range, | 75 const gfx::Range& range, |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 87 | 88 |
| 88 // TabStripModelObserver methods. | 89 // TabStripModelObserver methods. |
| 89 // When the tab with current bubble is being dragged and dropped to a new | 90 // When the tab with current bubble is being dragged and dropped to a new |
| 90 // window or to another window, the bubble will be dismissed as if the user | 91 // window or to another window, the bubble will be dismissed as if the user |
| 91 // chose not to restore the previous session. | 92 // chose not to restore the previous session. |
| 92 void TabDetachedAt(content::WebContents* contents, int index) override; | 93 void TabDetachedAt(content::WebContents* contents, int index) override; |
| 93 | 94 |
| 94 // Restore previous session after user selects so. | 95 // Restore previous session after user selects so. |
| 95 void RestorePreviousSession(); | 96 void RestorePreviousSession(); |
| 96 | 97 |
| 98 // Open startup pages after user selects so. | |
| 99 void OpenStartupPages(); | |
| 100 | |
| 101 // Enable UMA if the user accepted the offer. | |
| 102 void MaybeEnableUMA(); | |
| 103 | |
| 97 // Close and destroy the bubble. | 104 // Close and destroy the bubble. |
| 98 void CloseBubble(); | 105 void CloseBubble(); |
| 99 | 106 |
| 100 content::NotificationRegistrar registrar_; | 107 content::NotificationRegistrar registrar_; |
| 101 | 108 |
| 102 // Used for opening the question mark link as well as access the tab strip. | 109 // Used for opening the question mark link as well as access the tab strip. |
| 103 Browser* browser_; | 110 Browser* browser_; |
| 104 | 111 |
| 105 // The web content associated with current bubble. | 112 // The web content associated with current bubble. |
| 106 content::WebContents* web_contents_; | 113 content::WebContents* web_contents_; |
| 107 | 114 |
| 108 // Checkbox for the user to opt-in to UMA reporting. | 115 // Checkbox for the user to opt-in to UMA reporting. |
| 109 views::Checkbox* uma_option_; | 116 views::Checkbox* uma_option_; |
| 110 | 117 |
| 111 // Whether or not the UMA opt-in option should be shown. | 118 // Whether or not the UMA opt-in option should be shown. |
| 112 bool offer_uma_optin_; | 119 bool offer_uma_optin_; |
| 113 | 120 |
| 114 // Whether or not the first navigation was ignored. This is needed because the | 121 // Whether or not the first navigation was ignored. This is needed because the |
| 115 // bubble shouldn't go away when the new tab page loads after a crash. | 122 // bubble shouldn't go away when the new tab page loads after a crash. |
| 116 bool first_navigation_ignored_; | 123 bool first_navigation_ignored_; |
| 117 | 124 |
| 118 // Whether or not the user chose to restore previous session. It is used to | 125 // Whether or not the user chose to restore previous session. It is used to |
| 119 // collect bubble usage stats. | 126 // collect bubble usage stats. |
| 120 bool restored_; | 127 bool restored_; |
| 121 | 128 |
| 129 // Whether or not the user chose to open the startup pages. It is used to | |
| 130 // collect bubble usage stats. | |
| 131 bool startup_pages_; | |
|
sky
2017/01/24 23:00:40
As you can't both restore and click startup pages
MAD
2017/01/25 19:48:53
Actually, we don't need to differentiate them, so
| |
| 132 | |
| 122 DISALLOW_COPY_AND_ASSIGN(SessionCrashedBubbleView); | 133 DISALLOW_COPY_AND_ASSIGN(SessionCrashedBubbleView); |
| 123 }; | 134 }; |
| 124 | 135 |
| 125 #endif // CHROME_BROWSER_UI_VIEWS_SESSION_CRASHED_BUBBLE_VIEW_H_ | 136 #endif // CHROME_BROWSER_UI_VIEWS_SESSION_CRASHED_BUBBLE_VIEW_H_ |
| OLD | NEW |