Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java b/chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java |
| index 599420e66c5c93ccda9ed5e96fe0f6aaaff0a705..717ed67b2f025339f72aec3d803f0a272fcd244d 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java |
| @@ -383,6 +383,7 @@ public class WebsiteSettingsPopup implements OnClickListener, OnItemSelectedList |
| // Set the URL connection message now, and the URL after layout (so it |
| // can calculate its ideal height). |
| mUrlConnectionMessage.setText(getUrlConnectionMessage()); |
| + if (isConnectionDetailsLinkVisible()) mUrlConnectionMessage.setOnClickListener(this); |
| } |
| /** |
| @@ -454,6 +455,14 @@ public class WebsiteSettingsPopup implements OnClickListener, OnItemSelectedList |
| } |
| /** |
| + * Whether to show a 'Details' link to the connection info popup. The link is only shown for |
| + * HTTPS connections. |
| + */ |
| + private boolean isConnectionDetailsLinkVisible() { |
| + return !mIsInternalPage && mSecurityLevel != ToolbarModelSecurityLevel.NONE; |
| + } |
| + |
| + /** |
| * Gets the styled connection message to display below the URL. |
| */ |
| private Spannable getUrlConnectionMessage() { |
| @@ -488,6 +497,18 @@ public class WebsiteSettingsPopup implements OnClickListener, OnItemSelectedList |
| messageBuilder.setSpan(boldSpan, 0, leadingText.length(), |
| Spannable.SPAN_INCLUSIVE_EXCLUSIVE); |
| } |
| + |
| + if (isConnectionDetailsLinkVisible()) { |
| + String detailsText = mContext.getResources().getString(R.string.page_info_details_link); |
| + messageBuilder.append(" "); |
|
Ted C
2015/04/27 19:04:01
I "assume" this is fine since we do similar things
|
| + int start = messageBuilder.length(); |
| + messageBuilder.append(detailsText); |
| + final ForegroundColorSpan blueSpan = new ForegroundColorSpan( |
| + mContext.getResources().getColor(R.color.website_settings_popup_text_link)); |
|
Ted C
2015/04/27 19:04:01
can the span not be applied prior to appending the
tsergeant
2015/04/28 03:15:00
Done.
|
| + messageBuilder.setSpan( |
| + blueSpan, start, messageBuilder.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE); |
| + } |
| + |
| return messageBuilder; |
| } |
| @@ -609,6 +630,19 @@ public class WebsiteSettingsPopup implements OnClickListener, OnItemSelectedList |
| } else if (view == mUrlTitle) { |
| // Expand/collapse the displayed URL title. |
| mUrlTitle.toggleTruncation(); |
| + } else if (view == mUrlConnectionMessage) { |
| + if (DeviceFormFactor.isTablet(mContext)) { |
| + ConnectionInfoPopup.show(mContext, mWebContents); |
| + } else { |
| + // Delay while the WebsiteSettingsPopup closes. |
| + mContainer.postDelayed(new Runnable() { |
| + @Override |
| + public void run() { |
| + ConnectionInfoPopup.show(mContext, mWebContents); |
| + } |
| + }, FADE_DURATION + CLOSE_CLEANUP_DELAY); |
| + } |
| + mDialog.dismiss(); |
| } |
| } |