Index: chrome/browser/resources/options/personal_options.js |
diff --git a/chrome/browser/resources/options/personal_options.js b/chrome/browser/resources/options/personal_options.js |
index 930be56c278c62d5c2657d5f9d01db97779c9422..8775ec0ca8ced98f51eb343f9e71f44fae4fa001 100644 |
--- a/chrome/browser/resources/options/personal_options.js |
+++ b/chrome/browser/resources/options/personal_options.js |
@@ -80,8 +80,9 @@ cr.define('options', function() { |
if (cr.commandLine.options['--bwsi']) { |
// Disable the screen lock checkbox for the guest mode. |
$('enable-screen-lock').disabled = true; |
+ } |
- // Disable passwords management settings for the guest mode. |
+ if (PersonalOptions.disablePasswordManagement()) { |
$('passwords-offersave').disabled = true; |
$('passwords-neversave').disabled = true; |
$('passwords-offersave').value = false; |
@@ -184,6 +185,15 @@ cr.define('options', function() { |
}, |
}; |
+ /** |
+ * Returns whether the user should be able to manage (view and edit) their |
+ * stored passwords. Password management is disabled in guest mode. |
+ * @return {boolean} True if password management should be disabled. |
+ */ |
+ PersonalOptions.disablePasswordManagement = function() { |
+ return cr.commandLine.options['--bwsi']; |
+ }; |
+ |
// Forward public APIs to private implementations. |
[ |
'setSyncEnabled', |