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

Unified Diff: chrome/browser/resources/snippets_internals.js

Issue 1978513002: Getting the personalization info in chrome://snippets-internals correct. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Polish Created 4 years, 7 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
Index: chrome/browser/resources/snippets_internals.js
diff --git a/chrome/browser/resources/snippets_internals.js b/chrome/browser/resources/snippets_internals.js
index b66c94100c5e26522bed565ea0ac1d327d46c858..f53c61b1b1f883ab5389390bbca9d824baec162b 100644
--- a/chrome/browser/resources/snippets_internals.js
+++ b/chrome/browser/resources/snippets_internals.js
@@ -38,6 +38,10 @@ cr.define('chrome.SnippetsInternals', function() {
chrome.send('loaded');
}
+ function hideHostRestricts() {
+ $('hosts-restrict').classList.add('hidden');
+ }
+
function receiveProperty(propertyId, value) {
$(propertyId).textContent = value;
}
@@ -59,8 +63,11 @@ cr.define('chrome.SnippetsInternals', function() {
}
function receiveJson(json) {
- receiveProperty('last-json-text', json);
- if (json) {
+ var trimmed = json.trim();
+ var hasContent = (trimmed && trimmed != '{}');
+
+ if (hasContent) {
+ receiveProperty('last-json-text', trimmed);
$('last-json').classList.remove('hidden');
} else {
$('last-json').classList.add('hidden');
@@ -106,6 +113,7 @@ cr.define('chrome.SnippetsInternals', function() {
// Return an object with all of the exports.
return {
initialize: initialize,
+ hideHostRestricts: hideHostRestricts,
receiveProperty: receiveProperty,
receiveHosts: receiveHosts,
receiveSnippets: receiveSnippets,

Powered by Google App Engine
This is Rietveld 408576698