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

Side by Side Diff: remoting/webapp/base/js/base.js

Issue 868203002: Handle authentication failures in the v2 app by restarting the app (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * A module that contains basic utility components and methods for the 7 * A module that contains basic utility components and methods for the
8 * chromoting project 8 * chromoting project
9 * 9 *
10 */ 10 */
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 * @param {string} jsonString A JSON-encoded string. 460 * @param {string} jsonString A JSON-encoded string.
461 * @return {Object|undefined} The decoded object, or undefined if the string 461 * @return {Object|undefined} The decoded object, or undefined if the string
462 * cannot be parsed. 462 * cannot be parsed.
463 */ 463 */
464 base.jsonParseSafe = function(jsonString) { 464 base.jsonParseSafe = function(jsonString) {
465 try { 465 try {
466 return /** @type {Object} */ (JSON.parse(jsonString)); 466 return /** @type {Object} */ (JSON.parse(jsonString));
467 } catch (err) { 467 } catch (err) {
468 return undefined; 468 return undefined;
469 } 469 }
470 } 470 };
471
472 /**
473 * @return {boolean} whether the calling script is executing in the background
474 * page or not.
475 */
476 base.isBackgroundPage = function() {
477 return base.isAppsV2() && !Boolean(chrome.app.window.current());
478 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698