blob: b46ee7165958ed1c5d28c8e070cfccb868f1e8a8 [file] [log] [blame]
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_indicator.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-checkbox/paper-checkbox.html">
<link rel="import" href="settings_boolean_control_behavior.html">
<link rel="import" href="../settings_shared_css.html">
<dom-module id="settings-checkbox">
<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-checkbox {
/* Handle overflow of subLabel when it is larger than one line. */
align-items: center;
display: flex;
/* Additional margin in case subLabel needs more than one line. */
margin-bottom: 4px;
margin-top: var(--settings-checkbox-margin-top, 4px);
width: 100%;
}
paper-checkbox:not([checked]) .secondary {
@apply(--settings-secondary-unchecked);
}
cr-policy-pref-indicator {
-webkit-margin-start: var(--settings-controlled-by-spacing);
}
.label {
@apply(--settings-checkbox-label);
}
</style>
<div id="outerRow" noSubLabel$="[[!hasSubLabel_(subLabel, subLabelHtml)]]">
<paper-checkbox id="checkbox" checked="{{checked}}"
on-change="notifyChangedByUserInteraction"
disabled="[[controlDisabled_(disabled, pref.*)]]">
<div class="label">[[label]] <slot></slot></div>
<div class="secondary label">
<div inner-h-t-m-l="[[subLabelHtml]]"></div>
[[subLabel]]
</div>
</paper-checkbox>
<template is="dom-if" if="[[pref.controlledBy]]">
<cr-policy-pref-indicator pref="[[pref]]" icon-aria-label="[[label]]">
</cr-policy-pref-indicator>
</template>
</div>
</template>
<script src="settings_checkbox.js"></script>
</dom-module>