OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 /** | 5 /** |
6 * Javascript for local_state.html, served from chrome://local-state/ | 6 * Javascript for local_state.html, served from chrome://local-state/ |
7 * This is used to debug the contents of the Local State file. | 7 * This is used to debug the contents of the Local State file. |
8 */ | 8 */ |
9 | 9 |
10 cr.define('localState', function() { | 10 cr.define('localState', function() { |
11 'use strict'; | 11 'use strict'; |
12 | 12 |
13 /** | 13 /** |
14 * Sets the page content to the specified |localState| string, called | 14 * Sets the page content to the specified |localState| string, called |
15 * from C++. | 15 * from C++. |
16 * @param {string} localState the JSON-formatted local state data, | 16 * @param {string} localState the JSON-formatted local state data, |
17 * or an error message. | 17 * or an error message. |
18 */ | 18 */ |
19 function setLocalState(localState) { | 19 function setLocalState(localState) { |
20 $('content').textContent = localState; | 20 $('content').textContent = localState; |
21 } | 21 } |
22 | 22 |
23 return { | 23 return {setLocalState: setLocalState}; |
24 setLocalState: setLocalState | |
25 }; | |
26 }); | 24 }); |
27 | 25 |
28 // When the page loads, request the JSON local state data from C++. | 26 // When the page loads, request the JSON local state data from C++. |
29 document.addEventListener('DOMContentLoaded', function() { | 27 document.addEventListener('DOMContentLoaded', function() { |
30 chrome.send('requestJson'); | 28 chrome.send('requestJson'); |
31 }); | 29 }); |
OLD | NEW |