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

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: yet another rewrite of host merging logic 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 /** 73 /**
74 * @private {remoting.HostListApi} 74 * @private {remoting.HostListApi}
75 */ 75 */
76 var instance = null; 76 var instance = null;
77 77
78 /** 78 /**
79 * @return {!remoting.HostListApi} 79 * @return {!remoting.HostListApi}
80 */ 80 */
81 remoting.HostListApi.getInstance = function() { 81 remoting.HostListApi.getInstance = function() {
82 if (instance == null) { 82 if (instance == null) {
83 instance = remoting.settings.USE_GCD ? 83 if (remoting.settings.USE_GCD) {
84 new remoting.GcdHostListApi() : 84 var gcdInstance = new remoting.GcdHostListApi();
85 new remoting.LegacyHostListApi(); 85 var legacyInstance = new remoting.LegacyHostListApi();
86 instance = new remoting.CombinedHostListApi(legacyInstance, gcdInstance);
87 } else {
88 instance = new remoting.LegacyHostListApi();
89 }
86 } 90 }
87 return instance; 91 return instance;
88 }; 92 };
89 93
90 /** 94 /**
91 * For testing. 95 * For testing.
92 * @param {remoting.HostListApi} newInstance 96 * @param {remoting.HostListApi} newInstance
93 */ 97 */
94 remoting.HostListApi.setInstance = function(newInstance) { 98 remoting.HostListApi.setInstance = function(newInstance) {
95 instance = newInstance; 99 instance = newInstance;
(...skipping 16 matching lines...) Expand all
112 * 116 *
113 * hostId: The ID of the newly registered host. 117 * hostId: The ID of the newly registered host.
114 * 118 *
115 * @typedef {{ 119 * @typedef {{
116 * authCode: string, 120 * authCode: string,
117 * email: string, 121 * email: string,
118 * hostId: string 122 * hostId: string
119 * }} 123 * }}
120 */ 124 */
121 remoting.HostListApi.RegisterResult; 125 remoting.HostListApi.RegisterResult;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698