Commit f442ce24 authored by estade@chromium.org's avatar estade@chromium.org

Handle refresh on sync setup page.

BUG=138338,141682

Review URL: https://chromiumcodereview.appspot.com/10831273

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151405 0039d316-1c4b-4281-b951-d872f2087c98
parent e33c427c
......@@ -62,7 +62,6 @@ cr.define('sync_promo', function() {
this.hideOuterLoginUI_();
$('promo-skip').hidden = false;
this.showSetupUI_();
chrome.send('SyncPromo:Initialize');
var self = this;
......@@ -140,14 +139,16 @@ cr.define('sync_promo', function() {
},
/**
* Called when the page is unloading to record number of times a user tried
* to sign in and if they left while a throbber was running.
* Called when the page is unloading.
* @private
*/
recordPageViewActions_: function() {
onUnload: function() {
// Record number of times a user tried to sign in and if they left
// while a throbber was running.
chrome.send('SyncPromo:RecordSignInAttempts', [this.signInAttempts_]);
if (this.throbberStart_)
chrome.send('SyncPromo:UserFlowAction', [actions.LEFT_DURING_THROBBER]);
chrome.send('SyncSetupDidClosePage');
},
/** @inheritDoc */
......@@ -192,10 +193,6 @@ cr.define('sync_promo', function() {
SyncPromo.getInstance().showErrorUI_();
};
SyncPromo.showSetupUI = function() {
SyncPromo.getInstance().showSetupUI_();
};
SyncPromo.showSyncSetupPage = function(page, args) {
SyncPromo.getInstance().showSyncSetupPage_(page, args);
};
......@@ -217,8 +214,8 @@ cr.define('sync_promo', function() {
SyncPromo.getInstance().initializePage();
};
SyncPromo.recordPageViewActions = function() {
SyncPromo.getInstance().recordPageViewActions_();
SyncPromo.onUnload = function() {
SyncPromo.getInstance().onUnload();
};
SyncPromo.populatePromoMessage = function(resName) {
......@@ -234,5 +231,5 @@ cr.define('sync_promo', function() {
var OptionsPage = options.OptionsPage;
var SyncSetupOverlay = sync_promo.SyncPromo;
window.addEventListener('DOMContentLoaded', sync_promo.SyncPromo.initialize);
window.addEventListener('beforeunload',
sync_promo.SyncPromo.recordPageViewActions.bind(sync_promo.SyncPromo));
window.addEventListener('unload',
sync_promo.SyncPromo.onUnload.bind(sync_promo.SyncPromo));
......@@ -209,10 +209,6 @@ void SyncPromoHandler::HandleCloseSyncPromo(const base::ListValue* args) {
}
void SyncPromoHandler::HandleInitializeSyncPromo(const base::ListValue* args) {
// If this is a page reload, then we have to inform the login service
// the old UI closed. If this is an initial load, this call will do nothing.
GetLoginUIService()->LoginUIClosed(this);
// Open the sync wizard to the login screen.
OpenSyncSetup(true);
// We don't need to compute anything for this, just do this every time.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment