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 a9931a7f17a5b4f3a42498e950e3837675632d2b..ff6d2998d0471974490d4390d9f02f381774ed53 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 |
@@ -360,6 +360,8 @@ public final class Tab implements ViewGroup.OnHierarchyChangeListener, |
protected Handler mHandler; |
+ private boolean mLoFiPopupShownForPageLoad = false; |
+ |
private class TabContentViewClient extends ContentViewClient { |
@Override |
public void onBackgroundColorChanged(int color) { |
@@ -1413,6 +1415,8 @@ public final class Tab implements ViewGroup.OnHierarchyChangeListener, |
mIsShowingErrorPage = showingErrorPage; |
+ mLoFiPopupShownForPageLoad = false; |
+ |
updateTitle(); |
removeSadTabIfPresent(); |
@@ -2581,6 +2585,17 @@ public final class Tab implements ViewGroup.OnHierarchyChangeListener, |
} |
/** |
+ * If a Lo-Fi snackbar has not been shown yet for this page load, a Lo-Fi snackbar is shown. |
+ */ |
+ @CalledByNative |
+ public void notifyLoFiResponseReceived() { |
+ if (!mLoFiPopupShownForPageLoad) { |
+ mLoFiPopupShownForPageLoad = true; |
+ mActivity.showLoFiPopup(this); |
+ } |
+ } |
+ |
+ /** |
* Request that this tab receive focus. Currently, this function requests focus for the main |
* View (usually a ContentView). |
*/ |