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 cr.define('options', function() { | 5 cr.define('options', function() { |
6 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 | 7 |
8 /** | 8 /** |
9 * ImportDataOverlay class | 9 * ImportDataOverlay class |
10 * Encapsulated handling of the 'Import Data' overlay page. | 10 * Encapsulated handling of the 'Import Data' overlay page. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 /** | 80 /** |
81 * Sets the enabled and checked state of the commit button. | 81 * Sets the enabled and checked state of the commit button. |
82 * @private | 82 * @private |
83 */ | 83 */ |
84 validateCommitButton_: function() { | 84 validateCommitButton_: function() { |
85 var somethingToImport = | 85 var somethingToImport = |
86 $('import-history').checked || $('import-favorites').checked || | 86 $('import-history').checked || $('import-favorites').checked || |
87 $('import-passwords').checked || $('import-search').checked; | 87 $('import-passwords').checked || $('import-search').checked; |
88 $('import-data-commit').disabled = !somethingToImport; | 88 $('import-data-commit').disabled = !somethingToImport; |
| 89 $('import-choose-file').disabled = !$('import-favorites').checked; |
89 }, | 90 }, |
90 | 91 |
91 /** | 92 /** |
92 * Sets the enabled state of all the checkboxes and the commit button. | 93 * Sets the enabled state of all the checkboxes and the commit button. |
93 * @private | 94 * @private |
94 */ | 95 */ |
95 setAllControlsEnabled_: function(enabled) { | 96 setAllControlsEnabled_: function(enabled) { |
96 var checkboxes = | 97 var checkboxes = |
97 document.querySelectorAll('#import-checkboxes input[type=checkbox]'); | 98 document.querySelectorAll('#import-checkboxes input[type=checkbox]'); |
98 for (var i = 0; i < checkboxes.length; i++) | 99 for (var i = 0; i < checkboxes.length; i++) |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 ImportDataOverlay.getInstance().validateCommitButton_(); | 267 ImportDataOverlay.getInstance().validateCommitButton_(); |
267 | 268 |
268 OptionsPage.navigateToPage('importData'); | 269 OptionsPage.navigateToPage('importData'); |
269 }; | 270 }; |
270 | 271 |
271 // Export | 272 // Export |
272 return { | 273 return { |
273 ImportDataOverlay: ImportDataOverlay | 274 ImportDataOverlay: ImportDataOverlay |
274 }; | 275 }; |
275 }); | 276 }); |
OLD | NEW |