Index: chrome/android/java/src/org/chromium/chrome/browser/page_info/PageInfoPopup.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/page_info/WebsiteSettingsPopup.java b/chrome/android/java/src/org/chromium/chrome/browser/page_info/PageInfoPopup.java |
similarity index 93% |
rename from chrome/android/java/src/org/chromium/chrome/browser/page_info/WebsiteSettingsPopup.java |
rename to chrome/android/java/src/org/chromium/chrome/browser/page_info/PageInfoPopup.java |
index e82ad2145da3084374eb1c8207a7d68083a25a65..155ef9635ffe0424206d010055fd518a9e6bcada 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/page_info/WebsiteSettingsPopup.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/page_info/PageInfoPopup.java |
@@ -86,11 +86,9 @@ import java.util.Date; |
import java.util.List; |
/** |
- * Java side of Android implementation of the website settings UI. |
- * TODO(sashab): Rename this, and all its resources, to PageInfo* and page_info_* instead of |
- * WebsiteSettings* and website_settings_*. Do this on the C++ side as well. |
+ * Java side of Android implementation of the page info UI. |
*/ |
-public class WebsiteSettingsPopup implements OnClickListener { |
+public class PageInfoPopup implements OnClickListener { |
@Retention(RetentionPolicy.SOURCE) |
@IntDef({OPENED_FROM_MENU, OPENED_FROM_TOOLBAR}) |
private @interface OpenedFromSource {} |
@@ -247,9 +245,9 @@ public class WebsiteSettingsPopup implements OnClickListener { |
private final Tab mTab; |
// A pointer to the C++ object for this UI. |
- private long mNativeWebsiteSettingsPopup; |
+ private long mNativePageInfoPopup; |
- // The outer container, filled with the layout from website_settings.xml. |
+ // The outer container, filled with the layout from page_info.xml. |
private final LinearLayout mContainer; |
// UI elements in the dialog. |
@@ -297,14 +295,14 @@ public class WebsiteSettingsPopup implements OnClickListener { |
private Intent mInstantAppIntent; |
/** |
- * Creates the WebsiteSettingsPopup, but does not display it. Also initializes the corresponding |
+ * Creates the PageInfoPopup, but does not display it. Also initializes the corresponding |
* C++ object and saves a pointer to it. |
* @param activity Activity which is used for showing a popup. |
* @param tab Tab for which the pop up is shown. |
* @param offlinePageCreationDate Date when the offline page was created. |
* @param publisher The name of the content publisher, if any. |
*/ |
- private WebsiteSettingsPopup(Activity activity, Tab tab, String offlinePageCreationDate, |
+ private PageInfoPopup(Activity activity, Tab tab, String offlinePageCreationDate, |
String publisher) { |
mContext = activity; |
mTab = tab; |
@@ -316,7 +314,7 @@ public class WebsiteSettingsPopup implements OnClickListener { |
// Find the container and all it's important subviews. |
mContainer = (LinearLayout) LayoutInflater.from(mContext).inflate( |
- R.layout.website_settings, null); |
+ R.layout.page_info, null); |
mContainer.setVisibility(View.INVISIBLE); |
mContainer.addOnLayoutChangeListener(new View.OnLayoutChangeListener() { |
@Override |
@@ -330,7 +328,7 @@ public class WebsiteSettingsPopup implements OnClickListener { |
} |
}); |
- mUrlTitle = (ElidedUrlTextView) mContainer.findViewById(R.id.website_settings_url); |
+ mUrlTitle = (ElidedUrlTextView) mContainer.findViewById(R.id.page_info_url); |
mUrlTitle.setProfile(mTab.getProfile()); |
mUrlTitle.setOnClickListener(this); |
// Long press the url text to copy it to the clipboard. |
@@ -347,22 +345,22 @@ public class WebsiteSettingsPopup implements OnClickListener { |
}); |
mConnectionSummary = (TextView) mContainer |
- .findViewById(R.id.website_settings_connection_summary); |
+ .findViewById(R.id.page_info_connection_summary); |
mConnectionMessage = (TextView) mContainer |
- .findViewById(R.id.website_settings_connection_message); |
+ .findViewById(R.id.page_info_connection_message); |
mPermissionsList = (LinearLayout) mContainer |
- .findViewById(R.id.website_settings_permissions_list); |
+ .findViewById(R.id.page_info_permissions_list); |
mInstantAppButton = |
- (Button) mContainer.findViewById(R.id.website_settings_instant_app_button); |
+ (Button) mContainer.findViewById(R.id.page_info_instant_app_button); |
mInstantAppButton.setOnClickListener(this); |
mSiteSettingsButton = |
- (Button) mContainer.findViewById(R.id.website_settings_site_settings_button); |
+ (Button) mContainer.findViewById(R.id.page_info_site_settings_button); |
mSiteSettingsButton.setOnClickListener(this); |
mOpenOnlineButton = |
- (Button) mContainer.findViewById(R.id.website_settings_open_online_button); |
+ (Button) mContainer.findViewById(R.id.page_info_open_online_button); |
mOpenOnlineButton.setOnClickListener(this); |
mDisplayedPermissions = new ArrayList<PageInfoPermissionEntry>(); |
@@ -451,7 +449,7 @@ public class WebsiteSettingsPopup implements OnClickListener { |
} |
// This needs to come after other member initialization. |
- mNativeWebsiteSettingsPopup = nativeInit(this, mTab.getWebContents()); |
+ mNativePageInfoPopup = nativeInit(this, mTab.getWebContents()); |
final WebContentsObserver webContentsObserver = |
new WebContentsObserver(mTab.getWebContents()) { |
@Override |
@@ -480,10 +478,10 @@ public class WebsiteSettingsPopup implements OnClickListener { |
mDialog.setOnDismissListener(new DialogInterface.OnDismissListener() { |
@Override |
public void onDismiss(DialogInterface dialog) { |
- assert mNativeWebsiteSettingsPopup != 0; |
+ assert mNativePageInfoPopup != 0; |
webContentsObserver.destroy(); |
- nativeDestroy(mNativeWebsiteSettingsPopup); |
- mNativeWebsiteSettingsPopup = 0; |
+ nativeDestroy(mNativePageInfoPopup); |
+ mNativePageInfoPopup = 0; |
} |
}); |
@@ -564,10 +562,10 @@ public class WebsiteSettingsPopup implements OnClickListener { |
private void addReadOnlyPermissionSection(PageInfoPermissionEntry permission) { |
View permissionRow = LayoutInflater.from(mContext).inflate( |
- R.layout.website_settings_permission_row, null); |
+ R.layout.page_info_permission_row, null); |
ImageView permissionIcon = (ImageView) permissionRow.findViewById( |
- R.id.website_settings_permission_icon); |
+ R.id.page_info_permission_icon); |
permissionIcon.setImageResource(getImageResourceForPermission(permission.type)); |
if (permission.setting == ContentSetting.ALLOW) { |
@@ -589,20 +587,20 @@ public class WebsiteSettingsPopup implements OnClickListener { |
if (warningTextResource != 0) { |
TextView permissionUnavailable = (TextView) permissionRow.findViewById( |
- R.id.website_settings_permission_unavailable_message); |
+ R.id.page_info_permission_unavailable_message); |
permissionUnavailable.setVisibility(View.VISIBLE); |
permissionUnavailable.setText(warningTextResource); |
permissionIcon.setImageResource(R.drawable.exclamation_triangle); |
permissionIcon.setColorFilter(ApiCompatibilityUtils.getColor( |
- mContext.getResources(), R.color.website_settings_popup_text_link)); |
+ mContext.getResources(), R.color.page_info_popup_text_link)); |
permissionRow.setOnClickListener(this); |
} |
} |
TextView permissionStatus = (TextView) permissionRow.findViewById( |
- R.id.website_settings_permission_status); |
+ R.id.page_info_permission_status); |
SpannableStringBuilder builder = new SpannableStringBuilder(); |
SpannableString nameString = new SpannableString(permission.name); |
final StyleSpan boldSpan = new StyleSpan(android.graphics.Typeface.BOLD); |
@@ -671,7 +669,7 @@ public class WebsiteSettingsPopup implements OnClickListener { |
mContext.getString(R.string.page_info_details_link)); |
final ForegroundColorSpan blueSpan = new ForegroundColorSpan( |
ApiCompatibilityUtils.getColor(mContext.getResources(), |
- R.color.website_settings_popup_text_link)); |
+ R.color.page_info_popup_text_link)); |
detailsText.setSpan( |
blueSpan, 0, detailsText.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE); |
messageBuilder.append(detailsText); |
@@ -681,7 +679,7 @@ public class WebsiteSettingsPopup implements OnClickListener { |
} |
/** |
- * Displays the WebsiteSettingsPopup. |
+ * Displays the PageInfoPopup. |
*/ |
private void showDialog() { |
if (!DeviceFormFactor.isTablet(mContext)) { |
@@ -735,11 +733,11 @@ public class WebsiteSettingsPopup implements OnClickListener { |
@Override |
public void onClick(View view) { |
if (view == mSiteSettingsButton) { |
- // Delay while the WebsiteSettingsPopup closes. |
+ // Delay while the PageInfoPopup closes. |
runAfterDismiss(new Runnable() { |
@Override |
public void run() { |
- recordAction(WebsiteSettingsAction.WEBSITE_SETTINGS_SITE_SETTINGS_OPENED); |
+ recordAction(PageInfoAction.PAGE_INFO_SITE_SETTINGS_OPENED); |
Bundle fragmentArguments = |
SingleWebsitePreferences.createFragmentArgsForSite(mFullUrl); |
fragmentArguments.putParcelable(SingleWebsitePreferences.EXTRA_WEB_CONTENTS, |
@@ -767,12 +765,12 @@ public class WebsiteSettingsPopup implements OnClickListener { |
public void run() { |
if (!mTab.getWebContents().isDestroyed()) { |
recordAction( |
- WebsiteSettingsAction.WEBSITE_SETTINGS_SECURITY_DETAILS_OPENED); |
+ PageInfoAction.PAGE_INFO_SECURITY_DETAILS_OPENED); |
ConnectionInfoPopup.show(mContext, mTab.getWebContents()); |
} |
} |
}); |
- } else if (view.getId() == R.id.website_settings_permission_row) { |
+ } else if (view.getId() == R.id.page_info_permission_row) { |
final Object intentOverride = view.getTag(R.id.permission_intent_override); |
if (intentOverride == null && mWindowAndroid != null) { |
@@ -926,8 +924,8 @@ public class WebsiteSettingsPopup implements OnClickListener { |
} |
private void recordAction(int action) { |
- if (mNativeWebsiteSettingsPopup != 0) { |
- nativeRecordWebsiteSettingsAction(mNativeWebsiteSettingsPopup, action); |
+ if (mNativePageInfoPopup != 0) { |
+ nativeRecordPageInfoAction(mNativePageInfoPopup, action); |
} |
} |
@@ -939,7 +937,7 @@ public class WebsiteSettingsPopup implements OnClickListener { |
} |
/** |
- * Shows a WebsiteSettings dialog for the provided Tab. The popup adds itself to the view |
+ * Shows a PageInfo dialog for the provided Tab. The popup adds itself to the view |
* hierarchy which owns the reference while it's visible. |
* |
* @param activity Activity which is used for launching a dialog. |
@@ -968,13 +966,13 @@ public class WebsiteSettingsPopup implements OnClickListener { |
offlinePageCreationDate = df.format(creationDate); |
} |
- new WebsiteSettingsPopup(activity, tab, offlinePageCreationDate, contentPublisher); |
+ new PageInfoPopup(activity, tab, offlinePageCreationDate, contentPublisher); |
} |
- private static native long nativeInit(WebsiteSettingsPopup popup, WebContents webContents); |
+ private static native long nativeInit(PageInfoPopup popup, WebContents webContents); |
- private native void nativeDestroy(long nativeWebsiteSettingsPopupAndroid); |
+ private native void nativeDestroy(long nativePageInfoPopupAndroid); |
- private native void nativeRecordWebsiteSettingsAction( |
- long nativeWebsiteSettingsPopupAndroid, int action); |
+ private native void nativeRecordPageInfoAction( |
+ long nativePageInfoPopupAndroid, int action); |
} |