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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/tab/SadTabViewFactory.java

Issue 2534333002: Show 'Send Feedback' button on the sad tab page on multiple failures (Closed)
Patch Set: Created 4 years 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/android/java/src/org/chromium/chrome/browser/tab/SadTabViewFactory.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/SadTabViewFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/SadTabViewFactory.java
index 704b8e18f403dda16266a2a405a7257c5a871d31..97ad3370ad6ce69bdcfab5b253edf998f4fc1881 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/tab/SadTabViewFactory.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/SadTabViewFactory.java
@@ -21,16 +21,32 @@ import org.chromium.ui.text.SpanApplier.SpanInfo;
* A factory class for creating the "Sad Tab" view, which is shown in place of a crashed renderer.
*/
public class SadTabViewFactory {
+
+ /**
+ * A shortcut method to
+ * {@link #createSadTabView(Context, OnClickListener, OnClickListener, String)}
+ * where the button text is the default label from
+ * {@code R.string.sad_tab_reload_label}
+ */
+ public static View createSadTabView(
Theresa 2016/11/30 19:42:38 In the current code base #createSadTabView() is on
JJ 2016/11/30 23:55:53 Nowhere else since I changed the method.. I'll go
+ Context context, final OnClickListener suggestionAction,
+ OnClickListener reloadButtonAction) {
+
+ return createSadTabView(context, suggestionAction, reloadButtonAction,
+ context.getString(R.string.sad_tab_reload_label));
+ }
+
/**
* @param context Context of the resulting Sad Tab view.
* @param suggestionAction Action to be executed when user clicks "try these suggestions".
* @param reloadButtonAction Action to be executed when Reload button is pressed.
* (e.g., refreshing the page)
+ * @param buttonText The label for the "reloadButton"
Theresa 2016/11/30 19:42:38 nit: add a period at the end of this description.
JJ 2016/11/30 23:55:53 Done.
* @return A "Sad Tab" view instance which is used in place of a crashed renderer.
*/
public static View createSadTabView(
Context context, final OnClickListener suggestionAction,
- OnClickListener reloadButtonAction) {
+ OnClickListener reloadButtonAction, String buttonText) {
Theresa 2016/11/30 19:42:38 Since this already takes the context, it could jus
JJ 2016/11/30 23:55:53 Done.
// Inflate Sad tab and initialize.
LayoutInflater inflater = (LayoutInflater) context.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
@@ -41,6 +57,7 @@ public class SadTabViewFactory {
messageText.setMovementMethod(LinkMovementMethod.getInstance());
Button reloadButton = (Button) sadTabView.findViewById(R.id.sad_tab_reload_button);
+ reloadButton.setText(buttonText);
reloadButton.setOnClickListener(reloadButtonAction);
return sadTabView;

Powered by Google App Engine
This is Rietveld 408576698