Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 cr.define('options.passwordManager', function() { | 5 cr.define('options.passwordManager', function() { |
| 6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
| 7 /** @const */ var DeletableItemList = options.DeletableItemList; | 7 /** @const */ var DeletableItemList = options.DeletableItemList; |
| 8 /** @const */ var DeletableItem = options.DeletableItem; | 8 /** @const */ var DeletableItem = options.DeletableItem; |
| 9 /** @const */ var List = cr.ui.List; | 9 /** @const */ var List = cr.ui.List; |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 decorate: function() { | 68 decorate: function() { |
| 69 DeletableItem.prototype.decorate.call(this); | 69 DeletableItem.prototype.decorate.call(this); |
| 70 | 70 |
| 71 // The URL of the site. | 71 // The URL of the site. |
| 72 var urlDiv = this.ownerDocument.createElement('div'); | 72 var urlDiv = this.ownerDocument.createElement('div'); |
| 73 urlDiv.className = 'favicon-cell left-elided-url url'; | 73 urlDiv.className = 'favicon-cell left-elided-url url'; |
| 74 urlDiv.setAttribute( | 74 urlDiv.setAttribute( |
| 75 'title', getTitleForPasswordOrigin(this.url, this.isUrlSecure)); | 75 'title', getTitleForPasswordOrigin(this.url, this.isUrlSecure)); |
| 76 var urlLink = this.ownerDocument.createElement('a'); | 76 var urlLink = this.ownerDocument.createElement('a'); |
| 77 urlLink.href = this.url; | 77 urlLink.href = this.url; |
| 78 urlLink.setAttribute('target', '_blank'); | |
| 78 urlLink.textContent = this.shownUrl.split('').reverse().join(''); | 79 urlLink.textContent = this.shownUrl.split('').reverse().join(''); |
| 79 urlDiv.appendChild(urlLink); | 80 urlDiv.appendChild(urlLink); |
| 80 urlDiv.style.backgroundImage = getFaviconImageSet( | 81 urlDiv.style.backgroundImage = getFaviconImageSet( |
| 81 'origin/' + this.url, 16); | 82 'origin/' + this.url, 16); |
| 82 this.contentElement.appendChild(urlDiv); | 83 this.contentElement.appendChild(urlDiv); |
| 84 this.urlField = urlLink; | |
|
Evan Stade
2015/11/04 16:44:42
nit: s/urlField/urlLink
kolos1
2015/11/04 16:52:43
Done.
| |
| 83 | 85 |
| 84 // The stored username. | 86 // The stored username. |
| 85 var usernameDiv = this.ownerDocument.createElement('div'); | 87 var usernameDiv = this.ownerDocument.createElement('div'); |
| 86 usernameDiv.className = 'name'; | 88 usernameDiv.className = 'name'; |
| 87 usernameDiv.title = this.username; | 89 usernameDiv.title = this.username; |
| 88 this.contentElement.appendChild(usernameDiv); | 90 this.contentElement.appendChild(usernameDiv); |
| 89 var usernameInput = this.ownerDocument.createElement('input'); | 91 var usernameInput = this.ownerDocument.createElement('input'); |
| 90 usernameInput.type = 'text'; | 92 usernameInput.type = 'text'; |
| 91 usernameInput.className = 'inactive-item'; | 93 usernameInput.className = 'inactive-item'; |
| 92 usernameInput.readOnly = true; | 94 usernameInput.readOnly = true; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 } | 167 } |
| 166 }, | 168 }, |
| 167 | 169 |
| 168 /** | 170 /** |
| 169 * Set the focusability of this row. | 171 * Set the focusability of this row. |
| 170 * @param {boolean} focusable | 172 * @param {boolean} focusable |
| 171 * @private | 173 * @private |
| 172 */ | 174 */ |
| 173 setFocusable_: function(focusable) { | 175 setFocusable_: function(focusable) { |
| 174 var tabIndex = focusable ? 0 : -1; | 176 var tabIndex = focusable ? 0 : -1; |
| 175 this.passwordField.tabIndex = this.closeButtonElement.tabIndex = tabIndex; | 177 this.urlField.tabIndex = tabIndex; |
| 178 this.usernameField.tabIndex = tabIndex; | |
| 179 this.passwordField.tabIndex = tabIndex; | |
| 180 this.closeButtonElement.tabIndex = tabIndex; | |
| 176 }, | 181 }, |
| 177 | 182 |
| 178 /** | 183 /** |
| 179 * Reveals the plain text password of this entry. | 184 * Reveals the plain text password of this entry. |
| 180 */ | 185 */ |
| 181 showPassword: function(password) { | 186 showPassword: function(password) { |
| 182 this.passwordField.value = password; | 187 this.passwordField.value = password; |
| 183 this.passwordField.type = 'text'; | 188 this.passwordField.type = 'text'; |
| 184 | 189 |
| 185 var button = this.passwordShowButton; | 190 var button = this.passwordShowButton; |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 316 // The URL of the site. | 321 // The URL of the site. |
| 317 var urlDiv = this.ownerDocument.createElement('div'); | 322 var urlDiv = this.ownerDocument.createElement('div'); |
| 318 urlDiv.className = 'url'; | 323 urlDiv.className = 'url'; |
| 319 urlDiv.classList.add('favicon-cell'); | 324 urlDiv.classList.add('favicon-cell'); |
| 320 urlDiv.classList.add('left-elided-url'); | 325 urlDiv.classList.add('left-elided-url'); |
| 321 urlDiv.setAttribute( | 326 urlDiv.setAttribute( |
| 322 'title', getTitleForPasswordOrigin(this.url, this.isUrlSecure)); | 327 'title', getTitleForPasswordOrigin(this.url, this.isUrlSecure)); |
| 323 var urlLink = this.ownerDocument.createElement('a'); | 328 var urlLink = this.ownerDocument.createElement('a'); |
| 324 urlLink.href = this.url; | 329 urlLink.href = this.url; |
| 325 urlLink.textContent = this.shownUrl.split('').reverse().join(''); | 330 urlLink.textContent = this.shownUrl.split('').reverse().join(''); |
| 331 urlLink.setAttribute('target', '_blank'); | |
| 326 urlDiv.appendChild(urlLink); | 332 urlDiv.appendChild(urlLink); |
| 327 urlDiv.style.backgroundImage = getFaviconImageSet( | 333 urlDiv.style.backgroundImage = getFaviconImageSet( |
| 328 'origin/' + this.url, 16); | 334 'origin/' + this.url, 16); |
| 335 urlLink.tabIndex = -1; | |
| 329 this.contentElement.appendChild(urlDiv); | 336 this.contentElement.appendChild(urlDiv); |
| 330 }, | 337 }, |
| 331 | 338 |
| 332 /** | 339 /** |
| 333 * Get the url for the entry. | 340 * Get the url for the entry. |
| 334 * @type {string} | 341 * @type {string} |
| 335 */ | 342 */ |
| 336 get url() { | 343 get url() { |
| 337 return this.dataItem[ORIGIN_FIELD]; | 344 return this.dataItem[ORIGIN_FIELD]; |
| 338 }, | 345 }, |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 479 PasswordExceptionsList: PasswordExceptionsList, | 486 PasswordExceptionsList: PasswordExceptionsList, |
| 480 ORIGIN_FIELD: ORIGIN_FIELD, | 487 ORIGIN_FIELD: ORIGIN_FIELD, |
| 481 SHOWN_URL_FIELD: SHOWN_URL_FIELD, | 488 SHOWN_URL_FIELD: SHOWN_URL_FIELD, |
| 482 IS_SECURE_FIELD: IS_SECURE_FIELD, | 489 IS_SECURE_FIELD: IS_SECURE_FIELD, |
| 483 USERNAME_FIELD: USERNAME_FIELD, | 490 USERNAME_FIELD: USERNAME_FIELD, |
| 484 PASSWORD_FIELD: PASSWORD_FIELD, | 491 PASSWORD_FIELD: PASSWORD_FIELD, |
| 485 FEDERATION_FIELD: FEDERATION_FIELD, | 492 FEDERATION_FIELD: FEDERATION_FIELD, |
| 486 ORIGINAL_INDEX_FIELD: ORIGINAL_INDEX_FIELD | 493 ORIGINAL_INDEX_FIELD: ORIGINAL_INDEX_FIELD |
| 487 }; | 494 }; |
| 488 }); | 495 }); |
| OLD | NEW |