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 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
|
<style include="iron-flex cr-shared-style settings-shared md-select">
.indented {
margin-inline-start: var(--cr-section-indent-padding);
padding-inline-start: 0;
}
cr-policy-indicator {
padding-inline-end: 8px;
}
.dropdown-row {
--cr-section-min-height: 64px;
}
</style>
<div id="powerSourceRow" class="cr-row first"
hidden$="[[!batteryStatus_.present]]">
<div class="flex cr-padded-text" aria-hidden="true">
<div id="powerSourceLabel">[[powerSourceLabel_]]</div>
<div id="batteryStatus" class="secondary">[[batteryStatus_.statusText]]</div>
</div>
<select id="powerSource" class="md-select"
hidden$="[[!showPowerSourceDropdown_]]"
aria-labelledby="powerSourceLabel"
aria-describedby="batteryStatus"
on-change="onPowerSourceChange_"
deep-link-focus-id$="[[Setting.kPowerSource]]">
<option value="" selected="[[isEqual_('', selectedPowerSourceId_)]]">
$i18n{powerSourceBattery}
</option>
<template is="dom-repeat" items="[[powerSources_]]">
<option value="[[item.id]]"
selected="[[isEqual_(item.id, selectedPowerSourceId_)]]">
[[item.description]]
</option>
</template>
</select>
<div hidden$="[[showPowerSourceDropdown_]]"
aria-labelledby="powerSourceLabel"
aria-describedby="batteryStatus">
[[powerSourceName_]]
</div>
</div>
<settings-toggle-button id="batterySaverToggle"
class$="[[getClassForRow_(batteryStatus_.present, 'batterySaver')]]"
hidden$="[[batterySaverHidden_]]"
pref="{{prefs.power.cros_battery_saver_active}}"
label="$i18n{powerBatterySaverLabel}"
sub-label="$i18n{powerBatterySaverSubtext}"
learn-more-url="$i18n{powerBatterySaverLearnMoreUrl}"
disabled="[[isExternalPowerAC_]]"
deep-link-focus-id$="[[Setting.kBatterySaver]]">
</settings-toggle-button>
<settings-toggle-button id="adaptiveChargingToggle"
class$="[[getClassForRow_(batteryStatus_.present, 'adaptiveCharging')]]"
hidden$="[[!adaptiveChargingEnabled_]]"
pref="[[adaptiveChargingPref_]]"
label="$i18n{powerAdaptiveChargingLabel}"
sub-label="$i18n{powerAdaptiveChargingSubtext}"
learn-more-url="$i18n{powerAdaptiveChargingLearnMoreUrl}"
on-settings-boolean-control-change="onAdaptiveChargingToggleChange_"
deep-link-focus-id$="[[Setting.kAdaptiveCharging]]"
no-set-pref>
</settings-toggle-button>
<template is="dom-if" if="[[!batteryStatus_.present]]" restamp>
<div class$="[[getClassForRow_(batteryStatus_.present, 'idle')]]">
<div id="powerIdleLabel" class="flex" aria-label="true">
$i18n{powerIdleLabel}
</div>
<template is="dom-if" if="[[acIdleManaged_]]" restamp>
<cr-policy-indicator id="noBatteryAcIdleManagedIndicator"
indicator-type="devicePolicy"
icon-aria-label="$i18n{powerIdleWhileChargingAriaLabel}">
</cr-policy-indicator>
</template>
<select id="noBatteryAcIdleSelect"
class="md-select"
on-change="onAcIdleSelectChange_"
disabled="[[shouldAcIdleSelectBeDisabled_]]"
aria-label="$i18n{powerIdleWhileChargingAriaLabel}"
deep-link-focus-id$="[[Setting.kPowerIdleBehaviorWhileCharging]]">
<template is="dom-repeat" items="[[acIdleOptions_]]">
<option value="[[item.value]]" selected="[[item.selected]]">
[[item.name]]
</option>
</template>
</select>
</div>
</template>
<template is="dom-if" if="[[batteryStatus_.present]]" restamp>
<div id="acIdleSettingBox"
class$="[[getClassForRow_(batteryStatus_.present, 'acIdle')]]">
<div class="flex" aria-hidden="true">
$i18n{powerInactiveWhilePluggedInLabel}
</div>
<template is="dom-if" if="[[acIdleManaged_]]" restamp>
<cr-policy-indicator id="acIdleManagedIndicator"
indicator-type="devicePolicy"
icon-aria-label="$i18n{powerIdleWhileChargingAriaLabel}">
</cr-policy-indicator>
</template>
<select id="acIdleSelect" class="md-select"
on-change="onAcIdleSelectChange_"
disabled="[[shouldAcIdleSelectBeDisabled_]]"
aria-label="$i18n{powerIdleWhileChargingAriaLabel}"
deep-link-focus-id$="[[Setting.kPowerIdleBehaviorWhileCharging]]">
<template is="dom-repeat" items="[[acIdleOptions_]]">
<option value="[[item.value]]" selected="[[item.selected]]">
[[item.name]]
</option>
</template>
</select>
</div>
<div id="batteryIdleSettingBox"
class$="[[getClassForRow_(batteryStatus_.present, 'batteryIdle')]]">
<div class="flex" aria-hidden="true">
$i18n{powerInactiveWhileOnBatteryLabel}
</div>
<template is="dom-if" if="[[batteryIdleManaged_]]" restamp>
<cr-policy-indicator id="batteryIdleManagedIndicator"
indicator-type="devicePolicy"
icon-aria-label="$i18n{powerIdleWhileOnBatteryAriaLabel}">
</cr-policy-indicator>
</template>
<select id="batteryIdleSelect" class="md-select"
on-change="onBatteryIdleSelectChange_"
disabled="[[shouldBatteryIdleSelectBeDisabled_]]"
aria-label="$i18n{powerIdleWhileOnBatteryAriaLabel}"
deep-link-focus-id$="[[Setting.kPowerIdleBehaviorWhileOnBattery]]">
<template is="dom-repeat" items="[[batteryIdleOptions_]]">
<option value="[[item.value]]" selected="[[item.selected]]">
[[item.name]]
</option>
</template>
</select>
</div>
</template>
<settings-toggle-button id="lidClosedToggle"
class$="[[getClassForRow_(batteryStatus_.present, 'lidClosed')]]"
hidden$="[[!hasLid_]]" pref="[[lidClosedPref_]]" label="[[lidClosedLabel_]]"
on-settings-boolean-control-change="onLidClosedToggleChange_" no-set-pref
deep-link-focus-id$="[[Setting.kSleepWhenLaptopLidClosed]]">
</settings-toggle-button>
|