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

Unified Diff: remoting/webapp/base/js/application.js

Issue 1070223003: [Webapp Refactor] Remove remoting.js. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove remoting.js 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 side-by-side diff with in-line comments
Download patch
Index: remoting/webapp/base/js/application.js
diff --git a/remoting/webapp/base/js/application.js b/remoting/webapp/base/js/application.js
index 5b6768b2044843d54a834a4acbab6f9818a74228..63cafa01309d4c55ac85792995231c8202d44e89 100644
--- a/remoting/webapp/base/js/application.js
+++ b/remoting/webapp/base/js/application.js
@@ -13,6 +13,13 @@
var remoting = remoting || {};
/**
+ * @type {base.EventSourceImpl} An event source object for handling global
+ * events. This is an interim hack. Eventually, we should move
+ * functionalities away from the remoting namespace and into smaller objects.
+ */
+remoting.testEvents;
+
+/**
* @constructor
*/
remoting.Application = function() {
@@ -80,7 +87,7 @@ remoting.Application.prototype.start = function() {
// global 'remoting' namespace.
remoting.settings = new remoting.Settings();
- remoting.initGlobalObjects();
+ this.initGlobalObjects_();
remoting.initIdentity();
this.initApplication_();
@@ -97,6 +104,42 @@ remoting.Application.prototype.start = function() {
});
};
+/** @private */
+remoting.Application.prototype.initGlobalObjects_ = function() {
kelvinp 2015/04/16 18:13:01 previously remoting.initGlobalObjects()
+ if (base.isAppsV2()) {
+ var htmlNode = /** @type {HTMLElement} */ (document.body.parentNode);
+ htmlNode.classList.add('apps-v2');
+ }
+
+ console.log(this.getExtensionInfo());
+ l10n.localize();
+ var sandbox =
+ /** @type {HTMLIFrameElement} */ (document.getElementById('wcs-sandbox'));
+ remoting.wcsSandbox = new remoting.WcsSandboxContainer(sandbox.contentWindow);
+ remoting.initModalDialogs();
+
+ remoting.testEvents = new base.EventSourceImpl();
+ /** @enum {string} */
+ remoting.testEvents.Names = {
+ uiModeChanged: 'uiModeChanged'
+ };
+ remoting.testEvents.defineEvents(base.values(remoting.testEvents.Names));
+};
+
+/**
+ * @return {string} Information about the current extension.
+ */
+remoting.Application.prototype.getExtensionInfo = function() {
kelvinp 2015/04/16 18:13:01 previously remoting.getExtensionInfo()
+ var v2OrLegacy = base.isAppsV2() ? " (v2)" : " (legacy)";
+ var manifest = chrome.runtime.getManifest();
+ if (manifest && manifest.version) {
+ var name = this.getApplicationName();
+ return name + ' version: ' + manifest.version + v2OrLegacy;
+ } else {
+ return 'Failed to get product version. Corrupt manifest?';
+ }
+};
+
/**
* These functions must be overridden in the subclass.
*/

Powered by Google App Engine
This is Rietveld 408576698