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

Unified Diff: chrome/browser/resources/options2/import_data_overlay.js

Issue 9699050: Update markup for import data markup to work well with uber page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/options2/import_data_overlay.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options2/import_data_overlay.js
===================================================================
--- chrome/browser/resources/options2/import_data_overlay.js (revision 126715)
+++ chrome/browser/resources/options2/import_data_overlay.js (working copy)
@@ -153,11 +153,11 @@
},
/**
- * Clear import prefs set when user checks/unchecks a checkbox so that each
- * checkbox goes back to the default "checked" state (or alternatively, to
- * the state set by a recommended policy).
- * @private
- */
+ * Clear import prefs set when user checks/unchecks a checkbox so that each
+ * checkbox goes back to the default "checked" state (or alternatively, to
+ * the state set by a recommended policy).
+ * @private
+ */
clearUserPrefs_: function() {
var importPrefs = ['import_history',
'import_bookmarks',
@@ -166,6 +166,21 @@
for (var i = 0; i < importPrefs.length; i++)
Preferences.clearPref(importPrefs[i], undefined);
},
+
+ /**
+ * Update the dialog layout to reflect success state.
+ * @param {boolean} success If true, show success dialog elements.
+ * @private
+ */
+ updateSuccessState_: function(success) {
+ var sections = document.querySelectorAll('.import-data-configure');
+ for (var i = 0; i < sections.length; i++)
+ sections[i].hidden = success;
+
+ sections = document.querySelectorAll('.import-data-success');
+ for (var i = 0; i < sections.length; i++)
+ sections[i].hidden = !success;
+ },
};
ImportDataOverlay.clearUserPrefs = function() {
@@ -210,11 +225,21 @@
ImportDataOverlay.confirmSuccess = function() {
var showBookmarksMessage = $('import-favorites').checked;
ImportDataOverlay.setImportingState(false);
- $('import-data-configure').hidden = true;
- $('import-data-success').hidden = false;
$('import-find-your-bookmarks').hidden = !showBookmarksMessage;
+ ImportDataOverlay.getInstance().updateSuccessState_(true);
};
+ /**
+ * Show the import data overlay.
+ */
+ ImportDataOverlay.show = function() {
+ // Make sure that any previous import success message is hidden, and
+ // we're showing the UI to import further data.
+ ImportDataOverlay.getInstance().updateSuccessState_(false);
+
+ OptionsPage.navigateToPage('importData');
+ };
+
// Export
return {
ImportDataOverlay: ImportDataOverlay
« no previous file with comments | « chrome/browser/resources/options2/import_data_overlay.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698