Chromium Code Reviews| OLD | NEW |
|---|---|
| 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="../options2/options_page.js"/> | 6 <include src="../options2/options_page.js"/> |
| 7 <include src="../shared/js/util.js"/> | 7 <include src="../shared/js/util.js"/> |
| 8 <include src="../sync_setup_overlay.js"/> | 8 <include src="../sync_setup_overlay.js"/> |
| 9 | 9 |
| 10 cr.define('sync_promo', function() { | 10 cr.define('sync_promo', function() { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 }, | 55 }, |
| 56 | 56 |
| 57 // Initializes the page. | 57 // Initializes the page. |
| 58 initializePage: function() { | 58 initializePage: function() { |
| 59 options.SyncSetupOverlay.prototype.initializePage.call(this); | 59 options.SyncSetupOverlay.prototype.initializePage.call(this); |
| 60 | 60 |
| 61 // Hide parts of the login UI and show the promo UI. | 61 // Hide parts of the login UI and show the promo UI. |
| 62 this.hideOuterLoginUI_(); | 62 this.hideOuterLoginUI_(); |
| 63 $('promo-skip').hidden = false; | 63 $('promo-skip').hidden = false; |
| 64 | 64 |
| 65 this.showSetupUI_(); | |
|
Evan Stade
2012/08/11 00:36:12
this is redundant with the Initialize right below.
| |
| 66 chrome.send('SyncPromo:Initialize'); | 65 chrome.send('SyncPromo:Initialize'); |
| 67 | 66 |
| 68 var self = this; | 67 var self = this; |
| 69 | 68 |
| 70 $('promo-skip-button').addEventListener('click', function() { | 69 $('promo-skip-button').addEventListener('click', function() { |
| 71 chrome.send('SyncPromo:UserSkipped'); | 70 chrome.send('SyncPromo:UserSkipped'); |
| 72 self.closeOverlay_(); | 71 self.closeOverlay_(); |
| 73 }); | 72 }); |
| 74 | 73 |
| 75 var learnMoreClickedAlready = false; | 74 var learnMoreClickedAlready = false; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 185 * The start time of a throbber on the page. | 184 * The start time of a throbber on the page. |
| 186 * @private | 185 * @private |
| 187 */ | 186 */ |
| 188 throbberStart_: 0, | 187 throbberStart_: 0, |
| 189 }; | 188 }; |
| 190 | 189 |
| 191 SyncPromo.showErrorUI = function() { | 190 SyncPromo.showErrorUI = function() { |
| 192 SyncPromo.getInstance().showErrorUI_(); | 191 SyncPromo.getInstance().showErrorUI_(); |
| 193 }; | 192 }; |
| 194 | 193 |
| 195 SyncPromo.showSetupUI = function() { | |
| 196 SyncPromo.getInstance().showSetupUI_(); | |
| 197 }; | |
| 198 | |
| 199 SyncPromo.showSyncSetupPage = function(page, args) { | 194 SyncPromo.showSyncSetupPage = function(page, args) { |
| 200 SyncPromo.getInstance().showSyncSetupPage_(page, args); | 195 SyncPromo.getInstance().showSyncSetupPage_(page, args); |
| 201 }; | 196 }; |
| 202 | 197 |
| 203 SyncPromo.showSuccessAndClose = function() { | 198 SyncPromo.showSuccessAndClose = function() { |
| 204 SyncPromo.getInstance().showSuccessAndClose_(); | 199 SyncPromo.getInstance().showSuccessAndClose_(); |
| 205 }; | 200 }; |
| 206 | 201 |
| 207 SyncPromo.showSuccessAndSettingUp = function() { | 202 SyncPromo.showSuccessAndSettingUp = function() { |
| 208 chrome.send('SyncPromo:UserFlowAction', [actions.SIGNED_IN_SUCCESSFULLY]); | 203 chrome.send('SyncPromo:UserFlowAction', [actions.SIGNED_IN_SUCCESSFULLY]); |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 229 return { | 224 return { |
| 230 SyncPromo: SyncPromo | 225 SyncPromo: SyncPromo |
| 231 }; | 226 }; |
| 232 }); | 227 }); |
| 233 | 228 |
| 234 var OptionsPage = options.OptionsPage; | 229 var OptionsPage = options.OptionsPage; |
| 235 var SyncSetupOverlay = sync_promo.SyncPromo; | 230 var SyncSetupOverlay = sync_promo.SyncPromo; |
| 236 window.addEventListener('DOMContentLoaded', sync_promo.SyncPromo.initialize); | 231 window.addEventListener('DOMContentLoaded', sync_promo.SyncPromo.initialize); |
| 237 window.addEventListener('beforeunload', | 232 window.addEventListener('beforeunload', |
| 238 sync_promo.SyncPromo.recordPageViewActions.bind(sync_promo.SyncPromo)); | 233 sync_promo.SyncPromo.recordPageViewActions.bind(sync_promo.SyncPromo)); |
| OLD | NEW |