| 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 20 matching lines...) Expand all Loading... |
| 31 decorate: function(showPasswords) { | 31 decorate: function(showPasswords) { |
| 32 DeletableItem.prototype.decorate.call(this); | 32 DeletableItem.prototype.decorate.call(this); |
| 33 | 33 |
| 34 // The URL of the site. | 34 // The URL of the site. |
| 35 var urlLabel = this.ownerDocument.createElement('div'); | 35 var urlLabel = this.ownerDocument.createElement('div'); |
| 36 urlLabel.classList.add('favicon-cell'); | 36 urlLabel.classList.add('favicon-cell'); |
| 37 urlLabel.classList.add('weakrtl'); | 37 urlLabel.classList.add('weakrtl'); |
| 38 urlLabel.classList.add('url'); | 38 urlLabel.classList.add('url'); |
| 39 urlLabel.setAttribute('title', this.url); | 39 urlLabel.setAttribute('title', this.url); |
| 40 urlLabel.textContent = this.url; | 40 urlLabel.textContent = this.url; |
| 41 urlLabel.style.backgroundImage = url('chrome://favicon/' + this.url); | 41 |
| 42 // The favicon URL is prefixed with "origin/", which essentially removes |
| 43 // the URL path past the top-level domain and ensures that a scheme (e.g., |
| 44 // http) is being used. This ensures that the favicon returned is the |
| 45 // default favicon for the domain and that the URL has a scheme if none |
| 46 // is present in the password manager. |
| 47 urlLabel.style.backgroundImage = |
| 48 url('chrome://favicon/origin/' + this.url); |
| 42 this.contentElement.appendChild(urlLabel); | 49 this.contentElement.appendChild(urlLabel); |
| 43 | 50 |
| 44 // The stored username. | 51 // The stored username. |
| 45 var usernameLabel = this.ownerDocument.createElement('div'); | 52 var usernameLabel = this.ownerDocument.createElement('div'); |
| 46 usernameLabel.className = 'name'; | 53 usernameLabel.className = 'name'; |
| 47 usernameLabel.textContent = this.username; | 54 usernameLabel.textContent = this.username; |
| 48 this.contentElement.appendChild(usernameLabel); | 55 this.contentElement.appendChild(usernameLabel); |
| 49 | 56 |
| 50 // The stored password. | 57 // The stored password. |
| 51 var passwordInputDiv = this.ownerDocument.createElement('div'); | 58 var passwordInputDiv = this.ownerDocument.createElement('div'); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 */ | 172 */ |
| 166 decorate: function() { | 173 decorate: function() { |
| 167 DeletableItem.prototype.decorate.call(this); | 174 DeletableItem.prototype.decorate.call(this); |
| 168 | 175 |
| 169 // The URL of the site. | 176 // The URL of the site. |
| 170 var urlLabel = this.ownerDocument.createElement('div'); | 177 var urlLabel = this.ownerDocument.createElement('div'); |
| 171 urlLabel.className = 'url'; | 178 urlLabel.className = 'url'; |
| 172 urlLabel.classList.add('favicon-cell'); | 179 urlLabel.classList.add('favicon-cell'); |
| 173 urlLabel.classList.add('weakrtl'); | 180 urlLabel.classList.add('weakrtl'); |
| 174 urlLabel.textContent = this.url; | 181 urlLabel.textContent = this.url; |
| 175 urlLabel.style.backgroundImage = url('chrome://favicon/' + this.url); | 182 |
| 183 // The favicon URL is prefixed with "origin/", which essentially removes |
| 184 // the URL path past the top-level domain and ensures that a scheme (e.g., |
| 185 // http) is being used. This ensures that the favicon returned is the |
| 186 // default favicon for the domain and that the URL has a scheme if none |
| 187 // is present in the password manager. |
| 188 urlLabel.style.backgroundImage = |
| 189 url('chrome://favicon/origin/' + this.url); |
| 176 this.contentElement.appendChild(urlLabel); | 190 this.contentElement.appendChild(urlLabel); |
| 177 }, | 191 }, |
| 178 | 192 |
| 179 /** | 193 /** |
| 180 * Get the url for the entry. | 194 * Get the url for the entry. |
| 181 * @type {string} | 195 * @type {string} |
| 182 */ | 196 */ |
| 183 get url() { | 197 get url() { |
| 184 return this.dataItem; | 198 return this.dataItem; |
| 185 }, | 199 }, |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 }, | 288 }, |
| 275 }; | 289 }; |
| 276 | 290 |
| 277 return { | 291 return { |
| 278 PasswordListItem: PasswordListItem, | 292 PasswordListItem: PasswordListItem, |
| 279 PasswordExceptionsListItem: PasswordExceptionsListItem, | 293 PasswordExceptionsListItem: PasswordExceptionsListItem, |
| 280 PasswordsList: PasswordsList, | 294 PasswordsList: PasswordsList, |
| 281 PasswordExceptionsList: PasswordExceptionsList, | 295 PasswordExceptionsList: PasswordExceptionsList, |
| 282 }; | 296 }; |
| 283 }); | 297 }); |
| OLD | NEW |