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

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

Issue 1558553002: Lo-Fi snackbar should only be shown for the first q=low response of a page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tbansal comments Created 4 years, 11 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 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).
*/

Powered by Google App Engine
This is Rietveld 408576698