Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_SAD_TAB_H_ | 5 #ifndef CHROME_BROWSER_UI_SAD_TAB_H_ |
| 6 #define CHROME_BROWSER_UI_SAD_TAB_H_ | 6 #define CHROME_BROWSER_UI_SAD_TAB_H_ |
| 7 | 7 |
| 8 #include "base/process/kill.h" | 8 #include "base/process/kill.h" |
| 9 #include "chrome/browser/ui/sad_tab_types.h" | 9 #include "chrome/browser/ui/sad_tab_types.h" |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 virtual ~SadTab() {} | 31 virtual ~SadTab() {} |
| 32 | 32 |
| 33 // These functions return resource string IDs for UI text. They may be | 33 // These functions return resource string IDs for UI text. They may be |
| 34 // different for each sad tab. (Right now, the first sad tab in a session | 34 // different for each sad tab. (Right now, the first sad tab in a session |
| 35 // suggests reloading and subsequent ones suggest sending feedback.) | 35 // suggests reloading and subsequent ones suggest sending feedback.) |
| 36 int GetTitle(); | 36 int GetTitle(); |
| 37 int GetMessage(); | 37 int GetMessage(); |
| 38 int GetButtonTitle(); | 38 int GetButtonTitle(); |
| 39 int GetHelpLinkTitle(); | 39 int GetHelpLinkTitle(); |
| 40 | 40 |
| 41 // Returns the resource string Id for bullet point |bullet_id| or 0 if no | |
| 42 // bullet should be added for the |bullet_id|. Bullet ids count from 0. | |
| 43 int GetBulletText(size_t bullet_id); | |
|
sky
2017/05/14 13:46:16
optional: consider naming this Submessage. While t
Will Harris
2017/05/17 18:25:19
Done.
| |
| 44 | |
| 41 // Returns the target of the "Learn more" link. Use it for the context menu | 45 // Returns the target of the "Learn more" link. Use it for the context menu |
| 42 // and to show the URL on hover, but call PerformAction() for regular clicks. | 46 // and to show the URL on hover, but call PerformAction() for regular clicks. |
| 43 const char* GetHelpLinkURL(); | 47 const char* GetHelpLinkURL(); |
| 44 | 48 |
| 45 // Virtual for testing. | 49 // Virtual for testing. |
| 46 virtual void RecordFirstPaint(); | 50 virtual void RecordFirstPaint(); |
| 47 virtual void PerformAction(Action); | 51 virtual void PerformAction(Action); |
| 48 | 52 |
| 49 protected: | 53 protected: |
| 50 SadTab(content::WebContents* web_contents, SadTabKind kind); | 54 SadTab(content::WebContents* web_contents, SadTabKind kind); |
| 51 | 55 |
| 52 private: | 56 private: |
| 53 content::WebContents* web_contents_; | 57 content::WebContents* web_contents_; |
| 54 SadTabKind kind_; | 58 SadTabKind kind_; |
| 55 bool show_feedback_button_; | 59 bool show_feedback_button_; |
| 56 bool recorded_paint_; | 60 bool recorded_paint_; |
| 61 bool other_tabs_open_; | |
|
sky
2017/05/14 13:46:16
Please add description. AFAICT this is always true
Will Harris
2017/05/17 18:25:19
I removed this and now actually detect other tabs
| |
| 57 | 62 |
| 58 DISALLOW_COPY_AND_ASSIGN(SadTab); | 63 DISALLOW_COPY_AND_ASSIGN(SadTab); |
| 59 }; | 64 }; |
| 60 | 65 |
| 61 } // namespace chrome | 66 } // namespace chrome |
| 62 | 67 |
| 63 #endif // CHROME_BROWSER_UI_SAD_TAB_H_ | 68 #endif // CHROME_BROWSER_UI_SAD_TAB_H_ |
| OLD | NEW |