MD-Settings - Update dialog for federated text in passwords dialog.

Screenshot in bug.

R=dbeam@chromium.org
BUG=706310
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2844553003
Cr-Commit-Position: refs/heads/master@{#467452}
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/password_edit_dialog.html b/chrome/browser/resources/settings/passwords_and_forms_page/password_edit_dialog.html
index bb50157..0738762 100644
--- a/chrome/browser/resources/settings/passwords_and_forms_page/password_edit_dialog.html
+++ b/chrome/browser/resources/settings/passwords_and_forms_page/password_edit_dialog.html
@@ -50,11 +50,12 @@
         <div id="passwordGroup">
           <paper-input id="passwordInput" always-float-label
               label="$i18n{editPasswordPasswordLabel}"
-              type="[[getPasswordInputType_(password)]]"
+              type="[[getPasswordInputType_(item, password)]]"
               value="[[getPassword_(item, password)]]" readonly
             on-tap="onReadonlyInputTap_">
           </paper-input>
           <paper-icon-button id="showPasswordButton"
+              hidden$="[[item.federationText]]"
               icon="settings:visibility" on-tap="onShowPasswordButtonTap_"
               title="[[showPasswordTitle_(password,
                   '$i18nPolymer{hidePassword}','$i18nPolymer{showPassword}')]]">
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/password_edit_dialog.js b/chrome/browser/resources/settings/passwords_and_forms_page/password_edit_dialog.js
index cb9aa3f..94f958b 100644
--- a/chrome/browser/resources/settings/passwords_and_forms_page/password_edit_dialog.js
+++ b/chrome/browser/resources/settings/passwords_and_forms_page/password_edit_dialog.js
@@ -37,12 +37,11 @@
 
   /**
    * Gets the password input's type. Should be 'text' when password is visible
-   * and 'password' when it's not.
-   * @param {string} password
+   * or when there's federated text otherwise 'password'.
    * @private
    */
-  getPasswordInputType_: function(password) {
-    return password ? 'text' : 'password';
+  getPasswordInputType_: function() {
+    return this.password || this.item.federationText ? 'text' : 'password';
   },
 
   /**
@@ -58,15 +57,16 @@
 
   /**
    * Gets the text of the password. Will use the value of |password| unless it
-   * cannot be shown, in which case it will be spaces.
-   * @param {!chrome.passwordsPrivate.PasswordUiEntry} item
-   * @param {string} password
+   * cannot be shown, in which case it will be spaces. It can also be the
+   * federated text.
    * @private
    */
-  getPassword_: function(item, password) {
-    if (password)
-      return password;
-    return item ? ' '.repeat(item.numCharactersInPassword) : '';
+  getPassword_: function() {
+    if (!this.item)
+      return '';
+
+    return this.item.federationText || this.password ||
+        ' '.repeat(this.item.numCharactersInPassword);
   },
 
   /**