summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.js
blob: b46e9fb3b2389df1a434bc8350d6d947227cd203 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * @fileoverview 'settings-passwords-and-forms-page' is the settings page
 * for passwords and auto fill.
 *
 * @group Chrome Settings Elements
 * @element settings-passwords-and-forms-page
 */
(function() {
'use strict';

Polymer({
  is: 'settings-passwords-and-forms-page',

  properties: {
    /**
     * Preferences state.
     */
    prefs: {
      type: Object,
      notify: true,
    },

    /**
     * An array of passwords to display.
     * Lazy loaded when the password section is expanded.
     */
    savedPasswords: {
      type: Array,
      value: function() { return []; },
    },

    /**
     * Whether the password section section is opened or not.
     */
    passwordsOpened: {
      type: Boolean,
      value: false,
      observer: 'loadPasswords_',
    },
  },

  /**
   * Called when the section is expanded. This will load the list of passwords
   * only when needed.
   * @param {boolean} passwordSectionOpened
   */
  loadPasswords_: function(passwordSectionOpened) {
    if (passwordSectionOpened) {
      // TODO(hcarmona): Get real data.
      this.savedPasswords =
          [{origin: 'otherwebsite.com',
            username: 'bowser',
            password: '************'},
           {origin: 'otherlongwebsite.com',
            username: 'koopa',
            password: '*********'},
           {origin: 'otherverylongwebsite.com',
            username: 'goomba',
            password: '******'}];
    }
  },
});
})();