OLD | NEW |
---|---|
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 /** @suppress {duplicate} */ | 5 /** @suppress {duplicate} */ |
6 var remoting = remoting || {}; | 6 var remoting = remoting || {}; |
7 | 7 |
8 (function(){ | 8 (function(){ |
9 | 9 |
10 'use strict'; | 10 'use strict'; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 * Restart the window with |id|. | 88 * Restart the window with |id|. |
89 * @param {string} id | 89 * @param {string} id |
90 * | 90 * |
91 * @private | 91 * @private |
92 */ | 92 */ |
93 remoting.ActivationHandler.prototype.onRestart_ = function(id) { | 93 remoting.ActivationHandler.prototype.onRestart_ = function(id) { |
94 this.appLauncher_.restart(id).then(this.onWindowCreated_.bind(this)); | 94 this.appLauncher_.restart(id).then(this.onWindowCreated_.bind(this)); |
95 }; | 95 }; |
96 | 96 |
97 /** | 97 /** |
98 * @param {Event} launchData | |
98 * @private | 99 * @private |
99 */ | 100 */ |
100 remoting.ActivationHandler.prototype.onLaunched_ = function() { | 101 remoting.ActivationHandler.prototype.onLaunched_ = function(launchData) { |
101 this.createWindow_(); | 102 if (launchData['isPublicSession']) { |
103 this.launchPublicSession_(); | |
Jamie
2015/09/30 20:24:09
We're not really launching a public session; we're
kelvinp
2015/09/30 23:13:49
Done.
| |
104 } else { | |
105 this.createWindow_(); | |
106 } | |
102 }; | 107 }; |
103 | 108 |
104 /** | 109 /** |
105 * Create a new app window and register for the closed event. | 110 * Create a new app window and register for the closed event. |
106 * | 111 * |
107 * @private | 112 * @private |
108 */ | 113 */ |
109 remoting.ActivationHandler.prototype.createWindow_ = function() { | 114 remoting.ActivationHandler.prototype.createWindow_ = function() { |
110 this.appLauncher_.launch().then(this.onWindowCreated_.bind(this)); | 115 this.appLauncher_.launch().then(this.onWindowCreated_.bind(this)); |
111 }; | 116 }; |
(...skipping 25 matching lines...) Expand all Loading... | |
137 */ | 142 */ |
138 remoting.ActivationHandler.prototype.onWindowClosed_ = function(id) { | 143 remoting.ActivationHandler.prototype.onWindowClosed_ = function(id) { |
139 // Unhook the event. | 144 // Unhook the event. |
140 var hook = /** @type {base.Disposable} */ (this.windowClosedHooks_.get(id)); | 145 var hook = /** @type {base.Disposable} */ (this.windowClosedHooks_.get(id)); |
141 base.dispose(hook); | 146 base.dispose(hook); |
142 this.windowClosedHooks_.delete(id); | 147 this.windowClosedHooks_.delete(id); |
143 | 148 |
144 this.raiseEvent(remoting.ActivationHandler.Events.windowClosed, id); | 149 this.raiseEvent(remoting.ActivationHandler.Events.windowClosed, id); |
145 }; | 150 }; |
146 | 151 |
152 /** @private */ | |
153 remoting.ActivationHandler.prototype.launchPublicSession_ = function() { | |
154 chrome.app.window.create("public_session.html", { | |
155 'width': 570, | |
156 'height': 300, | |
157 'resizable': false | |
158 }); | |
159 }; | |
160 | |
147 })(); | 161 })(); |
148 | 162 |
149 /** @enum {string} */ | 163 /** @enum {string} */ |
150 remoting.ActivationHandler.Events = { | 164 remoting.ActivationHandler.Events = { |
151 windowClosed: 'windowClosed' | 165 windowClosed: 'windowClosed' |
152 }; | 166 }; |
OLD | NEW |