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

Side by Side Diff: remoting/webapp/crd/js/desktop_remoting.js

Issue 1082383002: [Webapp Refactor] Remove remoting.clientSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix browser tests 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
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 * This class implements the functionality that is specific to desktop 7 * This class implements the functionality that is specific to desktop
8 * remoting ("Chromoting" or CRD). 8 * remoting ("Chromoting" or CRD).
9 */ 9 */
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 }; 42 };
43 43
44 /** 44 /**
45 * @override {remoting.ApplicationInterface} 45 * @override {remoting.ApplicationInterface}
46 */ 46 */
47 remoting.DesktopRemoting.prototype.initApplication_ = function() { 47 remoting.DesktopRemoting.prototype.initApplication_ = function() {
48 remoting.initElementEventHandlers(); 48 remoting.initElementEventHandlers();
49 49
50 if (base.isAppsV2()) { 50 if (base.isAppsV2()) {
51 remoting.windowFrame = new remoting.WindowFrame( 51 remoting.windowFrame = new remoting.WindowFrame(
52 document.getElementById('title-bar')); 52 document.getElementById('title-bar'), this.disconnect_.bind(this));
53 remoting.optionsMenu = remoting.windowFrame.createOptionsMenu(); 53 remoting.optionsMenu = remoting.windowFrame.createOptionsMenu();
54 54
55 var START_FULLSCREEN = 'start-fullscreen'; 55 var START_FULLSCREEN = 'start-fullscreen';
56 remoting.fullscreen = new remoting.FullscreenAppsV2(); 56 remoting.fullscreen = new remoting.FullscreenAppsV2();
57 remoting.fullscreen.addListener(function(isFullscreen) { 57 remoting.fullscreen.addListener(function(isFullscreen) {
58 chrome.storage.local.set({START_FULLSCREEN: isFullscreen}); 58 chrome.storage.local.set({START_FULLSCREEN: isFullscreen});
59 }); 59 });
60 // TODO(jamiewalch): This should be handled by the background page when the 60 // TODO(jamiewalch): This should be handled by the background page when the
61 // window is created, but due to crbug.com/51587 it needs to be done here. 61 // window is created, but due to crbug.com/51587 it needs to be done here.
62 // Remove this hack once that bug is fixed. 62 // Remove this hack once that bug is fixed.
63 chrome.storage.local.get( 63 chrome.storage.local.get(
64 START_FULLSCREEN, 64 START_FULLSCREEN,
65 /** @param {Object} values */ 65 /** @param {Object} values */
66 function(values) { 66 function(values) {
67 if (values[START_FULLSCREEN]) { 67 if (values[START_FULLSCREEN]) {
68 remoting.fullscreen.activate(true); 68 remoting.fullscreen.activate(true);
69 } 69 }
70 } 70 }
71 ); 71 );
72 72
73 } else { 73 } else {
74 remoting.fullscreen = new remoting.FullscreenAppsV1(); 74 remoting.fullscreen = new remoting.FullscreenAppsV1();
75 remoting.toolbar = new remoting.Toolbar( 75 remoting.toolbar = new remoting.Toolbar(
76 document.getElementById('session-toolbar')); 76 document.getElementById('session-toolbar'),
77 this.disconnect_.bind(this));
77 remoting.optionsMenu = remoting.toolbar.createOptionsMenu(); 78 remoting.optionsMenu = remoting.toolbar.createOptionsMenu();
78 79
79 window.addEventListener('beforeunload', 80 window.addEventListener('beforeunload',
80 this.promptClose_.bind(this), false); 81 this.promptClose_.bind(this), false);
81 window.addEventListener('unload', 82 window.addEventListener('unload', this.disconnect_.bind(this), false);
82 remoting.app.disconnect.bind(remoting.app), false);
83 } 83 }
84 84
85 remoting.initHostlist_(this.connectMe2Me_.bind(this)); 85 remoting.initHostlist_(this.connectMe2Me_.bind(this));
86 document.getElementById('access-mode-button').addEventListener( 86 document.getElementById('access-mode-button').addEventListener(
87 'click', this.connectIt2Me_.bind(this), false); 87 'click', this.connectIt2Me_.bind(this), false);
88 88
89 var homeFeedback = new remoting.MenuButton( 89 var homeFeedback = new remoting.MenuButton(
90 document.getElementById('help-feedback-main')); 90 document.getElementById('help-feedback-main'));
91 var toolbarFeedback = new remoting.MenuButton( 91 var toolbarFeedback = new remoting.MenuButton(
92 document.getElementById('help-feedback-toolbar')); 92 document.getElementById('help-feedback-toolbar'));
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 } 182 }
183 } 183 }
184 }; 184 };
185 185
186 /** @returns {remoting.DesktopConnectedView} */ 186 /** @returns {remoting.DesktopConnectedView} */
187 remoting.DesktopRemoting.prototype.getConnectedViewForTesting = function() { 187 remoting.DesktopRemoting.prototype.getConnectedViewForTesting = function() {
188 var activity = /** @type {remoting.Me2MeActivity} */ (this.activity_); 188 var activity = /** @type {remoting.Me2MeActivity} */ (this.activity_);
189 return activity.getDesktopActivity().getConnectedView(); 189 return activity.getDesktopActivity().getConnectedView();
190 }; 190 };
191 191
192 remoting.DesktopRemoting.prototype.getActivity = function() {
193 return this.activity_;
194 };
195
196 remoting.DesktopRemoting.prototype.disconnect_ = function() {
197 if (this.activity_) {
198 this.activity_.stop();
199 }
200 };
201
192 /** 202 /**
193 * Entry-point for Me2Me connections. 203 * Entry-point for Me2Me connections.
194 * 204 *
195 * @param {string} hostId The unique id of the host. 205 * @param {string} hostId The unique id of the host.
196 * @return {void} Nothing. 206 * @return {void} Nothing.
197 * @private 207 * @private
198 */ 208 */
199 remoting.DesktopRemoting.prototype.connectMe2Me_ = function(hostId) { 209 remoting.DesktopRemoting.prototype.connectMe2Me_ = function(hostId) {
200 var host = remoting.hostList.getHostForId(hostId); 210 var host = remoting.hostList.getHostForId(hostId);
201 base.dispose(this.activity_); 211 base.dispose(this.activity_);
202 this.activity_ = new remoting.Me2MeActivity(host); 212 this.activity_ = new remoting.Me2MeActivity(host);
203 this.activity_.start(); 213 this.activity_.start();
204 }; 214 };
205 215
206 /** 216 /**
207 * Entry-point for It2Me connections. 217 * Entry-point for It2Me connections.
208 * 218 *
209 * @private 219 * @private
210 */ 220 */
211 remoting.DesktopRemoting.prototype.connectIt2Me_ = function() { 221 remoting.DesktopRemoting.prototype.connectIt2Me_ = function() {
212 base.dispose(this.activity_); 222 base.dispose(this.activity_);
213 this.activity_ = new remoting.It2MeActivity(); 223 this.activity_ = new remoting.It2MeActivity();
214 this.activity_.start(); 224 this.activity_.start();
215 }; 225 };
OLDNEW
« no previous file with comments | « remoting/webapp/crd/js/client_plugin_impl.js ('k') | remoting/webapp/crd/js/desktop_remoting_activity.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698