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

Unified Diff: chrome/browser/resources/options/chromeos/power_overlay.js

Issue 1265853002: Fix closure compile through a series of stupid hacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: match enums Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/chromeos/power_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/chromeos/power_overlay.js
diff --git a/chrome/browser/resources/options/chromeos/power_overlay.js b/chrome/browser/resources/options/chromeos/power_overlay.js
index a260f3b238e329924afc95cd1597602d5a79d6f7..fe2051bd3b6907b2a7eef44bf286f02a47549dba 100644
--- a/chrome/browser/resources/options/chromeos/power_overlay.js
+++ b/chrome/browser/resources/options/chromeos/power_overlay.js
@@ -2,24 +2,30 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+cr.exportPath('options');
+
+/**
+ * Copied from ash/system/chromeos/power/power_status.h.
+ * @enum {number}
+ */
+options.PowerStatusDeviceType = {
+ DEDICATED_CHARGER: 0,
+ DUAL_ROLE_USB: 1,
+};
+
+/**
+ * @typedef {{
+ * id: string,
+ * type: options.PowerStatusDeviceType,
+ * description: string
+ * }}
+ */
+options.PowerSource;
+
cr.define('options', function() {
var Page = cr.ui.pageManager.Page;
var PageManager = cr.ui.pageManager.PageManager;
- /** @enum {number} */ var DeviceType = {
- CHARGER: loadTimeData.getInteger('powerSourceCharger'),
- DUAL_ROLE: loadTimeData.getInteger('powerSourceDualRole'),
- };
-
- /**
- * @typedef {{
- * id: string,
- * type: DeviceType,
- * description: string
- * }}
- */
- var PowerSource;
-
/**
* Encapsulated handling of the power overlay.
* @constructor
@@ -60,7 +66,7 @@ cr.define('options', function() {
},
/**
- * @param {Array<PowerSource>} sources External power sources.
+ * @param {Array<options.PowerSource>} sources External power sources.
* @param {string} selectedId The ID of the currently used power source.
* @param {boolean} isUsbCharger Whether the currently used power source
* is a USB (low-powered) charger.
@@ -102,7 +108,8 @@ cr.define('options', function() {
var usingDedicatedCharger = false;
if (selectedId) {
usingDedicatedCharger = sources.some(function(source) {
- return source.id == selectedId && source.type == DeviceType.CHARGER;
+ return source.id == selectedId &&
+ source.type == options.PowerStatusDeviceType.DEDICATED_CHARGER;
});
}
@@ -120,7 +127,7 @@ cr.define('options', function() {
/**
* Populates and shows the dropdown of available power sources.
- * @param {Array<PowerSource>} sources External power sources.
+ * @param {Array<options.PowerSource>} sources External power sources.
* @param {string} selectedId The ID of the currently used power source.
* The empty string indicates no external power source is in use
* (running on battery).
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/chromeos/power_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698