| Index: chrome/browser/resources/options/password_manager_list.js
|
| diff --git a/chrome/browser/resources/options/password_manager_list.js b/chrome/browser/resources/options/password_manager_list.js
|
| index 58bd5efce0d831ca12c006fbb9a0b77277e8f14e..981a98b72c1fa5d406b1d89282ee9ee07ae46ebf 100644
|
| --- a/chrome/browser/resources/options/password_manager_list.js
|
| +++ b/chrome/browser/resources/options/password_manager_list.js
|
| @@ -10,9 +10,9 @@ cr.define('options.passwordManager', function() {
|
|
|
| // The following constants should be synchronized with the constants in
|
| // chrome/browser/ui/webui/options/password_manager_handler.cc.
|
| - /** @const */ var ORIGIN_FIELD = 'origin';
|
| - /** @const */ var SHOWN_URL_FIELD = 'shownUrl';
|
| - /** @const */ var IS_ANDROID_URI_FIELD = 'isAndroidUri';
|
| + /** @const */ var URL_FIELD = 'url';
|
| + /** @const */ var SHOWN_ORIGIN_FIELD = 'shownOrigin';
|
| + /** @const */ var IS_CLICKABLE_FIELD = 'isClickable';
|
| /** @const */ var IS_SECURE_FIELD = 'isSecure';
|
| /** @const */ var USERNAME_FIELD = 'username';
|
| /** @const */ var PASSWORD_FIELD = 'password';
|
| @@ -42,15 +42,15 @@ cr.define('options.passwordManager', function() {
|
| }
|
|
|
| /**
|
| - * Returns title for password's origin. If the origin is Android URI, returns
|
| - * the origin as it is. Removes the scheme if the url is insecure and removes
|
| - * trailing punctuation symbols.
|
| + * Returns title for password's origin. If the origin is not clickable,
|
| + * returns the origin as it is. For clickable origins, removes the scheme if
|
| + * the url is insecure and removes trailing punctuation symbols.
|
| * @param {Object} item A dictionary of data on the list item.
|
| * @return {string} The title for password's origin.
|
| */
|
| function getTitleForPasswordOrigin(item) {
|
| var title = item.url;
|
| - if (item.isAndroidUri)
|
| + if (!item.isClickable)
|
| return title;
|
| if (!item.isSecure) {
|
| var ind = title.indexOf('://');
|
| @@ -74,16 +74,15 @@ cr.define('options.passwordManager', function() {
|
| */
|
| function createUrlLink(item, urlDiv) {
|
| var urlLink;
|
| - if (!item.isAndroidUri) {
|
| + if (item.isClickable) {
|
| urlLink = item.ownerDocument.createElement('a');
|
| urlLink.href = item.url;
|
| urlLink.setAttribute('target', '_blank');
|
| - urlLink.textContent = item.shownUrl.split('').reverse().join('');
|
| -
|
| + urlLink.textContent = item.shownOrigin.split('').reverse().join('');
|
| urlDiv.classList.add('left-elided-url');
|
| } else {
|
| urlLink = item.ownerDocument.createElement('span');
|
| - urlLink.textContent = item.shownUrl;
|
| + urlLink.textContent = item.shownOrigin;
|
| }
|
| urlLink.addEventListener('focus', function() {
|
| item.handleFocus();
|
| @@ -266,32 +265,32 @@ cr.define('options.passwordManager', function() {
|
| * @type {string}
|
| */
|
| get url() {
|
| - return this.dataItem[ORIGIN_FIELD];
|
| + return this.dataItem[URL_FIELD];
|
| },
|
| set url(url) {
|
| - this.dataItem[ORIGIN_FIELD] = url;
|
| + this.dataItem[URL_FIELD] = url;
|
| },
|
|
|
| /**
|
| - * Get and set the shown url for the entry.
|
| + * Get and set the shown origin for the entry.
|
| * @type {string}
|
| */
|
| - get shownUrl() {
|
| - return this.dataItem[SHOWN_URL_FIELD];
|
| + get shownOrigin() {
|
| + return this.dataItem[SHOWN_ORIGIN_FIELD];
|
| },
|
| - set shownUrl(shownUrl) {
|
| - this.dataItem[SHOWN_URL_FIELD] = shownUrl;
|
| + set shownOrigin(shownOrigin) {
|
| + this.dataItem[SHOWN_ORIGIN_FIELD] = shownOrigin;
|
| },
|
|
|
| /**
|
| - * Get and set whether the origin is Android URI.
|
| + * Get and set whether the origin is clickable.
|
| * @type {boolean}
|
| */
|
| - get isAndroidUri() {
|
| - return this.dataItem[IS_ANDROID_URI_FIELD];
|
| + get isClickable() {
|
| + return this.dataItem[IS_CLICKABLE_FIELD];
|
| },
|
| - set isAndroidUri(isAndroidUri) {
|
| - this.dataItem[IS_ANDROID_URI_FIELD] = isAndroidUri;
|
| + set isClickable(isClickable) {
|
| + this.dataItem[IS_CLICKABLE_FIELD] = isClickable;
|
| },
|
|
|
| /**
|
| @@ -402,32 +401,32 @@ cr.define('options.passwordManager', function() {
|
| * @type {string}
|
| */
|
| get url() {
|
| - return this.dataItem[ORIGIN_FIELD];
|
| + return this.dataItem[URL_FIELD];
|
| },
|
| set url(url) {
|
| - this.dataItem[ORIGIN_FIELD] = url;
|
| + this.dataItem[URL_FIELD] = url;
|
| },
|
|
|
| /**
|
| - * Get and set the shown url for the entry.
|
| + * Get and set the shown origin for the entry.
|
| * @type {string}
|
| */
|
| - get shownUrl() {
|
| - return this.dataItem[SHOWN_URL_FIELD];
|
| + get shownOrigin() {
|
| + return this.dataItem[SHOWN_ORIGIN_FIELD];
|
| },
|
| - set shownUrl(shownUrl) {
|
| - this.dataItem[SHOWN_URL_FIELD] = shownUrl;
|
| + set shownOrigin(shownOrigin) {
|
| + this.dataItem[SHOWN_ORIGIN_FIELD] = shownOrigin;
|
| },
|
|
|
| /**
|
| - * Get and set whether the origin is Android URI.
|
| + * Get and set whether the origin is clickable.
|
| * @type {boolean}
|
| */
|
| - get isAndroidUri() {
|
| - return this.dataItem[IS_ANDROID_URI_FIELD];
|
| + get isClickable() {
|
| + return this.dataItem[IS_CLICKABLE_FIELD];
|
| },
|
| - set isAndroidUri(isAndroidUri) {
|
| - this.dataItem[IS_ANDROID_URI_FIELD] = isAndroidUri;
|
| + set isClickable(isClickable) {
|
| + this.dataItem[IS_CLICKABLE_FIELD] = isClickable;
|
| },
|
|
|
| /**
|
| @@ -556,8 +555,9 @@ cr.define('options.passwordManager', function() {
|
| PasswordExceptionsListItem: PasswordExceptionsListItem,
|
| PasswordsList: PasswordsList,
|
| PasswordExceptionsList: PasswordExceptionsList,
|
| - ORIGIN_FIELD: ORIGIN_FIELD,
|
| - SHOWN_URL_FIELD: SHOWN_URL_FIELD,
|
| + URL_FIELD: URL_FIELD,
|
| + SHOWN_ORIGIN_FIELD: SHOWN_ORIGIN_FIELD,
|
| + IS_CLICKABLE_FIELD: IS_CLICKABLE_FIELD,
|
| IS_SECURE_FIELD: IS_SECURE_FIELD,
|
| USERNAME_FIELD: USERNAME_FIELD,
|
| PASSWORD_FIELD: PASSWORD_FIELD,
|
|
|