OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 ArrayDataModel = cr.ui.ArrayDataModel; | 6 const ArrayDataModel = cr.ui.ArrayDataModel; |
7 const DeletableItemList = options.DeletableItemList; | 7 const DeletableItemList = options.DeletableItemList; |
8 const DeletableItem = options.DeletableItem; | 8 const DeletableItem = options.DeletableItem; |
9 const List = cr.ui.List; | 9 const List = cr.ui.List; |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 __proto__: DeletableItem.prototype, | 27 __proto__: DeletableItem.prototype, |
28 | 28 |
29 /** @inheritDoc */ | 29 /** @inheritDoc */ |
30 decorate: function(showPasswords) { | 30 decorate: function(showPasswords) { |
31 DeletableItem.prototype.decorate.call(this); | 31 DeletableItem.prototype.decorate.call(this); |
32 | 32 |
33 // The URL of the site. | 33 // The URL of the site. |
34 var urlLabel = this.ownerDocument.createElement('div'); | 34 var urlLabel = this.ownerDocument.createElement('div'); |
35 urlLabel.classList.add('favicon-cell'); | 35 urlLabel.classList.add('favicon-cell'); |
36 urlLabel.classList.add('url'); | 36 urlLabel.classList.add('url'); |
| 37 urlLabel.setAttribute('title', this.url); |
37 urlLabel.textContent = this.url; | 38 urlLabel.textContent = this.url; |
38 urlLabel.style.backgroundImage = url('chrome://favicon/' + this.url); | 39 urlLabel.style.backgroundImage = url('chrome://favicon/' + this.url); |
39 this.contentElement.appendChild(urlLabel); | 40 this.contentElement.appendChild(urlLabel); |
40 | 41 |
41 // The stored username. | 42 // The stored username. |
42 var usernameLabel = this.ownerDocument.createElement('div'); | 43 var usernameLabel = this.ownerDocument.createElement('div'); |
43 usernameLabel.className = 'name'; | 44 usernameLabel.className = 'name'; |
44 usernameLabel.textContent = this.username; | 45 usernameLabel.textContent = this.username; |
45 this.contentElement.appendChild(usernameLabel); | 46 this.contentElement.appendChild(usernameLabel); |
46 | 47 |
47 // The stored password. | 48 // The stored password. |
48 var passwordInputDiv = this.ownerDocument.createElement('div'); | 49 var passwordInputDiv = this.ownerDocument.createElement('div'); |
49 passwordInputDiv.className = 'password'; | 50 passwordInputDiv.className = 'password'; |
50 | 51 |
51 // The password input field. | 52 // The password input field. |
52 var passwordInput = this.ownerDocument.createElement('input'); | 53 var passwordInput = this.ownerDocument.createElement('input'); |
53 passwordInput.type = 'password'; | 54 passwordInput.type = 'password'; |
54 passwordInput.className = 'inactive-password'; | 55 passwordInput.className = 'inactive-password'; |
55 passwordInput.readOnly = true; | 56 passwordInput.readOnly = true; |
56 passwordInput.value = showPasswords ? this.password : "********"; | 57 passwordInput.value = showPasswords ? this.password : '********'; |
57 passwordInputDiv.appendChild(passwordInput); | 58 passwordInputDiv.appendChild(passwordInput); |
58 | 59 |
59 // The show/hide button. | 60 // The show/hide button. |
60 if (showPasswords) { | 61 if (showPasswords) { |
61 var button = this.ownerDocument.createElement('button'); | 62 var button = this.ownerDocument.createElement('button'); |
62 button.classList.add('hidden'); | 63 button.classList.add('hidden'); |
63 button.classList.add('password-button'); | 64 button.classList.add('password-button'); |
64 button.textContent = localStrings.getString('passwordShowButton'); | 65 button.textContent = localStrings.getString('passwordShowButton'); |
65 button.addEventListener('click', this.onClick_, true); | 66 button.addEventListener('click', this.onClick_, true); |
66 passwordInputDiv.appendChild(button); | 67 passwordInputDiv.appendChild(button); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 }, | 266 }, |
266 }; | 267 }; |
267 | 268 |
268 return { | 269 return { |
269 PasswordListItem: PasswordListItem, | 270 PasswordListItem: PasswordListItem, |
270 PasswordExceptionsListItem: PasswordExceptionsListItem, | 271 PasswordExceptionsListItem: PasswordExceptionsListItem, |
271 PasswordsList: PasswordsList, | 272 PasswordsList: PasswordsList, |
272 PasswordExceptionsList: PasswordExceptionsList, | 273 PasswordExceptionsList: PasswordExceptionsList, |
273 }; | 274 }; |
274 }); | 275 }); |
OLD | NEW |