Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7923)

Unified Diff: chrome/browser/resources/sync_promo/sync_promo.js

Issue 10831273: Handle refresh on sync setup page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clobber on reload Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/sync_promo/sync_promo.js
diff --git a/chrome/browser/resources/sync_promo/sync_promo.js b/chrome/browser/resources/sync_promo/sync_promo.js
index 3173b8259c94011f2e7b098a3555107bedb930d0..4ce8299dba79089201357d183bb295e2304d876b 100644
--- a/chrome/browser/resources/sync_promo/sync_promo.js
+++ b/chrome/browser/resources/sync_promo/sync_promo.js
@@ -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));
« no previous file with comments | « no previous file | chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698