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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 /** @private */ | 122 /** @private */ |
123 onActionButtonTap_: function() { | 123 onActionButtonTap_: function() { |
124 if (this.isImportFromFileSelected_()) | 124 if (this.isImportFromFileSelected_()) |
125 this.browserProxy_.importFromBookmarksFile(); | 125 this.browserProxy_.importFromBookmarksFile(); |
126 else | 126 else |
127 this.browserProxy_.importData(this.$.browserSelect.selectedIndex); | 127 this.browserProxy_.importData(this.$.browserSelect.selectedIndex); |
128 }, | 128 }, |
129 | 129 |
130 /** @private */ | 130 /** @private */ |
131 closeDialog_: function() { | 131 closeDialog_: function() { |
| 132 // It's possible for the user to close the import dialog while a |
| 133 // sub-dialog is still showing. Make sure to close that sub-dialog as well. |
| 134 this.browserProxy_.closeImportLockDialog(); |
132 this.$.dialog.close(); | 135 this.$.dialog.close(); |
133 }, | 136 }, |
134 | 137 |
135 /** | 138 /** |
136 * @return {boolean} Whether the import button should be disabled. | 139 * @return {boolean} Whether the import button should be disabled. |
137 * @private | 140 * @private |
138 */ | 141 */ |
139 shouldDisableImport_: function() { | 142 shouldDisableImport_: function() { |
140 return this.hasImportStatus_(settings.ImportDataStatus.IN_PROGRESS) || | 143 return this.hasImportStatus_(settings.ImportDataStatus.IN_PROGRESS) || |
141 this.noImportDataTypeSelected_; | 144 this.noImportDataTypeSelected_; |
142 }, | 145 }, |
143 }); | 146 }); |
OLD | NEW |