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

Unified Diff: chrome/browser/resources/options/sync_setup_overlay.js

Issue 7093004: Sync: Refactor the ProfileSyncService and sync setup flow to remove use of WebUI from PSS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes and cleanups. Created 9 years, 6 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 | « chrome/browser/resources/options/personal_options.js ('k') | chrome/browser/sync/profile_sync_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/sync_setup_overlay.js
diff --git a/chrome/browser/resources/options/sync_setup_overlay.js b/chrome/browser/resources/options/sync_setup_overlay.js
index 1caecc8b9711e0167b8c6f2ef97e7c46cb7f800b..ef40ddee11711407a9521b091dc7f8e7b337d2ec 100644
--- a/chrome/browser/resources/options/sync_setup_overlay.js
+++ b/chrome/browser/resources/options/sync_setup_overlay.js
@@ -269,12 +269,6 @@ cr.define('options', function() {
},
setChooseDataTypesCheckboxes_: function(args) {
- // If this frame is on top, the focus should be on it, so pressing enter
- // submits this form.
- if (args.iframeToShow == 'configure') {
- $('choose-datatypes-ok').focus();
- }
-
var datatypeSelect = document.getElementById('sync-select-datatypes');
datatypeSelect.selectedIndex = args.keepEverythingSynced ? 0 : 1;
@@ -359,7 +353,6 @@ cr.define('options', function() {
this.setErrorState_(args);
},
- // Called once, when this html/js is loaded.
showConfigure_: function(args) {
var datatypeSelect = document.getElementById('sync-select-datatypes');
var self = this;
@@ -456,6 +449,9 @@ cr.define('options', function() {
var index = syncEverything ? 0 : 1;
document.getElementById('sync-select-datatypes').selectedIndex = index;
this.setDataTypeCheckboxesEnabled_(!syncEverything);
+
+ // The passphrase input may need to take over focus from the OK button, so
+ // set focus before that logic.
$('choose-datatypes-ok').focus();
if (args && args['show_passphrase'])
@@ -700,22 +696,21 @@ cr.define('options', function() {
$('sign-in').value = localStrings.getString('settingUp');
},
- /** @inheritDoc */
- shouldClose: function() {
- if (!$('cancel-warning-box').hidden) {
- chrome.send('SyncSetupPassphraseCancel', ['']);
- return true;
- } else if (!$('sync-setup-passphrase').hidden) {
- // The Passphrase page is showing, and the use has pressed escape.
- // Activate the cancel logic in this case.
- this.showCancelWarning_();
- return false;
- }
-
- return true;
+ /**
+ * Initiates attachment to the Sync setup flow and steps into the
+ * appropriate error UI.
+ * @private
+ */
+ showErrorUI_: function() {
+ this.attach_();
+ chrome.send('SyncSetupShowErrorUI');
},
};
+ SyncSetupOverlay.showErrorUI = function() {
+ SyncSetupOverlay.getInstance().showErrorUI_();
+ };
+
SyncSetupOverlay.showSyncDialog = function() {
SyncSetupOverlay.getInstance().attach_();
};
« no previous file with comments | « chrome/browser/resources/options/personal_options.js ('k') | chrome/browser/sync/profile_sync_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698