OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 /** @suppress {duplicate} */ |
| 6 var remoting = remoting || {}; |
| 7 |
| 8 (function() { |
| 9 |
| 10 'use strict'; |
| 11 |
| 12 /** @constructor */ |
| 13 remoting.PublicSession = function() { |
| 14 // Initialize global dependencies. |
| 15 l10n.localize(); |
| 16 remoting.identity = new remoting.Identity(); |
| 17 remoting.settings = new remoting.Settings(); |
| 18 |
| 19 /** @private */ |
| 20 this.eventHooks_ = new base.Disposables( |
| 21 new base.DomEventHook(document.getElementById('host-finished-button'), |
| 22 'click', this.exit_.bind(this), false), |
| 23 new base.DomEventHook(document.getElementById('cancel-share-button'), |
| 24 'click', this.exit_.bind(this), false)); |
| 25 }; |
| 26 |
| 27 remoting.PublicSession.prototype.start = function() { |
| 28 remoting.tryShare(); |
| 29 }; |
| 30 |
| 31 /** @private */ |
| 32 remoting.PublicSession.prototype.exit_ = function() { |
| 33 base.dispose(this.eventHooks_); |
| 34 this.eventHooks_ = null; |
| 35 chrome.app.window.current().close(); |
| 36 }; |
| 37 |
| 38 window.addEventListener('load', function () { |
| 39 remoting.publicSession = new remoting.PublicSession(); |
| 40 remoting.publicSession.start(); |
| 41 }, false); |
| 42 |
| 43 })(); |
| 44 |
OLD | NEW |