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

Unified Diff: remoting/webapp/crd/js/public_session_main.js

Issue 1370283004: [Chromoting] Remote Assistance in Public Session. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@PublicSession
Patch Set: Fix GN build Created 5 years, 3 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/crd/js/public_session_main.js
diff --git a/remoting/webapp/crd/js/public_session_main.js b/remoting/webapp/crd/js/public_session_main.js
new file mode 100644
index 0000000000000000000000000000000000000000..0bbc21e73ea073c6643e2c91ae475ab3e41ad6ff
--- /dev/null
+++ b/remoting/webapp/crd/js/public_session_main.js
@@ -0,0 +1,44 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/** @suppress {duplicate} */
+var remoting = remoting || {};
+
+(function() {
+
+'use strict';
+
+/** @constructor */
+remoting.PublicSession = function() {
+ // Initialize global dependencies.
+ l10n.localize();
+ remoting.identity = new remoting.Identity();
+ remoting.settings = new remoting.Settings();
+
+ /** @private */
+ this.eventHooks_ = new base.Disposables(
+ new base.DomEventHook(document.getElementById('host-finished-button'),
+ 'click', this.exit_.bind(this), false),
+ new base.DomEventHook(document.getElementById('cancel-share-button'),
+ 'click', this.exit_.bind(this), false));
+};
+
+remoting.PublicSession.prototype.start = function() {
+ remoting.tryShare();
+};
+
+/** @private */
+remoting.PublicSession.prototype.exit_ = function() {
+ base.dispose(this.eventHooks_);
+ this.eventHooks_ = null;
+ chrome.app.window.current().close();
+};
+
+window.addEventListener('load', function () {
+ remoting.publicSession = new remoting.PublicSession();
+ remoting.publicSession.start();
+}, false);
+
+})();
+

Powered by Google App Engine
This is Rietveld 408576698