Index: chrome/browser/resources/options/sync_setup_overlay.js |
=================================================================== |
--- chrome/browser/resources/options/sync_setup_overlay.js (revision 84869) |
+++ chrome/browser/resources/options/sync_setup_overlay.js (working copy) |
@@ -83,7 +83,7 @@ |
return false; |
}; |
$('cancel-yes-button').onclick = function() { |
- chrome.send('PassphraseCancel', ['']); |
+ chrome.send('SyncSetupPassphraseCancel', ['']); |
return false; |
}; |
$('passphrase-form').onsubmit = $('passphrase-ok').onclick = function() { |
@@ -96,18 +96,22 @@ |
}; |
}, |
+ showOverlay_: function() { |
+ OptionsPage.navigateToPage('syncSetup'); |
+ }, |
+ |
closeOverlay_: function() { |
OptionsPage.closeOverlay(); |
}, |
/** @inheritDoc */ |
didShowPage: function() { |
- chrome.send('didShowPage'); |
+ chrome.send('SyncSetupAttachHandler'); |
}, |
/** @inheritDoc */ |
didClosePage: function() { |
- chrome.send('didClosePage'); |
+ chrome.send('SyncSetupDidClosePage'); |
}, |
showCancelWarning_: function() { |
@@ -120,7 +124,7 @@ |
sendPassphraseAndClose_: function() { |
var f = $('passphrase-form'); |
var result = JSON.stringify({"passphrase": f.passphrase.value}); |
- chrome.send("Passphrase", [result]); |
+ chrome.send('SyncSetupPassphrase', [result]); |
}, |
getRadioCheckedValue_: function() { |
@@ -253,7 +257,7 @@ |
"usePassphrase": (this.getRadioCheckedValue_() == 'explicit'), |
"passphrase": $('custom-passphrase').value |
}); |
- chrome.send("Configure", [result]); |
+ chrome.send('SyncSetupConfigure', [result]); |
}, |
setChooseDataTypesCheckboxes_: function(args) { |
@@ -398,6 +402,10 @@ |
$('choose-datatypes-ok').focus(); |
}, |
+ attach_: function() { |
+ chrome.send('SyncSetupAttachHandler'); |
+ }, |
+ |
showSyncSetupPage_: function(page, args) { |
if (page == 'settingUp') { |
this.setThrobbersVisible_(true); |
@@ -417,8 +425,11 @@ |
this.showConfigure_(args); |
else if (page == 'passphrase') |
this.showPassphrase_(args); |
- else if (page == 'done') |
+ |
+ if (page == 'done') |
this.closeOverlay_(); |
+ else |
+ this.showOverlay_(); |
}, |
setThrobbersVisible_: function(visible) { |
@@ -613,7 +624,7 @@ |
"captcha" : f.captchaValue.value, |
"access_code" : f.accessCode.value}); |
$('sign-in').disabled = true; |
- chrome.send("SubmitAuth", [result]); |
+ chrome.send('SyncSetupSubmitAuth', [result]); |
}, |
showGaiaSuccessAndClose_: function() { |
@@ -628,7 +639,7 @@ |
/** @inheritDoc */ |
shouldClose: function() { |
if (!$('cancel-warning-box').hidden) { |
- chrome.send('PassphraseCancel', ['']); |
+ chrome.send('SyncSetupPassphraseCancel', ['']); |
return true; |
} else if (!$('sync-setup-passphrase').classList.contains('hidden')) { |
// The Passphrase page is showing, and the use has pressed escape. |
@@ -641,6 +652,10 @@ |
}, |
}; |
+ SyncSetupOverlay.showSyncDialog = function() { |
+ SyncSetupOverlay.getInstance().attach_(); |
+ }; |
+ |
SyncSetupOverlay.showSyncSetupPage = function(page, args) { |
SyncSetupOverlay.getInstance().showSyncSetupPage_(page, args); |
}; |