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 3e501727ff7b904a63df1d7a3843d10c35f21985..f29cef857508ff57c24649fed58850a3f0bdf26e 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,16 @@ cr.define('options', function() { |
PageManager.closeOverlay(); |
}; |
+ $('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', |
@@ -228,6 +238,19 @@ cr.define('options', function() { |
var item = this.savedPasswordsList_.getListItemByIndex(index); |
item.showPassword(password); |
}, |
+ |
+ /** |
+ * @param {boolean} visible Whether the link should be visible. |
+ * @private |
+ */ |
+ setManageAccountLinkVisibility_: function(visible) { |
+ $('manage-passwords-span').hidden = !visible; |
+ }, |
+ |
+ showImportExportButton_: function() { |
+ $('password-manager-import').disabled = false; |
+ $('password-manager-export').disabled = false; |
+ }, |
}; |
/** |
@@ -235,8 +258,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']); |
}; |
@@ -245,7 +268,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) { |
@@ -256,7 +279,9 @@ cr.define('options', function() { |
cr.makePublic(PasswordManager, [ |
'setSavedPasswordsList', |
'setPasswordExceptionsList', |
- 'showPassword' |
+ 'showPassword', |
+ 'setImportCompleteUiVisibility', |
+ 'showImportExportButton' |
]); |
// Export |