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

Side by Side Diff: remoting/webapp/app_remoting/js/app_connected_view.js

Issue 1109453005: [Chromoting] Extract shared viewport code into viewport.js. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « remoting/remoting_webapp_files.gypi ('k') | remoting/webapp/base/js/viewport.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 * Implements a basic UX control for a connected app remoting session. 7 * Implements a basic UX control for a connected app remoting session.
8 */ 8 */
9 9
10 /** @suppress {duplicate} */ 10 /** @suppress {duplicate} */
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 */ 115 */
116 remoting.AppConnectedView.prototype.onDesktopSizeChanged_ = 116 remoting.AppConnectedView.prototype.onDesktopSizeChanged_ =
117 function(hostDesktop) { 117 function(hostDesktop) {
118 // The first desktop size change indicates that we can close the loading 118 // The first desktop size change indicates that we can close the loading
119 // window. 119 // window.
120 remoting.LoadingWindow.close(); 120 remoting.LoadingWindow.close();
121 121
122 var hostSize = { width: hostDesktop.width, height: hostDesktop.height }; 122 var hostSize = { width: hostDesktop.width, height: hostDesktop.height };
123 var hostDpi = { x: hostDesktop.xDpi, y: hostDesktop.yDpi }; 123 var hostDpi = { x: hostDesktop.xDpi, y: hostDesktop.yDpi };
124 var clientArea = { width: window.innerWidth, height: window.innerHeight }; 124 var clientArea = { width: window.innerWidth, height: window.innerHeight };
125 var newSize = remoting.DesktopViewport.choosePluginSize( 125 var newSize = remoting.Viewport.choosePluginSize(
126 clientArea, window.devicePixelRatio, 126 clientArea, window.devicePixelRatio,
127 hostSize, hostDpi, this.host_.options.desktopScale, 127 hostSize, hostDpi, this.host_.options.desktopScale,
128 true /* fullscreen */ , true /* shrinkToFit */ ); 128 true /* fullscreen */ , true /* shrinkToFit */ );
129 129
130 this.plugin_.element().style.width = newSize.width + 'px'; 130 this.plugin_.element().style.width = newSize.width + 'px';
131 this.plugin_.element().style.height = newSize.height + 'px'; 131 this.plugin_.element().style.height = newSize.height + 'px';
132 }; 132 };
133 133
134 /** 134 /**
135 * @return {Array<string>} 135 * @return {Array<string>}
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 ]; 239 ];
240 remoting.identity.getNewToken(googleDriveScopes).then( 240 remoting.identity.getNewToken(googleDriveScopes).then(
241 function(/** string */ token){ 241 function(/** string */ token){
242 sendExtensionMessage('accessToken', token); 242 sendExtensionMessage('accessToken', token);
243 }).catch(remoting.Error.handler(function(/** remoting.Error */ error) { 243 }).catch(remoting.Error.handler(function(/** remoting.Error */ error) {
244 console.log('Failed to refresh access token: ' + error.toString()); 244 console.log('Failed to refresh access token: ' + error.toString());
245 })); 245 }));
246 }; 246 };
247 247
248 })(); 248 })();
OLDNEW
« no previous file with comments | « remoting/remoting_webapp_files.gypi ('k') | remoting/webapp/base/js/viewport.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698