| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 /** | 5 /** |
| 6 * @fileoverview 'settings-import-data-dialog' is a component for importing | 6 * @fileoverview 'settings-import-data-dialog' is a component for importing |
| 7 * bookmarks and other data from other sources. | 7 * bookmarks and other data from other sources. |
| 8 */ | 8 */ |
| 9 Polymer({ | 9 Polymer({ |
| 10 is: 'settings-import-data-dialog', | 10 is: 'settings-import-data-dialog', |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 function(importStatus) { | 70 function(importStatus) { |
| 71 this.importStatus_ = importStatus; | 71 this.importStatus_ = importStatus; |
| 72 if (this.hasImportStatus_(settings.ImportDataStatus.FAILED)) | 72 if (this.hasImportStatus_(settings.ImportDataStatus.FAILED)) |
| 73 this.closeDialog_(); | 73 this.closeDialog_(); |
| 74 }.bind(this)); | 74 }.bind(this)); |
| 75 }, | 75 }, |
| 76 | 76 |
| 77 /** @private */ | 77 /** @private */ |
| 78 prefsChanged_: function() { | 78 prefsChanged_: function() { |
| 79 this.noImportDataTypeSelected_ = | 79 this.noImportDataTypeSelected_ = |
| 80 !(this.getPref('import_history').value && this.selected_.history) && | 80 !(this.getPref('import_dialog_history').value && |
| 81 !(this.getPref('import_bookmarks').value && this.selected_.favorites) && | 81 this.selected_.history) && |
| 82 !(this.getPref('import_saved_passwords').value && | 82 !(this.getPref('import_dialog_bookmarks').value && |
| 83 this.selected_.passwords) && | 83 this.selected_.favorites) && |
| 84 !(this.getPref('import_search_engine').value && | 84 !(this.getPref('import_dialog_saved_passwords').value && |
| 85 this.selected_.search) && | 85 this.selected_.passwords) && |
| 86 !(this.getPref('import_autofill_form_data').value && | 86 !(this.getPref('import_dialog_search_engine').value && |
| 87 this.selected_.autofillFormData); | 87 this.selected_.search) && |
| 88 !(this.getPref('import_dialog_autofill_form_data').value && |
| 89 this.selected_.autofillFormData); |
| 88 }, | 90 }, |
| 89 | 91 |
| 90 /** | 92 /** |
| 91 * @param {!settings.ImportDataStatus} status | 93 * @param {!settings.ImportDataStatus} status |
| 92 * @return {boolean} Whether |status| is the current status. | 94 * @return {boolean} Whether |status| is the current status. |
| 93 * @private | 95 * @private |
| 94 */ | 96 */ |
| 95 hasImportStatus_: function(status) { | 97 hasImportStatus_: function(status) { |
| 96 return this.importStatus_ == status; | 98 return this.importStatus_ == status; |
| 97 }, | 99 }, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 134 |
| 133 /** | 135 /** |
| 134 * @return {boolean} Whether the import button should be disabled. | 136 * @return {boolean} Whether the import button should be disabled. |
| 135 * @private | 137 * @private |
| 136 */ | 138 */ |
| 137 shouldDisableImport_: function() { | 139 shouldDisableImport_: function() { |
| 138 return this.hasImportStatus_(settings.ImportDataStatus.IN_PROGRESS) || | 140 return this.hasImportStatus_(settings.ImportDataStatus.IN_PROGRESS) || |
| 139 this.noImportDataTypeSelected_; | 141 this.noImportDataTypeSelected_; |
| 140 }, | 142 }, |
| 141 }); | 143 }); |
| OLD | NEW |