summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/resources/pdf/elements/viewer-form-warning/viewer-form-warning.js
blob: 539eddd6b67772334a403a24b01224da21623d4f (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
// Copyright 2019 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.

Polymer({
  is: 'viewer-form-warning',
  properties: {
    strings: Object,
  },

  /** @private {PromiseResolver} */
  resolver_: null,

  show: function() {
    this.resolver_ = new PromiseResolver();
    /** @type {!CrDialogElement} */ (this.$.dialog).showModal();
    return this.resolver_.promise;
  },

  onCancel: function() {
    this.resolver_.reject();
    this.$.dialog.cancel();
  },

  onAction: function() {
    this.resolver_.resolve();
    this.$.dialog.close();
  },
});