Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1280)

Unified Diff: chrome/browser/ui/sad_tab.h

Issue 2261793002: Bring the feedback button to the Mac sad tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Address second wave of comments, turn off feedback in non-Chrome builds Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/tab_contents/sad_tab_view_cocoa_unittest.mm ('k') | chrome/browser/ui/sad_tab.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/sad_tab.h
diff --git a/chrome/browser/ui/sad_tab.h b/chrome/browser/ui/sad_tab.h
index e22b14948072cf051583412bce85faf415b8bf81..28698d0a78a3ef905a2c0602796a6f670d4fc728 100644
--- a/chrome/browser/ui/sad_tab.h
+++ b/chrome/browser/ui/sad_tab.h
@@ -17,6 +17,11 @@ namespace chrome {
// Cross-platform interface to show the Sad tab UI.
class SadTab {
public:
+ enum class Action {
+ BUTTON,
+ HELP_LINK,
+ };
+
// Factory function to create the platform specific implementations.
static SadTab* Create(content::WebContents* web_contents, SadTabKind kind);
@@ -25,11 +30,32 @@ class SadTab {
virtual ~SadTab() {}
- // Shows the Sad tab.
- virtual void Show() = 0;
+ // These functions return resource string IDs for UI text. They may be
+ // different for each sad tab. (Right now, the first sad tab in a session
+ // suggests reloading and subsequent ones suggest sending feedback.)
+ int GetTitle();
+ int GetMessage();
+ int GetButtonTitle();
+ int GetHelpLinkTitle();
+
+ // Returns the target of the "Learn more" link. Use it for the context menu
+ // and to show the URL on hover, but call PerformAction() for regular clicks.
+ const char* GetHelpLinkURL();
+
+ // Virtual for testing.
+ virtual void RecordFirstPaint();
+ virtual void PerformAction(Action);
+
+ protected:
+ SadTab(content::WebContents* web_contents, SadTabKind kind);
+
+ private:
+ content::WebContents* web_contents_;
+ SadTabKind kind_;
+ bool show_feedback_button_;
+ bool recorded_paint_;
- // Closes the Sad tab.
- virtual void Close() = 0;
+ DISALLOW_COPY_AND_ASSIGN(SadTab);
};
} // namespace chrome
« no previous file with comments | « chrome/browser/ui/cocoa/tab_contents/sad_tab_view_cocoa_unittest.mm ('k') | chrome/browser/ui/sad_tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698