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

Side by Side Diff: chrome/browser/resources/signin_internals/signin_internals.js

Issue 421583002: Show GAIA/cookie accounts on the signin-internals page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: include for CrOS Created 6 years, 4 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 | Annotate | Revision Log
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 var chrome = chrome || {}; 5 var chrome = chrome || {};
6 6
7 /** 7 /**
8 * Organizes all signin event listeners and asynchronous requests. 8 * Organizes all signin event listeners and asynchronous requests.
9 * This object has no public constructor. 9 * This object has no public constructor.
10 * @type {Object} 10 * @type {Object}
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 } else { 105 } else {
106 console.error(e); 106 console.error(e);
107 } 107 }
108 } 108 }
109 } 109 }
110 }; 110 };
111 111
112 // These are the events that will be registered. 112 // These are the events that will be registered.
113 chrome.signin.events = { 113 chrome.signin.events = {
114 'signin_manager': [ 114 'signin_manager': [
115 'onSigninInfoChanged' 115 'onSigninInfoChanged',
116 'onCookieAccountsFetched'
116 ] 117 ]
117 }; 118 };
118 119
119 for (var eventType in chrome.signin.events) { 120 for (var eventType in chrome.signin.events) {
120 var events = chrome.signin.events[eventType]; 121 var events = chrome.signin.events[eventType];
121 for (var i = 0; i < events.length; ++i) { 122 for (var i = 0; i < events.length; ++i) {
122 var event = events[i]; 123 var event = events[i];
123 chrome.signin[event] = new Event(); 124 chrome.signin[event] = new Event();
124 } 125 }
125 } 126 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 for (var i = 0; i < signinFunctions.length; ++i) { 159 for (var i = 0; i < signinFunctions.length; ++i) {
159 var signinFunction = signinFunctions[i]; 160 var signinFunction = signinFunctions[i];
160 chrome.signin[signinFunction] = makeSigninFunction(signinFunction); 161 chrome.signin[signinFunction] = makeSigninFunction(signinFunction);
161 } 162 }
162 163
163 chrome.signin.internalsInfo = {}; 164 chrome.signin.internalsInfo = {};
164 165
165 // Replace the displayed values with the latest fetched ones. 166 // Replace the displayed values with the latest fetched ones.
166 function refreshSigninInfo(signinInfo) { 167 function refreshSigninInfo(signinInfo) {
167 chrome.signin.internalsInfo = signinInfo; 168 chrome.signin.internalsInfo = signinInfo;
168 var internalsInfoDiv = $('signin-info'); 169 jstProcess(new JsEvalContext(signinInfo), $('signin-info'));
169 jstProcess(new JsEvalContext(signinInfo), internalsInfoDiv); 170 jstProcess(new JsEvalContext(signinInfo), $('token-info'));
170 var tokenInfoDiv = $('token-info'); 171 }
171 jstProcess(new JsEvalContext(signinInfo), tokenInfoDiv); 172
173 // Replace the cookie information with the fetched values.
174 function updateCookieAccounts(cookieAccountsInfo) {
175 jstProcess(new JsEvalContext(cookieAccountsInfo), $('cookie-info'));
172 } 176 }
173 177
174 // On load, do an initial refresh and register refreshSigninInfo to be invoked 178 // On load, do an initial refresh and register refreshSigninInfo to be invoked
175 // whenever we get new signin information from SigninInternalsUI. 179 // whenever we get new signin information from SigninInternalsUI.
176 function onLoad() { 180 function onLoad() {
177 chrome.signin.getSigninInfo(refreshSigninInfo); 181 chrome.signin.getSigninInfo(refreshSigninInfo);
178 182
179 chrome.signin.onSigninInfoChanged.addListener(function(info) { 183 chrome.signin.onSigninInfoChanged.addListener(refreshSigninInfo);
180 refreshSigninInfo(info); 184 chrome.signin.onCookieAccountsFetched.addListener(updateCookieAccounts);
181 });
182 } 185 }
183 186
184 document.addEventListener('DOMContentLoaded', onLoad, false); 187 document.addEventListener('DOMContentLoaded', onLoad, false);
185 })(); 188 })();
OLDNEW
« no previous file with comments | « chrome/browser/resources/signin_internals/signin_index.html ('k') | chrome/browser/signin/chrome_signin_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698