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

Side by Side Diff: chrome/browser/resources/chromeos/emulator/battery_settings.js

Issue 2006083002: Use fake Input Device Settings with chrome://device-emulator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DevicePageTestsFixes
Patch Set: make dependent on a11y fix Created 4 years, 5 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 unified diff | Download patch
OLDNEW
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 var BatterySettings = Polymer({ 5 var BatterySettings = Polymer({
6 is: 'battery-settings', 6 is: 'battery-settings',
7 7
8 behaviors: [Polymer.NeonAnimatableBehavior], 8 behaviors: [Polymer.NeonAnimatableBehavior],
9 9
10 properties: { 10 properties: {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 timeUntilEmpty: String, 70 timeUntilEmpty: String,
71 71
72 /** A string representing the time left until the battery is at 100%. */ 72 /** A string representing the time left until the battery is at 100%. */
73 timeUntilFull: String, 73 timeUntilFull: String,
74 }, 74 },
75 75
76 observers: [ 76 observers: [
77 'powerSourcesChanged(powerSourceOptions.*)', 77 'powerSourcesChanged(powerSourceOptions.*)',
78 ], 78 ],
79 79
80 initialize: function() { 80 ready: function() {
81 if (!this.initialized) { 81 chrome.send('requestPowerInfo');
82 chrome.send('requestPowerInfo');
83 this.initialized = true;
84 }
85 }, 82 },
86 83
87 onBatteryPercentChange: function(e) { 84 onBatteryPercentChange: function(e) {
88 this.percent = parseInt(e.target.value); 85 this.percent = parseInt(e.target.value);
89 if (!isNaN(this.percent)) 86 if (!isNaN(this.percent))
90 chrome.send('updateBatteryPercent', [this.percent]); 87 chrome.send('updateBatteryPercent', [this.percent]);
91 }, 88 },
92 89
93 onSetAsSourceTap: function(e) { 90 onSetAsSourceTap: function(e) {
94 chrome.send('updatePowerSourceId', [e.model.item.id]); 91 chrome.send('updatePowerSourceId', [e.model.item.id]);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 }, 145 },
149 146
150 canBecomeSource: function(source, selectedId, powerSourceOptionsChange) { 147 canBecomeSource: function(source, selectedId, powerSourceOptionsChange) {
151 if (!source.connected || !this.isDualRole(source)) 148 if (!source.connected || !this.isDualRole(source))
152 return false; 149 return false;
153 return !this.powerSourceOptions.some(function(source) { 150 return !this.powerSourceOptions.some(function(source) {
154 return source.connected && source.type == 'DedicatedCharger'; 151 return source.connected && source.type == 'DedicatedCharger';
155 }); 152 });
156 }, 153 },
157 }); 154 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698