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

Unified Diff: remoting/webapp/me2mom/wcs_loader.js

Issue 8758001: Launch Me2Me connections in a new tab. Remove OK button from post-connect screens for Me2Me. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« remoting/webapp/me2mom/client_screen.js ('K') | « remoting/webapp/me2mom/util.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/me2mom/wcs_loader.js
diff --git a/remoting/webapp/me2mom/wcs_loader.js b/remoting/webapp/me2mom/wcs_loader.js
index 8b931f1158d4701bb8b419a1ba4d697acc646263..1d159240353c3728ea7fb7e11fbb261af3efc5f0 100644
--- a/remoting/webapp/me2mom/wcs_loader.js
+++ b/remoting/webapp/me2mom/wcs_loader.js
@@ -76,6 +76,28 @@ remoting.WcsLoader.prototype.TALK_GADGET_URL_ =
'https://talkgadget.google.com/talkgadget/';
/**
+ * Starts loading the WCS IQ client aynchronously. If an OAuth2 token is
+ * already available, this is equivalent to the start method; if not, then
+ * the client will be loaded after an OAuth token exchange has occurred.
+ *
+ * @param {function(function(string): void): void} tokenRefresh
+ * Gets a (possibly updated) access token asynchronously.
+ * @param {function(boolean): void} onReady If the WCS connection is not yet
+ * ready, then |onReady| will be called with a true parameter when it is
+ * ready, or with a false parameter on error.
+ * @return {void} Nothing.
+ */
+remoting.WcsLoader.prototype.startAsync = function(tokenRefresh, onReady) {
+ /** @type {remoting.WcsLoader} */
+ var that = this;
+ /** @param {string} token The OAuth2 access token. */
+ var start = function(token) {
+ that.start(token, tokenRefresh, onReady);
+ };
+ remoting.oauth2.callWithToken(start);
+};
+
+/**
* Starts loading the WCS IQ client.
*
* When it's loaded, construct remoting.wcs as a wrapper for it.
« remoting/webapp/me2mom/client_screen.js ('K') | « remoting/webapp/me2mom/util.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698