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

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

Issue 1217643002: Added HostListApl implementation to connect to legacy directory and GCD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gcd-e2e
Patch Set: Created 5 years, 5 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 * API for host-list management. 7 * API for host-list management.
8 */ 8 */
9 9
10 /** @suppress {duplicate} */ 10 /** @suppress {duplicate} */
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 * Attempts to look up a host using an ID derived from its publicly 64 * Attempts to look up a host using an ID derived from its publicly
65 * visible access code. 65 * visible access code.
66 * 66 *
67 * @param {string} supportId The support ID of the host to connect to. 67 * @param {string} supportId The support ID of the host to connect to.
68 * @return {!Promise<!remoting.Host>} 68 * @return {!Promise<!remoting.Host>}
69 */ 69 */
70 remoting.HostListApi.prototype.getSupportHost = function(supportId) { 70 remoting.HostListApi.prototype.getSupportHost = function(supportId) {
71 }; 71 };
72 72
73 /** 73 /**
74 * Get the host ID from the contents of a host config file.
75 *
76 * @param {!Object} config
77 * @return {string}
78 */
79 remoting.HostListApi.prototype.getHostIdFromConfig = function(config) {
80 };
81
82 /**
74 * @private {remoting.HostListApi} 83 * @private {remoting.HostListApi}
75 */ 84 */
76 var instance = null; 85 var instance = null;
77 86
78 /** 87 /**
79 * @return {!remoting.HostListApi} 88 * @return {!remoting.HostListApi}
80 */ 89 */
81 remoting.HostListApi.getInstance = function() { 90 remoting.HostListApi.getInstance = function() {
82 if (instance == null) { 91 if (instance == null) {
83 instance = remoting.settings.USE_GCD ? 92 if (remoting.settings.USE_GCD) {
84 new remoting.GcdHostListApi() : 93 var gcdInstance = new remoting.GcdHostListApi();
85 new remoting.LegacyHostListApi(); 94 var legacyInstance = new remoting.LegacyHostListApi();
95 instance = new remoting.CombinedHostListApi(legacyInstance, gcdInstance);
96 } else {
97 instance = new remoting.LegacyHostListApi();
98 }
86 } 99 }
87 return instance; 100 return instance;
88 }; 101 };
89 102
90 /** 103 /**
91 * For testing. 104 * For testing.
92 * @param {remoting.HostListApi} newInstance 105 * @param {remoting.HostListApi} newInstance
93 */ 106 */
94 remoting.HostListApi.setInstance = function(newInstance) { 107 remoting.HostListApi.setInstance = function(newInstance) {
95 instance = newInstance; 108 instance = newInstance;
(...skipping 20 matching lines...) Expand all
116 * registrations in GCD. 129 * registrations in GCD.
117 * 130 *
118 * @typedef {{ 131 * @typedef {{
119 * authCode: string, 132 * authCode: string,
120 * email: string, 133 * email: string,
121 * hostId: string, 134 * hostId: string,
122 * isLegacy: boolean 135 * isLegacy: boolean
123 * }} 136 * }}
124 */ 137 */
125 remoting.HostListApi.RegisterResult; 138 remoting.HostListApi.RegisterResult;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698