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

<link rel="import" href="chrome://resources/cr_components/chromeos/network/network_siminfo.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_network_icon.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_onc_types.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_toggle/cr_toggle.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_indicator.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_behavior_mojo.html">
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
<link rel="import" href="chrome://resources/html/chromeos/onc_mojo.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-collapse/iron-collapse.html">
<link rel="import" href="../settings_page/settings_subpage.html">

<dom-module id="network-summary-item">
  <template>
    <style include="internet-shared iron-flex">
      network-siminfo {
        padding-inline-start: var(--cr-section-padding);
      }

      #outerBox {
        padding: 0 var(--cr-section-padding);
      }

      #details {
        align-items: center;
        display: flex;
        flex: auto;
      }

      #networkState {
        color: var(--cr-secondary-text-color);
        font-size: inherit;
      }
    </style>
    <div id="outerBox" class="settings-box two-line">
      <div actionable class="flex layout horizontal center"
          on-click="onShowDetailsTap_">
        <div id="details" no-flex$="[[showSimInfo_(deviceState)]]">
          <cr-network-icon
              show-technology-badge="[[showTechnologyBadge_]]"
              network-state="[[activeNetworkState]]"
              device-state="[[deviceState]]">
          </cr-network-icon>
          <div class="flex settings-box-text">
            <div id="networkTitleText">
              [[getTitleText_(activeNetworkState)]]
            </div>
            <div id="networkState">
              [[getNetworkStateText_(activeNetworkState, deviceState)]]
            </div>
          </div>
        </div>

        <template is="dom-if" if="[[showSimInfo_(deviceState)]]" restamp>
          <network-siminfo device-state="[[deviceState]]" on-click="doNothing_">
          </network-siminfo>
        </template>

        <template is="dom-if" if="[[showPolicyIndicator_(activeNetworkState)]]">
          <cr-policy-indicator indicator-type="[[getIndicatorTypeForSource(
              activeNetworkState.source)]]" on-click="doNothing_">
          </cr-policy-indicator>
        </template>

        <template is="dom-if" if="[[showDetailsIsVisible_(activeNetworkState,
            deviceState, networkStateList)]]">
          <cr-icon-button class="subpage-arrow"
              aria-label$="[[getDetailsA11yString_(activeNetworkState,
                  deviceState, networkStateList)]]"></cr-icon-button>
        </template>
      </div>

      <template is="dom-if" if="[[enableToggleIsVisible_(deviceState)]]">
        <div class="separator"></div>
        <cr-toggle id="deviceEnabledButton"
            aria-label$="[[getToggleA11yString_(deviceState)]]"
            checked="[[deviceIsEnabled_(deviceState)]]"
            disabled="[[!enableToggleIsEnabled_(deviceState)]]"
            on-change="onDeviceEnabledChange_">
        </cr-toggle>
      </template>
    </div>
  </template>
  <script src="network_summary_item.js"></script>
</dom-module>