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

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: Ditch a pointless |explicit|, add a comment on SadTabView ownership. Created 4 years, 4 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
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..fee977fca727b1b8f78257c7f73d21cb50d72b13 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,29 @@ class SadTab {
virtual ~SadTab() {}
- // Shows the Sad tab.
- virtual void Show() = 0;
+ int GetTitle();
James Cook 2016/09/08 20:15:50 nit: Document these functions, especially what the
Sidney San Martín 2016/09/09 01:36:00 Done, let me know how these comments look.
James Cook 2016/09/09 04:37:09 Very helpful, especially the note that they vary.
+ int GetMessage();
+ int GetButtonTitle();
+ int GetHelpLinkTitle();
+ 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 want_feedback_;
James Cook 2016/09/08 20:15:50 nit: Document and/or rename. Who wants feedback ab
Sidney San Martín 2016/09/09 01:36:00 We, the developers, want feedback about what cause
+
+#if DCHECK_IS_ON()
James Cook 2016/09/08 20:15:50 Does this need #if guards? Is it for unused variab
Sidney San Martín 2016/09/09 01:36:00 Huh, I thought it improved readability: you're all
James Cook 2016/09/09 04:37:09 I found it harder to read. Frankly, I've been in t
Sidney San Martín 2016/09/09 15:39:44 Done. I also find it strange that this is a macro
Sidney San Martín 2016/09/09 15:39:44 Done. recorded_paint_ always starts false, and sho
Nico 2016/09/09 15:45:30 FWIW this is because if it were a macro and you fo
Sidney San Martín 2016/09/09 15:47:18 Ah, thanks. That makes sense.
+ bool recorded_paint_ = false;
+#endif
- // Closes the Sad tab.
- virtual void Close() = 0;
+ DISALLOW_COPY_AND_ASSIGN(SadTab);
};
} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698