| OLD | NEW |
| 1 /* Copyright 2016 The Chromium Authors. All rights reserved. | 1 /* Copyright 2016 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('signin.emailConfirmation', function() { | 5 cr.define('signin.emailConfirmation', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 function initialize() { | 8 function initialize() { |
| 9 var args = JSON.parse(chrome.getVariableValue('dialogArguments')); | 9 var args = JSON.parse(chrome.getVariableValue('dialogArguments')); |
| 10 var lastEmail = args.lastEmail; | 10 var lastEmail = args.lastEmail; |
| 11 var newEmail = args.newEmail; | 11 var newEmail = args.newEmail; |
| 12 $('dialogTitle').textContent = loadTimeData.getStringF( | 12 $('dialogTitle').textContent = loadTimeData.getStringF( |
| 13 'signinEmailConfirmationTitle', lastEmail); | 13 'signinEmailConfirmationTitle', lastEmail); |
| 14 $('createNewUserRadioButton').innerHTML = loadTimeData.getStringF( | 14 $('createNewUserRadioButtonTitle').innerHTML = I18nBehavior.i18n( |
| 15 'signinEmailConfirmationCreateProfileButtonTitle', newEmail); | 15 'signinEmailConfirmationCreateProfileButtonTitle', newEmail); |
| 16 $('startSyncRadioButton').innerHTML = loadTimeData.getStringF( | 16 $('startSyncRadioButtonTitle').innerHTML = I18nBehavior.i18n( |
| 17 'signinEmailConfirmationStartSyncButtonTitle', newEmail); | 17 'signinEmailConfirmationStartSyncButtonTitle', newEmail); |
| 18 | 18 |
| 19 document.addEventListener('keydown', onKeyDown); | 19 document.addEventListener('keydown', onKeyDown); |
| 20 $('confirmButton').addEventListener('click', onConfirm); | 20 $('confirmButton').addEventListener('click', onConfirm); |
| 21 $('closeButton').addEventListener('click', onCancel); | 21 $('closeButton').addEventListener('click', onCancel); |
| 22 } | 22 } |
| 23 | 23 |
| 24 function onKeyDown(e) { | 24 function onKeyDown(e) { |
| 25 // If the currently focused element isn't something that performs an action | 25 // If the currently focused element isn't something that performs an action |
| 26 // on "enter" being pressed and the user hits "enter", perform the default | 26 // on "enter" being pressed and the user hits "enter", perform the default |
| (...skipping 22 matching lines...) Expand all Loading... |
| 49 chrome.send('dialogClose', [JSON.stringify({'action': 'cancel'})]); | 49 chrome.send('dialogClose', [JSON.stringify({'action': 'cancel'})]); |
| 50 } | 50 } |
| 51 | 51 |
| 52 return { | 52 return { |
| 53 initialize: initialize, | 53 initialize: initialize, |
| 54 }; | 54 }; |
| 55 }); | 55 }); |
| 56 | 56 |
| 57 document.addEventListener('DOMContentLoaded', | 57 document.addEventListener('DOMContentLoaded', |
| 58 signin.emailConfirmation.initialize); | 58 signin.emailConfirmation.initialize); |
| OLD | NEW |