| 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 A helper object used from the the Import Data dialog to allow | 6 * @fileoverview A helper object used from the the Import Data dialog to allow |
| 7 * users to import data (like bookmarks) from other web browsers. | 7 * users to import data (like bookmarks) from other web browsers. |
| 8 */ | 8 */ |
| 9 cr.exportPath('settings'); | 9 cr.exportPath('settings'); |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 * Starts importing data for the specificed source browser profile. The C++ | 49 * Starts importing data for the specificed source browser profile. The C++ |
| 50 * responds with the 'import-data-status-changed' WebUIListener event. | 50 * responds with the 'import-data-status-changed' WebUIListener event. |
| 51 * @param {number} sourceBrowserProfileIndex | 51 * @param {number} sourceBrowserProfileIndex |
| 52 */ | 52 */ |
| 53 importData: function(sourceBrowserProfileIndex) {}, | 53 importData: function(sourceBrowserProfileIndex) {}, |
| 54 | 54 |
| 55 /** | 55 /** |
| 56 * Prompts the user to choose a bookmarks file to import bookmarks from. | 56 * Prompts the user to choose a bookmarks file to import bookmarks from. |
| 57 */ | 57 */ |
| 58 importFromBookmarksFile: function() {}, | 58 importFromBookmarksFile: function() {}, |
| 59 |
| 60 /** |
| 61 * Close the import lock dialog if it is opened. |
| 62 */ |
| 63 closeImportLockDialog: function() {}, |
| 59 }; | 64 }; |
| 60 | 65 |
| 61 /** | 66 /** |
| 62 * @constructor | 67 * @constructor |
| 63 * @implements {settings.ImportDataBrowserProxy} | 68 * @implements {settings.ImportDataBrowserProxy} |
| 64 */ | 69 */ |
| 65 function ImportDataBrowserProxyImpl() {} | 70 function ImportDataBrowserProxyImpl() {} |
| 66 // The singleton instance_ is replaced with a test version of this wrapper | 71 // The singleton instance_ is replaced with a test version of this wrapper |
| 67 // during testing. | 72 // during testing. |
| 68 cr.addSingletonGetter(ImportDataBrowserProxyImpl); | 73 cr.addSingletonGetter(ImportDataBrowserProxyImpl); |
| 69 | 74 |
| 70 ImportDataBrowserProxyImpl.prototype = { | 75 ImportDataBrowserProxyImpl.prototype = { |
| 71 /** @override */ | 76 /** @override */ |
| 72 initializeImportDialog: function() { | 77 initializeImportDialog: function() { |
| 73 return cr.sendWithPromise('initializeImportDialog'); | 78 return cr.sendWithPromise('initializeImportDialog'); |
| 74 }, | 79 }, |
| 75 | 80 |
| 76 /** @override */ | 81 /** @override */ |
| 77 importData: function(sourceBrowserProfileIndex) { | 82 importData: function(sourceBrowserProfileIndex) { |
| 78 chrome.send('importData', [sourceBrowserProfileIndex]); | 83 chrome.send('importData', [sourceBrowserProfileIndex]); |
| 79 }, | 84 }, |
| 80 | 85 |
| 81 /** @override */ | 86 /** @override */ |
| 82 importFromBookmarksFile: function() { | 87 importFromBookmarksFile: function() { |
| 83 chrome.send('importFromBookmarksFile'); | 88 chrome.send('importFromBookmarksFile'); |
| 84 }, | 89 }, |
| 90 |
| 91 /** @override */ |
| 92 closeImportLockDialog: function() { |
| 93 chrome.send('closeImportLockDialog'); |
| 94 }, |
| 85 }; | 95 }; |
| 86 | 96 |
| 87 return { | 97 return { |
| 88 ImportDataBrowserProxy: ImportDataBrowserProxy, | 98 ImportDataBrowserProxy: ImportDataBrowserProxy, |
| 89 ImportDataBrowserProxyImpl: ImportDataBrowserProxyImpl, | 99 ImportDataBrowserProxyImpl: ImportDataBrowserProxyImpl, |
| 90 }; | 100 }; |
| 91 }); | 101 }); |
| OLD | NEW |