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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java

Issue 1689973002: [Offline pages] Updating page info to explain offline pages properly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@omnibox-patch-1
Patch Set: Addressing feedback Created 4 years, 10 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/omnibox/LocationBarLayout.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java
index 2fdc26fcbb0ce2f420feacb9c11a890b72ae857f..9cf07f47317d78013aaa9b2421cd4ad806ca412a 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java
@@ -54,6 +54,7 @@ import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ListView;
+import android.widget.TextView;
import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.CollectionUtil;
@@ -147,6 +148,7 @@ public class LocationBarLayout extends FrameLayout implements OnClickListener,
protected ImageView mNavigationButton;
protected ImageButton mSecurityButton;
+ protected TextView mVerboseStatusTextView;
protected TintedImageButton mDeleteButton;
protected TintedImageButton mMicButton;
protected UrlBar mUrlBar;
@@ -680,6 +682,8 @@ public class LocationBarLayout extends FrameLayout implements OnClickListener,
mSecurityButton = (ImageButton) findViewById(R.id.security_button);
mSecurityIconType = ConnectionSecurityLevel.NONE;
+ mVerboseStatusTextView = (TextView) findViewById(R.id.location_bar_verbose_status);
+
mDeleteButton = (TintedImageButton) findViewById(R.id.delete_button);
mUrlBar = (UrlBar) findViewById(R.id.url_bar);
@@ -823,6 +827,7 @@ public class LocationBarLayout extends FrameLayout implements OnClickListener,
mSecurityButton.setOnClickListener(this);
mNavigationButton.setOnClickListener(this);
+ mVerboseStatusTextView.setOnClickListener(this);
updateMicButtonState();
mDeleteButton.setOnClickListener(this);
mMicButton.setOnClickListener(this);
@@ -1310,7 +1315,7 @@ public class LocationBarLayout extends FrameLayout implements OnClickListener,
boolean verboseStatusVisible =
mNavigationButtonType == NavigationButtonType.OFFLINE && !mUrlHasFocus;
int verboseStatusVisibility = verboseStatusVisible ? VISIBLE : GONE;
- findViewById(R.id.location_bar_verbose_status).setVisibility(verboseStatusVisibility);
+ mVerboseStatusTextView.setVisibility(verboseStatusVisibility);
findViewById(R.id.location_bar_verbose_status_separator)
.setVisibility(verboseStatusVisibility);
findViewById(R.id.location_bar_verbose_status_extra_space)
@@ -1748,11 +1753,11 @@ public class LocationBarLayout extends FrameLayout implements OnClickListener,
}
/**
- * Whether {@code v} is a location icon which can be clicked to show the
- * origin info dialog.
+ * Whether {@code v} is a view (location icon, verbose status, ...) which can be clicked to
+ * show the origin info dialog.
*/
- private boolean isLocationIcon(View v) {
- return v == mSecurityButton || v == mNavigationButton;
+ private boolean shouldShowPageInfoForView(View v) {
+ return v == mSecurityButton || v == mNavigationButton || v == mVerboseStatusTextView;
}
@Override
@@ -1765,13 +1770,12 @@ public class LocationBarLayout extends FrameLayout implements OnClickListener,
startZeroSuggest();
return;
- } else if (!mUrlHasFocus && isLocationIcon(v)) {
+ } else if (!mUrlHasFocus && shouldShowPageInfoForView(v)) {
Tab currentTab = getCurrentTab();
if (currentTab != null && currentTab.getWebContents() != null) {
Activity activity = currentTab.getWindowAndroid().getActivity().get();
if (activity != null) {
- WebsiteSettingsPopup.show(activity, currentTab.getProfile(),
- currentTab.getWebContents());
+ WebsiteSettingsPopup.show(activity, currentTab);
}
}
} else if (v == mMicButton) {

Powered by Google App Engine
This is Rietveld 408576698