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

<link rel="import" href="chrome://resources/cr_components/chromeos/network/network_proxy.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_onc_types.html">
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/cr_elements/hidden_style_css.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_behavior_mojo.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_indicator_mojo.html">
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="../controls/extension_controlled_indicator.html">
<link rel="import" href="../controls/settings_toggle_button.html">
<link rel="import" href="../i18n_setup.html">
<link rel="import" href="../prefs/prefs_behavior.html">
<link rel="import" href="../settings_vars_css.html">
<link rel="import" href="internet_shared_css.html">

<dom-module id="network-proxy-section">
  <template>
    <style include="internet-shared cr-hidden-style iron-flex
        iron-flex-alignment">
      cr-policy-network-indicator-mojo {
        margin-inline-end: 10px;
      }

      extension-controlled-indicator {
        margin-inline-start: 0;
        width: 100%;
      }

      .settings-box:first-of-type {
        border-top: none;
      }
    </style>

    <!-- Policy indicator. Only one dom-if below will be shown. -->
    <template is="dom-if"
        if="[[shouldShowNetworkPolicyIndicator_(managedProperties)]]">
      <div class="settings-box">
        <div class="layout horizontal center">
          <cr-policy-network-indicator-mojo
              property="[[managedProperties.proxySettings.type]]"
              no-extension-indicator>
          </cr-policy-network-indicator-mojo>
          <div>$i18n{networkProxyEnforcedPolicy}</div>
        </div>
      </div>
    </template>
    <template is="dom-if"
        if="[[shouldShowExtensionIndicator_(managedProperties)]]">
      <div class="settings-box">
        <extension-controlled-indicator
            extension-id="[[prefs.proxy.extensionId]]"
            extension-name="[[prefs.proxy.controlledByName]]"
            extension-can-be-disabled="[[prefs.proxy.extensionCanBeDisabled]]">
        </extension-controlled-indicator>
      </div>
    </template>

    <!-- Allow shared proxies -->
    <settings-toggle-button id="allowShared" class="continuation indented"
        hidden$="[[!shouldShowAllowShared_(managedProperties.source)]]"
        pref="{{prefs.settings.use_shared_proxies}}"
        label="$i18n{networkProxyAllowShared}"
        on-settings-boolean-control-change="onAllowSharedProxiesChange_"
        no-set-pref>
    </settings-toggle-button>

    <div class="settings-box single-column stretch continuation indented">
      <network-proxy editable
          managed-properties="[[managedProperties]]"
          use-shared-proxies="[[useSharedProxies_]]">
      </network-proxy>
    </div>

    <!-- Confirm Allow shared proxies dialog -->
    <cr-dialog id="confirmAllowSharedDialog"
        close-text="$i18n{close}" on-cancel="onAllowSharedDialogCancel_"
        on-close="onAllowSharedDialogClose_">
      <div slot="title">
        [[getAllowSharedDialogTitle_(prefs.settings.use_shared_proxies.value,
            '$i18n{networkProxyAllowSharedEnableWarningTitle}',
            '$i18n{networkProxyAllowSharedDisableWarningTitle}')]]
      </div>
      <div slot="body">
        $i18n{networkProxyAllowSharedWarningMessage}
      </div>
      <div slot="button-container">
        <cr-button class="cancel-button"
            on-click="onAllowSharedDialogCancel_">
          $i18n{cancel}
        </cr-button>
        <cr-button class="action-button"
            on-click="onAllowSharedDialogConfirm_">
          $i18n{confirm}
        </cr-button>
      </div>
    </cr-dialog>
  </template>
  <script src="network_proxy_section.js"></script>
</dom-module>