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/base/js/auth_init.js

Issue 959963002: [Chromoting] Enable jscompile for webapp unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix key tester Created 5 years, 9 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/remoting_webapp_files.gypi ('k') | remoting/webapp/base/js/ipc.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 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 '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 24 matching lines...) Expand all
35 remoting.identity = /** @type {remoting.Identity} */ (oauth2); 35 remoting.identity = /** @type {remoting.Identity} */ (oauth2);
36 if (!remoting.identity.isAuthenticated()) { 36 if (!remoting.identity.isAuthenticated()) {
37 remoting.AuthDialog.getInstance().show().then(function() { 37 remoting.AuthDialog.getInstance().show().then(function() {
38 remoting.oauth2.doAuthRedirect(function(){ 38 remoting.oauth2.doAuthRedirect(function(){
39 window.location.reload(); 39 window.location.reload();
40 }); 40 });
41 }); 41 });
42 } 42 }
43 } 43 }
44 44
45 remoting.identity.getUserInfo().then(function(userInfo) { 45 remoting.identity.getUserInfo().then(
46 onUserInfoAvailable(userInfo.email, userInfo.name); 46 /** @param {{email:string, name:string}} userInfo */
47 }).catch(function(error) { 47 function(userInfo) {
48 onGetIdentityInfoError( 48 onUserInfoAvailable(userInfo.email, userInfo.name);
49 /** @type {remoting.Error} */ (error)); 49 }).catch(function(error) {
50 }); 50 onGetIdentityInfoError(
51 /** @type {remoting.Error} */ (error));
52 });
51 }; 53 };
52 54
53 /** 55 /**
54 * Removes the cached token and restarts the app. 56 * Removes the cached token and restarts the app.
55 * 57 *
56 * @return {void} Nothing. 58 * @return {void} Nothing.
57 */ 59 */
58 remoting.handleAuthFailureAndRelaunch = function() { 60 remoting.handleAuthFailureAndRelaunch = function() {
59 remoting.identity.removeCachedAuthToken().then(function(){ 61 remoting.identity.removeCachedAuthToken().then(function(){
60 if (base.isAppsV2()) { 62 if (base.isAppsV2()) {
61 base.Ipc.invoke('remoting.ActivationHandler.restart', 63 base.Ipc.invoke('remoting.ActivationHandler.restart',
62 chrome.app.window.current().id); 64 chrome.app.window.current().id);
63 } else { 65 } else {
64 window.location.reload(); 66 window.location.reload();
65 } 67 }
66 }); 68 });
67 }; 69 };
OLDNEW
« no previous file with comments | « remoting/remoting_webapp_files.gypi ('k') | remoting/webapp/base/js/ipc.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698