summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/md_extensions/kiosk_dialog.html
blob: 0a7a4c89471685276425f936f889c337f3adc68b (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<link rel="import" href="chrome://resources/html/polymer.html">

<link rel="import" href="chrome://resources/cr_elements/cr_checkbox/cr_checkbox.html">
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/cr_elements/cr_icons_css.html">
<link rel="import" href="chrome://resources/cr_elements/paper_button_style_css.html">
<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html">
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/cr.html">
<link rel="import" href="chrome://resources/html/util.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html">
<link rel="import" href="item_behavior.html">
<link rel="import" href="kiosk_browser_proxy.html">

<dom-module id="extensions-kiosk-dialog">
  <template>
    <style include="cr-shared-style paper-button-style cr-icons">
      #add-kiosk-app {
        --paper-input-container-input: {
          font-size: inherit;
        };
        align-items: center;
        display: flex;
        margin-bottom: 10px;
        margin-top: 20px;
        width: 350px;
      }

      #add-kiosk-app paper-input {
        flex: 1;
      }

      #add-kiosk-app paper-button {
        -webkit-margin-start: 10px;
      }

      paper-button {
        color: var(--google-blue-500);
      }

      #kiosk-apps-list {
        border: 1px solid var(--paper-grey-300);
        padding: 10px;
      }

      .list-item {
        align-items: center;
        border-bottom: 1px solid var(--paper-grey-300);
        display: flex;
        justify-content: space-between;
        padding: 5px;
      }

      .list-item:last-of-type {
        border-bottom: none;
      }

      .list-item:hover {
        background-color: var(--paper-grey-300);
      }

      .item-icon {
        vertical-align: middle;
        width: 25px;
      }

      .item-controls {
        visibility: hidden;
      }

      .list-item:hover .item-controls {
        visibility: visible;
      }
    </style>
    <cr-dialog id="dialog" close-text="$i18n{close}"
        ignore-enter-key>
      <div slot="title">$i18n{manageKioskApp}</div>
      <div slot="body">
        <div id="kiosk-apps-list">
          <template is="dom-repeat" items="[[apps_]]">
            <div class="list-item">
              <div class="item-name">
                <img class="item-icon" src="[[item.iconURL]]"
                    alt$="[[appOrExtension(
                        data.type,
                        '$i18nPolymer{appIcon}',
                        '$i18nPolymer{extensionIcon}')]]">
                [[item.name]]
                <span hidden="[[!item.autoLaunch]]">
                  $i18n{kioskAutoLaunch}
                </span>
              </div>
              <div class="item-controls">
                <paper-button hidden="[[!canEditAutoLaunch_]]"
                    on-click="onAutoLaunchButtonTap_">
                  [[getAutoLaunchButtonLabel_(item.autoLaunch,
                      '$i18nPolymer{kioskDisableAutoLaunch}',
                      '$i18nPolymer{kioskEnableAutoLaunch}')]]
                </paper-button>
                <paper-icon-button-light class="icon-delete-gray">
                  <button on-click="onDeleteAppTap_"></button>
                </paper-icon-button-light>
              </div>
            </div>
          </template>
        </div>
        <div id="add-kiosk-app">
          <paper-input id="add-input" label="$i18n{kioskAddApp}"
              placeholder="$i18n{kioskAddAppHint}" value="{{addAppInput_}}"
              always-float-label invalid="[[errorAppId_]]"
              error-message="[[getErrorMessage_(
                  '$i18nPolymer{kioskInvalidApp}', errorAppId_)]]"
              on-keydown="clearInputInvalid_">
          </paper-input>
          <paper-button id="add-button" on-click="onAddAppTap_"
              disabled="[[!addAppInput_]]">
            $i18n{add}
          </paper-button>
        </div>
        <cr-checkbox disabled="[[!canEditBailout_]]" id="bailout"
            on-change="onBailoutChanged_" checked="[[bailoutDisabled_]]"
            hidden="[[!canEditAutoLaunch_]]">
          $i18n{kioskDisableBailout}
        </cr-checkbox>
      </div>
      <div slot="button-container">
        <paper-button class="action-button" on-click="onDoneTap_">
          $i18n{done}
        </paper-button>
      </div>
    </cr-dialog>
    <cr-dialog id="confirm-dialog" close-text="$i18n{close}"
        ignore-enter-key on-close="stopPropagation_">
      <div slot="title">$i18n{kioskDisableBailoutWarningTitle}</div>
      <div slot="body">$i18n{kioskDisableBailoutWarningBody}</div>
      <div slot="button-container">
        <paper-button class="cancel-button"
            on-click="onBailoutDialogCancelTap_">
          $i18n{cancel}
        </paper-button>
        <paper-button class="action-button"
            on-click="onBailoutDialogConfirmTap_">
          $i18n{confirm}
        </paper-button>
      </div>
    </cr-dialog>
  </template>
  <script src="kiosk_dialog.js"></script>
</dom-module>