summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/resources/settings/settings_page/settings_subpage.html
blob: b4ea404e35f640ebc0d58498ff7fd9108b1799d2 (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
<link rel="import" href="chrome://resources/html/polymer.html">

<link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_search_field/cr_search_field.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html">
<link rel="import" href="chrome://resources/html/find_shortcut_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-resizable-behavior/iron-resizable-behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-ripple/paper-ripple.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner-lite.html">
<link rel="import" href="../route.html">
<link rel="import" href="../settings_shared_css.html">

<dom-module id="settings-subpage">
  <template>
    <style include="cr-shared-style settings-shared">
      :host {
        background-color: var(--cr-card-background-color);
        box-sizing: border-box;
        display: block;
        left: 0;
        min-height: calc(100vh - var(--cr-toolbar-height));
        padding-bottom: 60px;
        position: absolute;
        right: 0;
        top: 0;
        @apply --cr-card-elevation;
      }

      #headerLine {
        min-height: 40px;
        padding-bottom: 24px;
        padding-top: 8px;
      }

      #learnMore {
        @apply --cr-paper-icon-button-margin;
        align-items: center;
        display: flex;
        height: var(--cr-icon-ripple-size);
        justify-content: center;
        position: relative;  /* Needed for paper-ripple. */
        width: var(--cr-icon-ripple-size);
      }

      #title-icon {
        height: 36px;
        margin-inline-end: 12px;
        margin-inline-start: 2px;
        width: 36px;
      }

      cr-icon-button {
        /* Centers the ripple on the icon with appropriate margin on right. */
        margin-inline-end: 10px;
        margin-inline-start: -10px;
      }

      paper-spinner-lite {
        @apply --cr-icon-height-width;
      }

      h1 {
        flex: 1;  /* Push other items to the end. */
      }

      cr-search-field {
        /* Keep normal icon spacing from subpage-title-extra controls. */
        margin-inline-start: 16px;
      }
    </style>
    <div class="settings-box first" id="headerLine">
      <cr-icon-button class="icon-arrow-back" id="closeButton"
          on-click="onTapBack_" aria-label="$i18n{back}"></cr-icon-button>
      <template is="dom-if" if="[[titleIcon]]">
        <img id="title-icon" src="[[titleIcon]]" aria-hidden="true">
      </template>
      <h1 class="cr-title-text">[[pageTitle]]</h1>
      <slot name="subpage-title-extra"></slot>
      <template is="dom-if" if="[[learnMoreUrl]]">
        <a id="learnMore" aria-label="$i18n{learnMore}"
            href="[[learnMoreUrl]]" target="_blank">
          <iron-icon icon="cr:help-outline"></iron-icon>
          <paper-ripple class="circle" center></paper-ripple>
        </a>
      </template>
      <template is="dom-if" if="[[searchLabel]]">
        <cr-search-field label="[[searchLabel]]"
            on-search-changed="onSearchChanged_">
        </cr-search-field>
      </template>
      <template is="dom-if" if="[[showSpinner]]">
        <paper-spinner-lite active title$="[[spinnerTitle]]">
        </paper-spinner-lite>
      </template>
    </div>
    <slot></slot>
  </template>
  <script src="settings_subpage.js"></script>
</dom-module>