Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5263)

Unified Diff: chrome/browser/resources/settings/a11y_page/a11y_page.js

Issue 1137103002: Convert a11y page to Polymer 0.8 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: One-way bind when possible Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/a11y_page/a11y_page.js
diff --git a/chrome/browser/resources/settings/a11y_page/a11y_page.js b/chrome/browser/resources/settings/a11y_page/a11y_page.js
index 616a004abc9804269d9a163b821cc5677ab6e149..f86e32d00268f4e543099c9dbf8076c514128b4d 100644
--- a/chrome/browser/resources/settings/a11y_page/a11y_page.js
+++ b/chrome/browser/resources/settings/a11y_page/a11y_page.js
@@ -9,67 +9,83 @@
*
* Example:
*
- * <core-animated-pages>
+ * <iron-animated-pages>
* <cr-settings-a11y-page prefs="{{prefs}}"></cr-settings-a11y-page>
* ... other pages ...
- * </core-animated-pages>
+ * </iron-animated-pages>
*
* @group Chrome Settings Elements
* @element cr-settings-a11y-page
*/
-Polymer('cr-settings-a11y-page', {
- publish: {
+Polymer({
+ is: 'cr-settings-a11y-page',
+
+ properties: {
/**
* Preferences state.
*
- * @attribute prefs
- * @type CrSettingsPrefsElement
+ * @type {?CrSettingsPrefsElement}
* @default null
*/
- prefs: null,
+ prefs: {
+ type: Object,
+ notify: true,
+ },
/**
* Route for the page.
- *
- * @attribute route
- * @type string
- * @default ''
*/
- route: '',
+ route: {
+ type: String,
+ value: '',
+ },
/**
* Whether the page is a subpage.
- *
- * @attribute subpage
- * @type boolean
- * @default false
*/
- subpage: false,
+ subpage: {
+ type: Boolean,
+ value: false,
+ },
/**
* ID of the page.
- *
- * @attribute PAGE_ID
- * @const string
- * @default 'a11y'
*/
- PAGE_ID: 'a11y',
+ PAGE_ID: {
+ type: String,
+ value: 'a11y',
+ },
/**
* Title for the page header and navigation menu.
- *
- * @attribute pageTitle
- * @type string
*/
- pageTitle: loadTimeData.getString('a11yPageTitle'),
+ pageTitle: {
+ type: String,
+ value: function() { return loadTimeData.getString('a11yPageTitle'); },
+ },
/**
* 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.
- *
- * @attribute icon
- * @type string
- * @default 'accessibility'
*/
- icon: 'accessibility',
+ icon: {
+ type: String,
+ value: 'accessibility',
+ },
+ },
+
+ /** @override */
+ ready: function() {
+ 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
+ this.prefs.settings.settings.a11y.autoclick_delay_ms;
+ },
+
+ /**
+ * Called when the selected value of the autoclick dropdown changes.
+ * TODO(jlklein): Replace with binding when paper-dropdown lands.
+ * @private
+ */
+ autoclickSelectChanged_: function() {
+ this.prefs.settings.settings.a11y.autoclick_delay_ms =
+ this.$.autoclickDropdown.value;
},
});

Powered by Google App Engine
This is Rietveld 408576698