| OLD | NEW |
| 1 /* Copyright 2015 The Chromium Authors. All rights reserved. | 1 /* Copyright 2015 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('sync.confirmation', function() { | 5 cr.define('sync.confirmation', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 function onConfirm(e) { | 8 function onConfirm(e) { |
| 9 chrome.send('confirm', [$('configure-before-signing-in').checked]); | 9 chrome.send('confirm', [$('configure-before-signing-in').checked]); |
| 10 } | 10 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 if (loadTimeData.getBoolean('isSyncAllowed')) { | 45 if (loadTimeData.getBoolean('isSyncAllowed')) { |
| 46 $('picture-container').classList.add('loaded'); | 46 $('picture-container').classList.add('loaded'); |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 | 49 |
| 50 function onKeyDown(e) { | 50 function onKeyDown(e) { |
| 51 // If the currently focused element isn't something that performs an action | 51 // If the currently focused element isn't something that performs an action |
| 52 // on "enter" being pressed and the user hits "enter", perform the default | 52 // on "enter" being pressed and the user hits "enter", perform the default |
| 53 // action of the dialog, which is "OK, Got It". | 53 // action of the dialog, which is "OK, Got It". |
| 54 if (e.key == 'Enter' && | 54 if (e.key == 'Enter' && |
| 55 !/^(A|PAPER-BUTTON)$/.test(document.activeElement.tagName)) { | 55 !/^(A|PAPER-(BUTTON|CHECKBOX))$/.test(document.activeElement.tagName)) { |
| 56 $('confirmButton').click(); | 56 $('confirmButton').click(); |
| 57 e.preventDefault(); | 57 e.preventDefault(); |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 | 60 |
| 61 return { | 61 return { |
| 62 clearFocus: clearFocus, | 62 clearFocus: clearFocus, |
| 63 initialize: initialize, | 63 initialize: initialize, |
| 64 setUserImageURL: setUserImageURL | 64 setUserImageURL: setUserImageURL |
| 65 }; | 65 }; |
| 66 }); | 66 }); |
| 67 | 67 |
| 68 document.addEventListener('DOMContentLoaded', sync.confirmation.initialize); | 68 document.addEventListener('DOMContentLoaded', sync.confirmation.initialize); |
| OLD | NEW |