| Index: chrome/browser/resources/options/password_manager.js
|
| diff --git a/chrome/browser/resources/options/password_manager.js b/chrome/browser/resources/options/password_manager.js
|
| index 6e16ebac5e14d48e2cba966de98e8638f585fa26..9c8daac5c6f5d38315ff9e1d675ba34743c5c2d3 100644
|
| --- a/chrome/browser/resources/options/password_manager.js
|
| +++ b/chrome/browser/resources/options/password_manager.js
|
| @@ -59,6 +59,8 @@ cr.define('options', function() {
|
| initializePage: function() {
|
| Page.prototype.initializePage.call(this);
|
|
|
| + var self = this;
|
| +
|
| $('auto-signin-block').hidden =
|
| !loadTimeData.getBoolean('enableCredentialManagerAPI');
|
|
|
| @@ -66,8 +68,20 @@ cr.define('options', function() {
|
| PageManager.closeOverlay();
|
| };
|
|
|
| + $('password-manager-import-confirm').onclick = function() {
|
| + self.setImportCompleteUIVisibility_(false);
|
| + };
|
| +
|
| + $('password-manager-import').onclick = function() {
|
| + chrome.send('importPassword');
|
| + };
|
| +
|
| + $('password-manager-export').onclick = function() {
|
| + chrome.send('exportPassword');
|
| + };
|
| +
|
| $('password-search-box').addEventListener('search',
|
| - this.handleSearchQueryChange_.bind(this));
|
| + this.handleSearchQueryChange_.bind(this));
|
|
|
| $('exceptions-learn-more').onclick = function() {
|
| chrome.send('coreOptionsUserMetricsAction',
|
| @@ -89,6 +103,7 @@ cr.define('options', function() {
|
| // Updating the password lists may cause a blocking platform dialog pop up
|
| // (Mac, Linux), so we delay this operation until the page is shown.
|
| chrome.send('updatePasswordLists');
|
| + this.setImportCompleteUIVisibility_(false);
|
| $('password-search-box').focus();
|
| },
|
|
|
| @@ -233,6 +248,30 @@ cr.define('options', function() {
|
| setManageAccountLinkVisibility_: function(visible) {
|
| $('manage-passwords-span').hidden = !visible;
|
| },
|
| +
|
| + /**
|
| + * @param {boolean} visible Whether the import-password-complete UI should
|
| + * be visible
|
| + * @private
|
| + */
|
| + setImportCompleteUIVisibility_: function(visible) {
|
| + var sections = document.querySelectorAll('.password-manager-default');
|
| + for (var i = 0; i < sections.length; i++) {
|
| + if (sections[i].disabled != true) {
|
| + sections[i].hidden = visible;
|
| + }
|
| + }
|
| + sections = document.querySelectorAll('.import-password-complete');
|
| + for (var i = 0; i < sections.length; i++)
|
| + sections[i].hidden = !visible;
|
| + },
|
| +
|
| + showImportExportButton_: function() {
|
| + $('password-manager-import').hidden = false;
|
| + $('password-manager-export').hidden = false;
|
| + $('password-manager-import').disabled = false;
|
| + $('password-manager-export').disabled = false;
|
| + },
|
| };
|
|
|
| /**
|
| @@ -240,8 +279,8 @@ cr.define('options', function() {
|
| * @param {number} rowIndex indicating the row to remove.
|
| */
|
| PasswordManager.removeSavedPassword = function(rowIndex) {
|
| - chrome.send('removeSavedPassword', [String(rowIndex)]);
|
| - chrome.send('coreOptionsUserMetricsAction',
|
| + chrome.send('removeSavedPassword', [String(rowIndex)]);
|
| + chrome.send('coreOptionsUserMetricsAction',
|
| ['Options_PasswordManagerDeletePassword']);
|
| };
|
|
|
| @@ -250,7 +289,7 @@ cr.define('options', function() {
|
| * @param {number} rowIndex indicating the row to remove.
|
| */
|
| PasswordManager.removePasswordException = function(rowIndex) {
|
| - chrome.send('removePasswordException', [String(rowIndex)]);
|
| + chrome.send('removePasswordException', [String(rowIndex)]);
|
| };
|
|
|
| PasswordManager.requestShowPassword = function(index) {
|
| @@ -262,7 +301,9 @@ cr.define('options', function() {
|
| 'setManageAccountLinkVisibility',
|
| 'setSavedPasswordsList',
|
| 'setPasswordExceptionsList',
|
| - 'showPassword'
|
| + 'showPassword',
|
| + 'setImportCompleteUIVisibility',
|
| + 'showImportExportButton'
|
| ]);
|
|
|
| // Export
|
|
|