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.autofillOptions', function() { | 5 cr.define('options.autofillOptions', function() { |
6 /** @const */ var DeletableItem = options.DeletableItem; | 6 /** @const */ var DeletableItem = options.DeletableItem; |
7 /** @const */ var DeletableItemList = options.DeletableItemList; | 7 /** @const */ var DeletableItemList = options.DeletableItemList; |
8 /** @const */ var InlineEditableItem = options.InlineEditableItem; | 8 /** @const */ var InlineEditableItem = options.InlineEditableItem; |
9 /** @const */ var InlineEditableItemList = options.InlineEditableItemList; | 9 /** @const */ var InlineEditableItemList = options.InlineEditableItemList; |
10 | 10 |
11 function AutofillEditProfileButton(guid, edit) { | 11 function AutofillEditProfileButton(guid, edit) { |
12 var editButtonEl = document.createElement('button'); | 12 var editButtonEl = document.createElement('button'); |
13 editButtonEl.className = 'list-inline-button custom-appearance'; | 13 editButtonEl.className = 'list-inline-button custom-appearance'; |
14 editButtonEl.textContent = | 14 editButtonEl.textContent = |
15 loadTimeData.getString('autofillEditProfileButton'); | 15 loadTimeData.getString('autofillEditProfileButton'); |
16 editButtonEl.onclick = function(e) { edit(guid); }; | 16 editButtonEl.onclick = function(e) { edit(guid); }; |
17 | 17 |
18 // Don't select the row when clicking the button. | |
19 editButtonEl.onmousedown = function(e) { | 18 editButtonEl.onmousedown = function(e) { |
| 19 // Don't select the row when clicking the button. |
20 e.stopPropagation(); | 20 e.stopPropagation(); |
| 21 // Don't focus on the button when clicking it. |
| 22 e.preventDefault(); |
21 }; | 23 }; |
22 | 24 |
23 return editButtonEl; | 25 return editButtonEl; |
24 } | 26 } |
25 | 27 |
26 /** | 28 /** |
27 * Creates a new address list item. | 29 * Creates a new address list item. |
28 * @param {Array} entry An array of the form [guid, label]. | 30 * @param {Array} entry An array of the form [guid, label]. |
29 * @constructor | 31 * @constructor |
30 * @extends {options.DeletableItem} | 32 * @extends {options.DeletableItem} |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 CreditCardListItem: CreditCardListItem, | 499 CreditCardListItem: CreditCardListItem, |
498 ValuesListItem: ValuesListItem, | 500 ValuesListItem: ValuesListItem, |
499 NameListItem: NameListItem, | 501 NameListItem: NameListItem, |
500 AutofillAddressList: AutofillAddressList, | 502 AutofillAddressList: AutofillAddressList, |
501 AutofillCreditCardList: AutofillCreditCardList, | 503 AutofillCreditCardList: AutofillCreditCardList, |
502 AutofillValuesList: AutofillValuesList, | 504 AutofillValuesList: AutofillValuesList, |
503 AutofillNameValuesList: AutofillNameValuesList, | 505 AutofillNameValuesList: AutofillNameValuesList, |
504 AutofillPhoneValuesList: AutofillPhoneValuesList, | 506 AutofillPhoneValuesList: AutofillPhoneValuesList, |
505 }; | 507 }; |
506 }); | 508 }); |
OLD | NEW |