summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/resources/settings/autofill_page/credit_card_list_entry.js
blob: 336492db8aea7902a521d3cc1afd47f03982c760 (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
// Copyright 2018 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 'credit-card-list-entry' is a credit card row to be shown in
 * the settings page.
 */

Polymer({
  is: 'settings-credit-card-list-entry',

  behaviors: [
    I18nBehavior,
  ],

  properties: {
    /**
     * A saved credit card.
     * @type {!PaymentsManager.CreditCardEntry}
     */
    creditCard: Object,
  },

  /**
   * Opens the credit card action menu.
   * @private
   */
  onDotsMenuClick_: function() {
    this.fire('dots-card-menu-click', {
      creditCard: this.creditCard,
      anchorElement: this.$$('#creditCardMenu'),
    });
  },

  /** @private */
  onRemoteEditClick_: function() {
    this.fire('remote-card-menu-click');
  },

  /**
   * The 3-dot menu should not be shown if the card is entirely remote.
   * @return {boolean}
   * @private
   */
  showDots_: function() {
    return !!(
        this.creditCard.metadata.isLocal || this.creditCard.metadata.isCached);
  },
});