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

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

Issue 22560003: Reland "Add option to import from bookmarks html file to ..."" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: does this fix first run browser_tests for bots? Created 7 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
Index: chrome/browser/resources/options/import_data_overlay.js
diff --git a/chrome/browser/resources/options/import_data_overlay.js b/chrome/browser/resources/options/import_data_overlay.js
index f66fde83c287777733ccfcc7add4d9cc12a3f377..36bc8668b5c87988906ce25b25a2d4696f484e29 100644
--- a/chrome/browser/resources/options/import_data_overlay.js
+++ b/chrome/browser/resources/options/import_data_overlay.js
@@ -58,6 +58,10 @@ cr.define('options', function() {
ImportDataOverlay.dismiss();
};
+ $('import-choose-file').onclick = function() {
+ chrome.send('chooseBookmarksFile');
+ };
+
$('import-data-show-bookmarks-bar').onchange = function() {
// Note: The callback 'toggleShowBookmarksBar' is handled within the
// browser options handler -- rather than the import data handler --
@@ -117,6 +121,10 @@ cr.define('options', function() {
*/
updateCheckboxes_: function() {
var index = $('import-browsers').selectedIndex;
+ var bookmarksFileSelected = index == this.browserProfiles.length - 1;
+ $('import-choose-file').hidden = !bookmarksFileSelected;
+ $('import-data-commit').hidden = bookmarksFileSelected;
+
var browserProfile;
if (this.browserProfiles.length > index)
browserProfile = this.browserProfiles[index];
@@ -124,6 +132,7 @@ cr.define('options', function() {
for (var i = 0; i < importOptions.length; i++) {
var checkbox = $('import-' + importOptions[i]);
var enable = browserProfile && browserProfile[importOptions[i]];
+ checkbox.checked = enable;
this.setUpCheckboxState_(checkbox, enable);
var checkboxWithLabel = $('import-' + importOptions[i] + '-with-label');
checkboxWithLabel.style.display = enable ? '' : 'none';

Powered by Google App Engine
This is Rietveld 408576698