| 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 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 28 matching lines...) Expand all Loading... |
| 39 function setClassFromValue(value) { | 39 function setClassFromValue(value) { |
| 40 if (value == 0) | 40 if (value == 0) |
| 41 return 'zero'; | 41 return 'zero'; |
| 42 if (value == 'Successful') | 42 if (value == 'Successful') |
| 43 return 'ok'; | 43 return 'ok'; |
| 44 | 44 |
| 45 return ''; | 45 return ''; |
| 46 } | 46 } |
| 47 | 47 |
| 48 // Allow signin_index.html to access the functions above using the | 48 // Allow signin_index.html to access the functions above using the |
| 49 // corresponding chrome.signin.<method> calls. | 49 // corresponding chrome.signin<method> calls. |
| 50 chrome.signin['highlightIfChanged'] = highlightIfChanged; | 50 chrome.signin['highlightIfChanged'] = highlightIfChanged; |
| 51 chrome.signin['highlightIfAnyChanged'] = highlightIfAnyChanged; | 51 chrome.signin['highlightIfAnyChanged'] = highlightIfAnyChanged; |
| 52 chrome.signin['setClassFromValue'] = setClassFromValue; | 52 chrome.signin['setClassFromValue'] = setClassFromValue; |
| 53 | 53 |
| 54 // Simplified Event class, borrowed (ok, stolen) from chrome_sync.js | 54 // Simplified Event class, borrowed (ok, stolen) from chrome_sync.js |
| 55 function Event() { | 55 function Event() { |
| 56 this.listeners_ = []; | 56 this.listeners_ = []; |
| 57 } | 57 } |
| 58 | 58 |
| 59 // Add a new listener to the list. | 59 // Add a new listener to the list. |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // whenever we get new signin information from SigninInternalsUI. | 179 // whenever we get new signin information from SigninInternalsUI. |
| 180 function onLoad() { | 180 function onLoad() { |
| 181 chrome.signin.getSigninInfo(refreshSigninInfo); | 181 chrome.signin.getSigninInfo(refreshSigninInfo); |
| 182 | 182 |
| 183 chrome.signin.onSigninInfoChanged.addListener(refreshSigninInfo); | 183 chrome.signin.onSigninInfoChanged.addListener(refreshSigninInfo); |
| 184 chrome.signin.onCookieAccountsFetched.addListener(updateCookieAccounts); | 184 chrome.signin.onCookieAccountsFetched.addListener(updateCookieAccounts); |
| 185 } | 185 } |
| 186 | 186 |
| 187 document.addEventListener('DOMContentLoaded', onLoad, false); | 187 document.addEventListener('DOMContentLoaded', onLoad, false); |
| 188 })(); | 188 })(); |
| OLD | NEW |