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

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

Issue 2866273003: [Android] Improve sad tab strings (Closed)
Patch Set: Remove extraneous line Created 3 years, 7 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/android/java/src/org/chromium/chrome/browser/tab/Tab.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
index ca98511f3688a325ce42876534608273994dc361..5420f5b893337e3772b1a222a6232cb19d4be99d 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
@@ -22,7 +22,6 @@ import android.text.TextUtils;
import android.util.Log;
import android.view.ContextThemeWrapper;
import android.view.View;
-import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
import android.widget.FrameLayout;
@@ -1695,9 +1694,13 @@ public class Tab
*/
protected void showSadTab() {
if (getContentViewCore() != null) {
- OnClickListener suggestionAction = new OnClickListener() {
+ // If the tab has crashed twice in a row change the sad tab view to the "Send Feedback"
+ // version and change the onClickListener.
+ final boolean showSendFeedbackView = mSadTabSuccessiveRefreshCounter >= 1;
+
+ Runnable suggestionAction = new Runnable() {
@Override
- public void onClick(View view) {
+ public void run() {
Activity activity = mWindowAndroid.getActivity().get();
assert activity != null;
HelpAndFeedback.getInstance(activity).show(activity,
@@ -1706,14 +1709,10 @@ public class Tab
}
};
- // If the tab has crashed twice in a row change the button to "Send Feedback" and
- // change the onClickListener.
- final boolean showSendFeedbackButton = mSadTabSuccessiveRefreshCounter >= 1;
- OnClickListener buttonAction = new OnClickListener() {
-
+ Runnable buttonAction = new Runnable() {
@Override
- public void onClick(View v) {
- if (showSendFeedbackButton) {
+ public void run() {
+ if (showSendFeedbackView) {
getActivity().startHelpAndFeedback(Tab.this, "MobileSadTabFeedback");
} else {
reload();
@@ -1725,8 +1724,7 @@ public class Tab
assert mSadTabView == null;
mSadTabView = SadTabViewFactory.createSadTabView(mThemedApplicationContext,
- suggestionAction, buttonAction, showSendFeedbackButton
- ? R.string.sad_tab_send_feedback_label : R.string.sad_tab_reload_label);
+ suggestionAction, buttonAction, showSendFeedbackView);
mSadTabSuccessiveRefreshCounter++;
// Show the sad tab inside ContentView.
getContentViewCore().getContainerView().addView(

Powered by Google App Engine
This is Rietveld 408576698