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

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

Issue 2751873002: chromeos: Avoid NOTREACHED for MD settings power page. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/device_page/power.js
diff --git a/chrome/browser/resources/settings/device_page/power.js b/chrome/browser/resources/settings/device_page/power.js
index a04b51d6109e8879a03f4119c3a4eeeb015b1d10..817d1e97cdf23bc3f0697ac321a5ce1a7ac6385b 100644
--- a/chrome/browser/resources/settings/device_page/power.js
+++ b/chrome/browser/resources/settings/device_page/power.js
@@ -67,6 +67,11 @@ Polymer({
/** @override */
attached: function() {
+ // Even when the row is hidden, the element can still be attached via
+ // search.
+ if (!this.enablePowerSettings)
+ return;
+
this.addWebUIListener(
'battery-status-changed', this.set.bind(this, 'batteryStatus_'));
this.addWebUIListener(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698