| Index: chrome/browser/resources/settings/device_page/display.js
|
| diff --git a/chrome/browser/resources/settings/device_page/display.js b/chrome/browser/resources/settings/device_page/display.js
|
| index d7c2bd722367aa130626d261722a9e6aa0cdd433..14cb6510d520cb8926030b4ef8fa24e74f1a9b29 100644
|
| --- a/chrome/browser/resources/settings/device_page/display.js
|
| +++ b/chrome/browser/resources/settings/device_page/display.js
|
| @@ -7,6 +7,17 @@
|
| * 'settings-display' is the settings subpage for display settings.
|
| */
|
|
|
| +/**
|
| + * The types of Night Light automatic schedule. The values of the enum values
|
| + * are synced with the pref "prefs.ash.night_light.schedule_type".
|
| + * @enum {number}
|
| + */
|
| +var NightLightScheduleType = {
|
| + NEVER: 0,
|
| + SUNSET_TO_SUNRISE: 1,
|
| + CUSTOM: 2,
|
| +};
|
| +
|
| cr.define('settings.display', function() {
|
| var systemDisplayApi = /** @type {!SystemDisplay} */ (chrome.system.display);
|
|
|
| @@ -93,8 +104,33 @@ Polymer({
|
| type: Boolean,
|
| value: false,
|
| },
|
| +
|
| + /** @private */
|
| + scheduleTypesList_: {
|
| + type: Array,
|
| + value: function() {
|
| + return [{
|
| + name: loadTimeData.getString('displayNightLightScheduleNever'),
|
| + value: NightLightScheduleType.NEVER }, {
|
| + name: loadTimeData.getString(
|
| + 'displayNightLightScheduleSunsetToSunRise'),
|
| + value: NightLightScheduleType.SUNSET_TO_SUNRISE }, {
|
| + name: loadTimeData.getString('displayNightLightScheduleCustom'),
|
| + value: NightLightScheduleType.CUSTOM }];
|
| + },
|
| + },
|
| +
|
| + /** @private */
|
| + shouldOpenCustomScheduleCollapse_: {
|
| + type: Boolean,
|
| + value: false,
|
| + },
|
| },
|
|
|
| + observers: [
|
| + 'onScheduleTypeChanged_(prefs.ash.night_light.schedule_type.*)',
|
| + ],
|
| +
|
| /** @private {number} Selected mode index received from chrome. */
|
| currentSelectedModeIndex_: -1,
|
|
|
| @@ -532,4 +568,11 @@ Polymer({
|
| 'setDisplayProperties Error: ' + chrome.runtime.lastError.message);
|
| }
|
| },
|
| +
|
| + /** @private */
|
| + onScheduleTypeChanged_: function() {
|
| + this.shouldOpenCustomScheduleCollapse_ =
|
| + this.getPref('ash.night_light.schedule_type').value ==
|
| + NightLightScheduleType.CUSTOM;
|
| + },
|
| });
|
|
|