| 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,
|
|
|