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

Unified Diff: components/gcm_driver/resources/gcm_internals.js

Issue 1515153003: Enable chrome://gcm-internals on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « components/gcm_driver/resources/gcm_internals.html ('k') | components/resources/gcm_driver_resources.grdp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/resources/gcm_internals.js
diff --git a/components/gcm_driver/resources/gcm_internals.js b/components/gcm_driver/resources/gcm_internals.js
index 2bddedf531dd0db3b9ee2bbc0bd74fe6555a8914..b2a981ace0bf2c3aeb2a51abe6e6f7cf3fafb396 100644
--- a/components/gcm_driver/resources/gcm_internals.js
+++ b/components/gcm_driver/resources/gcm_internals.js
@@ -12,13 +12,17 @@ cr.define('gcmInternals', function() {
* element to the value of this property. Otherwise clear the content.
* @param {!Object} info A dictionary of device infos to be displayed.
* @param {string} prop Name of the property.
- * @param {string} element The id of a HTML element.
+ * @param {string} elementId The id of a HTML element.
*/
- function setIfExists(info, prop, element) {
+ function setIfExists(info, prop, elementId) {
+ var element = $(elementId);
+ if (!element)
+ return;
+
if (info[prop] !== undefined) {
- $(element).textContent = info[prop];
+ element.textContent = info[prop];
} else {
- $(element).textContent = '';
+ element.textContent = '';
}
}
@@ -106,14 +110,17 @@ cr.define('gcmInternals', function() {
/**
* Refresh the log html table by clearing it first. If data is not empty, then
* it will be used to populate the table.
- * @param {string} id ID of the log html table.
+ * @param {string} tableId ID of the log html table.
* @param {!Object} data A list of list of data items.
*/
- function refreshLogTable(id, data) {
- removeAllChildNodes($(id));
- if (data !== undefined) {
- addRows($(id), data);
- }
+ function refreshLogTable(tableId, data) {
+ var element = $(tableId);
+ if (!element)
+ return;
+
+ removeAllChildNodes(element);
+ if (data !== undefined)
+ addRows(element, data);
}
/**
« no previous file with comments | « components/gcm_driver/resources/gcm_internals.html ('k') | components/resources/gcm_driver_resources.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698