blob: c3fca94ba814000ad89ac303647395a01c92f93a [file] [log] [blame]
<link rel="import" href="chrome://resources/html/md_select_css.html">
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_behavior.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_indicator.html">
<link rel="import" href="pref_control_behavior.html">
<link rel="import" href="../i18n_setup.html">
<link rel="import" href="../prefs/pref_util.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="../settings_vars_css.html">
<dom-module id="settings-dropdown-menu">
<template>
<style include="settings-shared md-select">
:host {
display: inline-flex;
}
cr-policy-pref-indicator {
margin: 0 var(--settings-control-spacing);
}
/* Hide "Custom" value when unselectable. */
option:disabled {
display: none;
}
</style>
<template is="dom-if" if="[[pref.controlledBy]]" restamp>
<cr-policy-pref-indicator pref="[[pref]]"></cr-policy-pref-indicator>
</template>
<div class="md-select-wrapper">
<select class="md-select" id="dropdownMenu" on-change="onChange_"
aria-label$="[[label]]"
disabled="[[shouldDisableMenu_(disabled, menuOptions, pref.*)]]">
<template is="dom-repeat" items="[[menuOptions]]">
<option value="[[item.value]]">[[item.name]]</option>
</template>
<option value="[[notFoundValue_]]"
disabled="[[!showNotFoundValue_(menuOptions, pref.value)]]">
$i18n{custom}
</option>
</select>
<span class="md-select-underline"></span>
</div>
</template>
<script src="settings_dropdown_menu.js"></script>
</dom-module>