OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 * The deserialized form of the chromoting host as returned by Apiary. | 7 * The deserialized form of the chromoting host as returned by Apiary. |
8 */ | 8 */ |
9 | 9 |
10 'use strict'; | 10 'use strict'; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // remoting.HostSettings. | 70 // remoting.HostSettings. |
71 remoting.HostSettings.save(this.hostId_, this); | 71 remoting.HostSettings.save(this.hostId_, this); |
72 }; | 72 }; |
73 | 73 |
74 | 74 |
75 /** @return {Promise} A promise that resolves when the settings are loaded. */ | 75 /** @return {Promise} A promise that resolves when the settings are loaded. */ |
76 remoting.Host.Options.prototype.load = function() { | 76 remoting.Host.Options.prototype.load = function() { |
77 var that = this; | 77 var that = this; |
78 return base.Promise.as(remoting.HostSettings.load, [this.hostId_]).then( | 78 return base.Promise.as(remoting.HostSettings.load, [this.hostId_]).then( |
79 /** | 79 /** |
80 * @param {Object.<string|boolean|number>} options | 80 * @param {Object<string|boolean|number>} options |
81 */ | 81 */ |
82 function(options) { | 82 function(options) { |
83 // Must be defaulted to true so that app-remoting can resize the host | 83 // Must be defaulted to true so that app-remoting can resize the host |
84 // upon launching. | 84 // upon launching. |
85 // TODO(kelvinp): Uses a separate host options for app-remoting that | 85 // TODO(kelvinp): Uses a separate host options for app-remoting that |
86 // hardcodes resizeToClient to true. | 86 // hardcodes resizeToClient to true. |
87 that.resizeToClient = | 87 that.resizeToClient = |
88 base.getBooleanAttr(options, 'resizeToClient', true); | 88 base.getBooleanAttr(options, 'resizeToClient', true); |
89 that.shrinkToFit = base.getBooleanAttr(options, 'shrinkToFit', true); | 89 that.shrinkToFit = base.getBooleanAttr(options, 'shrinkToFit', true); |
90 that.desktopScale = base.getNumberAttr(options, 'desktopScale', 1); | 90 that.desktopScale = base.getNumberAttr(options, 'desktopScale', 1); |
(...skipping 23 matching lines...) Expand all Loading... |
114 var hostMajorVersion = parseInt(host.hostVersion, 10); | 114 var hostMajorVersion = parseInt(host.hostVersion, 10); |
115 if (isNaN(hostMajorVersion)) { | 115 if (isNaN(hostMajorVersion)) { |
116 // Host versions 26 and higher include the version number in heartbeats, | 116 // Host versions 26 and higher include the version number in heartbeats, |
117 // so if it's missing then the host is at most version 25. | 117 // so if it's missing then the host is at most version 25. |
118 hostMajorVersion = 25; | 118 hostMajorVersion = 25; |
119 } | 119 } |
120 return (parseInt(webappVersion, 10) - hostMajorVersion) > 1; | 120 return (parseInt(webappVersion, 10) - hostMajorVersion) > 1; |
121 }; | 121 }; |
122 | 122 |
123 })(); | 123 })(); |
OLD | NEW |