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

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

Issue 937593002: Changed identity API to use promises instead of callbacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed bad merge Created 5 years, 10 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/webapp/crd/js/oauth2.js ('k') | remoting/webapp/crd/js/session_connector_impl.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 (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 'use strict'; 5 'use strict';
6 6
7 /** @suppress {duplicate} */ 7 /** @suppress {duplicate} */
8 var remoting = remoting || {}; 8 var remoting = remoting || {};
9 9
10 /** 10 /**
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 } 103 }
104 }; 104 };
105 105
106 /** 106 /**
107 * Sign the user out of Chromoting by clearing (and revoking, if possible) the 107 * Sign the user out of Chromoting by clearing (and revoking, if possible) the
108 * OAuth refresh token. 108 * OAuth refresh token.
109 * 109 *
110 * Also clear all local storage, to avoid leaking information. 110 * Also clear all local storage, to avoid leaking information.
111 */ 111 */
112 remoting.signOut = function() { 112 remoting.signOut = function() {
113 remoting.oauth2.removeCachedAuthToken(function(){ 113 remoting.oauth2.removeCachedAuthToken().then(function(){
114 chrome.storage.local.clear(); 114 chrome.storage.local.clear();
115 remoting.setMode(remoting.AppMode.HOME); 115 remoting.setMode(remoting.AppMode.HOME);
116 window.location.reload(); 116 window.location.reload();
117 }); 117 });
118 }; 118 };
119 119
120 /** 120 /**
121 * Callback function called when the browser window gets a paste operation. 121 * Callback function called when the browser window gets a paste operation.
122 * 122 *
123 * @param {Event} event 123 * @param {Event} event
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 } else { 208 } else {
209 chrome.windows.get(tab.windowId, null, windowCallback); 209 chrome.windows.get(tab.windowId, null, windowCallback);
210 } 210 }
211 }; 211 };
212 if (chrome.tabs) { 212 if (chrome.tabs) {
213 chrome.tabs.getCurrent(tabCallback); 213 chrome.tabs.getCurrent(tabCallback);
214 } else { 214 } else {
215 console.error('chome.tabs is not available.'); 215 console.error('chome.tabs is not available.');
216 } 216 }
217 } 217 }
OLDNEW
« no previous file with comments | « remoting/webapp/crd/js/oauth2.js ('k') | remoting/webapp/crd/js/session_connector_impl.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698