| 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 '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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |