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

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

Issue 687873003: Allow the background page to get an OAuth token for apps v1. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
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 function onLoad() { 10 function onLoad() {
(...skipping 22 matching lines...) Expand all
33 var sendAccessCode = function(event) { 33 var sendAccessCode = function(event) {
34 remoting.connectIT2Me(); 34 remoting.connectIT2Me();
35 event.preventDefault(); 35 event.preventDefault();
36 }; 36 };
37 var reconnect = function() { 37 var reconnect = function() {
38 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING); 38 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING);
39 remoting.connector.reconnect(); 39 remoting.connector.reconnect();
40 }; 40 };
41 var doAuthRedirect = function() { 41 var doAuthRedirect = function() {
42 if (!base.isAppsV2()) { 42 if (!base.isAppsV2()) {
43 remoting.oauth2.doAuthRedirect(); 43 remoting.oauth2.doAuthRedirect(function() {
44 window.location.reload();
45 });
44 } 46 }
45 }; 47 };
46 var fixAuthError = function() { 48 var fixAuthError = function() {
47 if (base.isAppsV2()) { 49 if (base.isAppsV2()) {
48 var onRefresh = function() { 50 var onRefresh = function() {
49 remoting.hostList.display(); 51 remoting.hostList.display();
50 }; 52 };
51 var refreshHostList = function() { 53 var refreshHostList = function() {
52 goHome(); 54 goHome();
53 remoting.hostList.refresh(onRefresh); 55 remoting.hostList.refresh(onRefresh);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 if (element) { 152 if (element) {
151 element.addEventListener(eventname, fn, false); 153 element.addEventListener(eventname, fn, false);
152 } else { 154 } else {
153 console.error('Could not set ' + eventname + 155 console.error('Could not set ' + eventname +
154 ' event handler on element ' + id + 156 ' event handler on element ' + id +
155 ': element not found.'); 157 ': element not found.');
156 } 158 }
157 } 159 }
158 160
159 window.addEventListener('load', onLoad, false); 161 window.addEventListener('load', onLoad, false);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698