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

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

Issue 2585573002: Allow navigation to chrome://md-settings/pointer-overlay (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | chrome/browser/resources/settings/device_page/pointers.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/device_page/device_page.js
diff --git a/chrome/browser/resources/settings/device_page/device_page.js b/chrome/browser/resources/settings/device_page/device_page.js
index f286da702c4d0ceffa9469f8dceafffcbb6dbfd7..87249a2c3286f06418a0831ab8f2dc3633ec4eab 100644
--- a/chrome/browser/resources/settings/device_page/device_page.js
+++ b/chrome/browser/resources/settings/device_page/device_page.js
@@ -22,17 +22,15 @@ Polymer({
notify: true,
},
- /** @private */
- hasMouse_: {
- type: Boolean,
- value: false,
- },
+ /**
+ * |hasMouse_| and |hasTouchpad_| start undefined so observers don't trigger
+ * until both have been populated.
+ * @private
+ */
+ hasMouse_: Boolean,
/** @private */
- hasTouchpad_: {
- type: Boolean,
- value: false,
- },
+ hasTouchpad_: Boolean,
/** @private */
stylusAllowed_: {
@@ -49,12 +47,16 @@ Polymer({
],
ready: function() {
- cr.addWebUIListener('has-mouse-changed', this.set.bind(this, 'hasMouse_'));
- cr.addWebUIListener(
- 'has-touchpad-changed', this.set.bind(this, 'hasTouchpad_'));
settings.DevicePageBrowserProxyImpl.getInstance().initializePointers();
},
+ attached: function() {
dpapad 2016/12/16 01:20:53 Nit: @override
michaelpg 2016/12/16 23:32:30 Done + some other minor closure cleanup.
+ this.addWebUIListener(
+ 'has-mouse-changed', this.set.bind(this, 'hasMouse_'));
+ this.addWebUIListener(
+ 'has-touchpad-changed', this.set.bind(this, 'hasTouchpad_'));
+ },
+
/**
* @return {string}
* @private
@@ -141,7 +143,8 @@ Polymer({
* @private
*/
checkPointerSubpage_: function() {
- if (!this.hasMouse_ && !this.hasTouchpad_ &&
+ // Check that the properties have explicitly been set to false.
+ if (this.hasMouse_ === false && this.hasTouchpad_ === false &&
settings.getCurrentRoute() == settings.Route.POINTERS) {
settings.navigateTo(settings.Route.DEVICE);
}
« no previous file with comments | « no previous file | chrome/browser/resources/settings/device_page/pointers.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698