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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/common/chromevox_json.js

Issue 1100763002: Inject CanAddURLToHistory into TopSitesImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefs
Patch Set: Fix error introduced during rebase Created 5 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 unified diff | Download patch
OLDNEW
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 goog.provide('cvox.ChromeVoxJSON'); 5 goog.provide('cvox.ChromeVoxJSON');
6 6
7 7
8 /** 8 /**
9 * @fileoverview A simple wrapper around the JSON APIs. 9 * @fileoverview A simple wrapper around the JSON APIs.
10 * If it is possible to use the browser's built in native JSON, then 10 * If it is possible to use the browser's built in native JSON, then
11 * cvox.ChromeVoxJSON is the same as JSON. 11 * cvox.ChromeVoxJSON is the same as JSON.
12 * If the page has its own version of JSON, cvox.ChromeVoxJSON will use its 12 * If the page has its own version of JSON, cvox.ChromeVoxJSON will use its
13 * own implementation (rather than the version of JSON on the page 13 * own implementation (rather than the version of JSON on the page
14 * which may be outdated/broken). 14 * which may be outdated/broken).
15 */ 15 */
16 16
17 if (!cvox.ChromeVoxJSON) { 17 if (!cvox.ChromeVoxJSON) {
18 /** 18 /** Placeholder object. */
19 * @type {Object}
20 */
21 cvox.ChromeVoxJSON = {}; 19 cvox.ChromeVoxJSON = {};
22 } 20 }
23 21
24 if (window.JSON && window.JSON.toString() == '[object JSON]') { 22 if (window.JSON && window.JSON.toString() == '[object JSON]') {
25 cvox.ChromeVoxJSON = window.JSON; 23 cvox.ChromeVoxJSON = window.JSON;
26 } else { 24 } else {
27 /* 25 /*
28 * JSON implementation renamed to cvox.ChromeVoxJSON. 26 * JSON implementation renamed to cvox.ChromeVoxJSON.
29 * This only gets called if the page has its own version of JSON. 27 * This only gets called if the page has its own version of JSON.
30 * 28 *
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 return typeof reviver === 'function' ? walk({'': j}, '') : j; 359 return typeof reviver === 'function' ? walk({'': j}, '') : j;
362 } 360 }
363 361
364 // If the text is not JSON parseable, then a SyntaxError is thrown. 362 // If the text is not JSON parseable, then a SyntaxError is thrown.
365 363
366 throw new SyntaxError('JSON.parse'); 364 throw new SyntaxError('JSON.parse');
367 }; 365 };
368 } 366 }
369 }()); 367 }());
370 } 368 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698