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

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

Issue 1070223003: [Webapp Refactor] Remove remoting.js. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer's feedback Created 5 years, 8 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
« no previous file with comments | « remoting/webapp/base/js/application.js ('k') | remoting/webapp/crd/js/client_session.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 */ 740 */
741 base.jsonParseSafe = function(jsonString) { 741 base.jsonParseSafe = function(jsonString) {
742 try { 742 try {
743 return /** @type {Object} */ (JSON.parse(jsonString)); 743 return /** @type {Object} */ (JSON.parse(jsonString));
744 } catch (err) { 744 } catch (err) {
745 return undefined; 745 return undefined;
746 } 746 }
747 }; 747 };
748 748
749 /** 749 /**
750 * Return the current time as a formatted string suitable for logging.
751 *
752 * @return {string} The current time, formatted as the standard ISO string.
753 * [yyyy-mm-ddDhh:mm:ss.xyz]
754 */
755 base.timestamp = function() {
756 return '[' + new Date().toISOString() + ']';
757 };
758
759 /**
750 * Size the current window to fit its content vertically. 760 * Size the current window to fit its content vertically.
751 */ 761 */
752 base.resizeWindowToContent = function() { 762 base.resizeWindowToContent = function() {
753 var appWindow = chrome.app.window.current(); 763 var appWindow = chrome.app.window.current();
754 var outerBounds = appWindow.outerBounds; 764 var outerBounds = appWindow.outerBounds;
755 var borderY = outerBounds.height - appWindow.innerBounds.height; 765 var borderY = outerBounds.height - appWindow.innerBounds.height;
756 appWindow.resizeTo(outerBounds.width, document.body.clientHeight + borderY); 766 appWindow.resizeTo(outerBounds.width, document.body.clientHeight + borderY);
757 // Sometimes, resizing the window causes its position to be reset to (0, 0), 767 // Sometimes, resizing the window causes its position to be reset to (0, 0),
758 // so restore it explicitly. 768 // so restore it explicitly.
759 appWindow.moveTo(outerBounds.left, outerBounds.top); 769 appWindow.moveTo(outerBounds.left, outerBounds.top);
760 }; 770 };
OLDNEW
« no previous file with comments | « remoting/webapp/base/js/application.js ('k') | remoting/webapp/crd/js/client_session.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698