Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/pageinfo/WebsiteSettingsPopup.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/pageinfo/WebsiteSettingsPopup.java b/chrome/android/java/src/org/chromium/chrome/browser/pageinfo/WebsiteSettingsPopup.java |
| index b081c126f85fa4c81ad5d17fe489a88e0d7bb242..217ab529b7002ffcfd723b56a07df7341255b509 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/pageinfo/WebsiteSettingsPopup.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/pageinfo/WebsiteSettingsPopup.java |
| @@ -288,9 +288,6 @@ public class WebsiteSettingsPopup implements OnClickListener { |
| // Permissions available to be displayed in mPermissionsList. |
| private List<PageInfoPermissionEntry> mDisplayedPermissions; |
| - // Original URL of an offline copy, if web contents contains an offline page. |
| - private String mOfflinePageOriginalUrl; |
| - |
| // Creation date of an offline copy, if web contents contains an offline page. |
| private String mOfflinePageCreationDate; |
| @@ -305,12 +302,11 @@ public class WebsiteSettingsPopup implements OnClickListener { |
| * @param publisher The name of the content publisher, if any. |
| */ |
| private WebsiteSettingsPopup(Activity activity, Profile profile, WebContents webContents, |
|
Dmitry Titov
2016/08/20 01:08:14
While editing signature of the method, could you u
jianli
2016/08/20 01:48:52
Done.
|
| - String offlinePageOriginalUrl, String offlinePageCreationDate, String publisher) { |
| + String offlinePageCreationDate, String publisher) { |
| mContext = activity; |
| mProfile = profile; |
| mWebContents = webContents; |
| - if (offlinePageOriginalUrl != null && offlinePageCreationDate != null) { |
| - mOfflinePageOriginalUrl = offlinePageOriginalUrl; |
| + if (offlinePageCreationDate != null) { |
| mOfflinePageCreationDate = offlinePageCreationDate; |
| } |
| mWindowAndroid = ContentViewCore.fromWebContents(mWebContents).getWindowAndroid(); |
| @@ -433,14 +429,12 @@ public class WebsiteSettingsPopup implements OnClickListener { |
| }); |
| // Work out the URL and connection message and status visibility. |
| - int statusIconVisibility = View.GONE; |
| + mFullUrl = mWebContents.getVisibleUrl(); |
| if (isShowingOfflinePage()) { |
| - mFullUrl = mOfflinePageOriginalUrl; |
| - statusIconVisibility = View.VISIBLE; |
| - } else { |
| - mFullUrl = mWebContents.getVisibleUrl(); |
| + mFullUrl = OfflinePageUtils.stripSchemeFromOnlineUrl(mFullUrl); |
| } |
| + int statusIconVisibility = isShowingOfflinePage() ? View.VISIBLE : View.GONE; |
| mContainer.findViewById(R.id.offline_icon).setVisibility(statusIconVisibility); |
| try { |
| @@ -908,7 +902,7 @@ public class WebsiteSettingsPopup implements OnClickListener { |
| * Whether website dialog is displayed for an offline page. |
| */ |
| private boolean isShowingOfflinePage() { |
| - return mOfflinePageOriginalUrl != null && mOfflinePageCreationDate != null; |
| + return mOfflinePageCreationDate != null; |
| } |
| /** |
| @@ -931,7 +925,6 @@ public class WebsiteSettingsPopup implements OnClickListener { |
| assert false : "Invalid source passed"; |
| } |
| - String offlinePageOriginalUrl = null; |
| String offlinePageCreationDate = null; |
| OfflinePageItem offlinePage = tab.getOfflinePage(); |
| @@ -940,12 +933,10 @@ public class WebsiteSettingsPopup implements OnClickListener { |
| Date creationDate = new Date(offlinePage.getCreationTimeMs()); |
| DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM); |
| offlinePageCreationDate = df.format(creationDate); |
| - offlinePageOriginalUrl = OfflinePageUtils.stripSchemeFromOnlineUrl( |
| - offlinePage.getUrl()); |
| } |
| new WebsiteSettingsPopup(activity, tab.getProfile(), tab.getWebContents(), |
| - offlinePageOriginalUrl, offlinePageCreationDate, contentPublisher); |
| + offlinePageCreationDate, contentPublisher); |
| } |
| private static native long nativeInit(WebsiteSettingsPopup popup, WebContents webContents); |