Chromium Code Reviews| Index: chrome/browser/resources/settings/controls/settings_toggle_button.html |
| diff --git a/chrome/browser/resources/settings/controls/settings_toggle_button.html b/chrome/browser/resources/settings/controls/settings_toggle_button.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..94105431581cb37a72af77fbb292eafd6ef419e9 |
| --- /dev/null |
| +++ b/chrome/browser/resources/settings/controls/settings_toggle_button.html |
| @@ -0,0 +1,42 @@ |
| +<link rel="import" href="chrome://resources/html/polymer.html"> |
| +<link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/paper-toggle-button.html"> |
| +<link rel="import" href="/controls/settings_boolean_control_behavior.html"> |
| +<link rel="import" href="/settings_shared_css.html"> |
| + |
| +<dom-module id="settings-toggle-button"> |
| + <template> |
| + <style include="settings-shared"> |
| + #outerRow { |
| + align-items: center; |
| + display: flex; |
| + min-height: var(--settings-row-two-line-min-height); |
| + width: 100%; |
| + } |
| + |
| + #outerRow[noSubLabel] { |
| + min-height: var(--settings-row-min-height); |
| + } |
| + |
| + paper-toggle-button:not([checked]) .secondary { |
| + @apply(--settings-secondary-unchecked); |
| + } |
| + |
| + cr-policy-pref-indicator { |
| + -webkit-margin-end: var(--checkbox-spacing); |
| + } |
| + </style> |
| + <div id="outerRow" noSubLabel$="[[!subLabel]]"> |
| + <div class="flex"> |
| + <div>[[label]]</div> |
| + <div class="secondary">[[subLabel]]</div> |
|
dpapad
2016/10/20 21:47:12
Should this be hidden if subLabel does not exist?
dschuyler
2016/10/20 22:33:38
I believe there is no need. I suspect, but haven't
dpapad
2016/10/20 22:49:26
SG, as long as it looks visually correct. My conce
|
| + </div> |
| + <template is="dom-if" if="[[pref.policySource]]"> |
| + <cr-policy-pref-indicator pref="[[pref]]"></cr-policy-pref-indicator> |
| + </template> |
| + <paper-toggle-button id="control" checked="{{checked}}" |
| + disabled="[[controlDisabled_(disabled, pref)]]"> |
| + </paper-toggle-button> |
| + </div> |
| + </template> |
| + <script src="settings_toggle_button.js"></script> |
| +</dom-module> |