Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * 'cr-settings-a11y-page' is the settings page containing accessibility | 7 * 'cr-settings-a11y-page' is the settings page containing accessibility |
| 8 * settings. | 8 * settings. |
| 9 * | 9 * |
| 10 * Example: | 10 * Example: |
| 11 * | 11 * |
| 12 * <core-animated-pages> | 12 * <iron-animated-pages> |
| 13 * <cr-settings-a11y-page prefs="{{prefs}}"></cr-settings-a11y-page> | 13 * <cr-settings-a11y-page prefs="{{prefs}}"></cr-settings-a11y-page> |
| 14 * ... other pages ... | 14 * ... other pages ... |
| 15 * </core-animated-pages> | 15 * </iron-animated-pages> |
| 16 * | 16 * |
| 17 * @group Chrome Settings Elements | 17 * @group Chrome Settings Elements |
| 18 * @element cr-settings-a11y-page | 18 * @element cr-settings-a11y-page |
| 19 */ | 19 */ |
| 20 Polymer('cr-settings-a11y-page', { | 20 Polymer({ |
| 21 publish: { | 21 is: 'cr-settings-a11y-page', |
| 22 | |
| 23 properties: { | |
| 22 /** | 24 /** |
| 23 * Preferences state. | 25 * Preferences state. |
| 24 * | 26 * |
| 25 * @attribute prefs | 27 * @type {?CrSettingsPrefsElement} |
| 26 * @type CrSettingsPrefsElement | |
| 27 * @default null | 28 * @default null |
| 28 */ | 29 */ |
| 29 prefs: null, | 30 prefs: { |
| 31 type: Object, | |
| 32 notify: true, | |
| 33 }, | |
| 30 | 34 |
| 31 /** | 35 /** |
| 32 * Route for the page. | 36 * Route for the page. |
| 33 * | |
| 34 * @attribute route | |
| 35 * @type string | |
| 36 * @default '' | |
| 37 */ | 37 */ |
| 38 route: '', | 38 route: { |
| 39 type: String, | |
| 40 value: '', | |
| 41 }, | |
| 39 | 42 |
| 40 /** | 43 /** |
| 41 * Whether the page is a subpage. | 44 * Whether the page is a subpage. |
| 42 * | |
| 43 * @attribute subpage | |
| 44 * @type boolean | |
| 45 * @default false | |
| 46 */ | 45 */ |
| 47 subpage: false, | 46 subpage: { |
| 47 type: Boolean, | |
| 48 value: false, | |
| 49 }, | |
| 48 | 50 |
| 49 /** | 51 /** |
| 50 * ID of the page. | 52 * ID of the page. |
| 51 * | |
| 52 * @attribute PAGE_ID | |
| 53 * @const string | |
| 54 * @default 'a11y' | |
| 55 */ | 53 */ |
| 56 PAGE_ID: 'a11y', | 54 PAGE_ID: { |
| 55 type: String, | |
| 56 value: 'a11y', | |
| 57 }, | |
| 57 | 58 |
| 58 /** | 59 /** |
| 59 * Title for the page header and navigation menu. | 60 * Title for the page header and navigation menu. |
| 60 * | |
| 61 * @attribute pageTitle | |
| 62 * @type string | |
| 63 */ | 61 */ |
| 64 pageTitle: loadTimeData.getString('a11yPageTitle'), | 62 pageTitle: { |
| 63 type: String, | |
| 64 value: function() { return loadTimeData.getString('a11yPageTitle'); }, | |
| 65 }, | |
| 65 | 66 |
| 66 /** | 67 /** |
| 67 * Name of the 'core-icon' to show. | 68 * Name of the 'core-icon' to show. |
|
michaelpg
2015/05/12 05:52:05
iron-icon
Jeremy Klein
2015/05/12 06:23:22
Done.
| |
| 68 * | |
| 69 * @attribute icon | |
| 70 * @type string | |
| 71 * @default 'accessibility' | |
| 72 */ | 69 */ |
| 73 icon: 'accessibility', | 70 icon: { |
| 71 type: String, | |
| 72 value: 'accessibility', | |
| 73 }, | |
| 74 }, | |
| 75 | |
| 76 /** @override */ | |
| 77 ready: function() { | |
| 78 this.$.autoclickDropdown.value = | |
|
michaelpg
2015/05/12 05:52:05
for this and the below, I would just bind to the <
Jeremy Klein
2015/05/12 06:23:22
But that won't actually do anything. I'd rather ha
michaelpg
2015/05/12 07:04:33
Oh, you're right, the changes from the <select> wo
| |
| 79 this.prefs.settings.settings.a11y.autoclick_delay_ms; | |
| 80 }, | |
| 81 | |
| 82 /** | |
| 83 * Called when the selected value of the autoclick dropdown changes. | |
| 84 * TODO(jlklein): Replace with binding when paper-dropdown lands. | |
| 85 * @private | |
| 86 */ | |
| 87 autoclickSelectChanged_: function() { | |
| 88 this.prefs.settings.settings.a11y.autoclick_delay_ms = | |
| 89 this.$.autoclickDropdown.value; | |
| 74 }, | 90 }, |
| 75 }); | 91 }); |
| OLD | NEW |