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

Side by Side Diff: chrome/browser/resources/sync_promo/sync_promo.js

Issue 9836093: Sync promo: Only show skip button on startup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/sync_promo/sync_promo.css ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // TODO(sail): Refactor options_page and remove this include. 5 // TODO(sail): Refactor options_page and remove this include.
6 <include src="../options/options_page.js"/> 6 <include src="../options/options_page.js"/>
7 <include src="../sync_setup_overlay.js"/> 7 <include src="../sync_setup_overlay.js"/>
Dan Beam 2012/03/26 22:09:00 can you put <script src="chrome://resources/js/ut
sail 2012/03/26 22:34:44 Done.
8 8
9 cr.define('sync_promo', function() { 9 cr.define('sync_promo', function() {
10 /** 10 /**
11 * SyncPromo class 11 * SyncPromo class
12 * Subclass of options.SyncSetupOverlay that customizes the sync setup 12 * Subclass of options.SyncSetupOverlay that customizes the sync setup
13 * overlay for use in the new tab page. 13 * overlay for use in the new tab page.
14 * @class 14 * @class
15 */ 15 */
16 function SyncPromo() { 16 function SyncPromo() {
17 options.SyncSetupOverlay.call(this, 'syncSetup', 17 options.SyncSetupOverlay.call(this, 'syncSetup',
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 advancedOptionsClickedAlready = true; 125 advancedOptionsClickedAlready = true;
126 }); 126 });
127 127
128 // Re-used across both cancel buttons after a successful sign in. 128 // Re-used across both cancel buttons after a successful sign in.
129 var cancelFunc = function() { 129 var cancelFunc = function() {
130 chrome.send('SyncPromo:UserFlowAction', 130 chrome.send('SyncPromo:UserFlowAction',
131 [actions.CANCELLED_AFTER_SIGN_IN]); 131 [actions.CANCELLED_AFTER_SIGN_IN]);
132 }; 132 };
133 $('confirm-everything-cancel').addEventListener('click', cancelFunc); 133 $('confirm-everything-cancel').addEventListener('click', cancelFunc);
134 $('choose-datatypes-cancel').addEventListener('click', cancelFunc); 134 $('choose-datatypes-cancel').addEventListener('click', cancelFunc);
135
136 // Add the source parameter to the document so that it can be used to
137 // selectively show and hide elements using CSS.
138 var params = parseQueryParams(document.location);
139 if (params.source != '0')
140 document.documentElement.setAttribute('promoNotStartup', true);
Dan Beam 2012/03/26 22:09:00 nit: I think we tend to use all lower case because
sail 2012/03/26 22:34:44 Done.
135 }, 141 },
136 142
137 /** 143 /**
138 * Called when the page is unloading to record number of times a user tried 144 * Called when the page is unloading to record number of times a user tried
139 * to sign in and if they left while a throbber was running. 145 * to sign in and if they left while a throbber was running.
140 * @private 146 * @private
141 */ 147 */
142 recordPageViewActions_: function() { 148 recordPageViewActions_: function() {
143 chrome.send('SyncPromo:RecordSignInAttempts', [this.signInAttempts_]); 149 chrome.send('SyncPromo:RecordSignInAttempts', [this.signInAttempts_]);
144 if (this.throbberStart_) 150 if (this.throbberStart_)
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 return { 230 return {
225 SyncPromo: SyncPromo 231 SyncPromo: SyncPromo
226 }; 232 };
227 }); 233 });
228 234
229 var OptionsPage = options.OptionsPage; 235 var OptionsPage = options.OptionsPage;
230 var SyncSetupOverlay = sync_promo.SyncPromo; 236 var SyncSetupOverlay = sync_promo.SyncPromo;
231 window.addEventListener('DOMContentLoaded', sync_promo.SyncPromo.initialize); 237 window.addEventListener('DOMContentLoaded', sync_promo.SyncPromo.initialize);
232 window.addEventListener('beforeunload', 238 window.addEventListener('beforeunload',
233 sync_promo.SyncPromo.recordPageViewActions.bind(sync_promo.SyncPromo)); 239 sync_promo.SyncPromo.recordPageViewActions.bind(sync_promo.SyncPromo));
OLDNEW
« no previous file with comments | « chrome/browser/resources/sync_promo/sync_promo.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698