1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 cr.define('profile_signin_confirmation', function() {
8 function initialize() {
9 var args = JSON.parse(chrome.getVariableValue('dialogArguments'));
10 $('dialog-message').textContent = loadTimeData.getStringF(
11 'dialogMessage', args.username);
12 $('dialog-prompt').textContent = loadTimeData.getStringF(
13 'dialogPrompt', args.username);
14 $('create-button').addEventListener('click', function() {
15 chrome.send('createNewProfile');
17 $('continue-button').addEventListener('click', function() {
18 chrome.send('continue');
20 $('cancel-button').addEventListener('click', function() {
21 chrome.send('cancel');
24 if (args.promptForNewProfile) {
25 $('continue-button').innerText =
26 loadTimeData.getStringF('continueButtonText');
28 $('create-button').hidden = true;
29 $('dialog-prompt').hidden = true;
30 $('continue-button').innerText =
31 loadTimeData.getStringF('okButtonText');
32 // Right-align the buttons when only "OK" and "Cancel" are showing.
33 $('button-row').style['text-align'] = 'end';
37 $('dialog-title').hidden = true;
41 initialize: initialize
45 document.addEventListener('DOMContentLoaded',
46 profile_signin_confirmation.initialize);