| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright 2014 Google Inc | 2 Copyright 2014 Google Inc |
| 3 | 3 |
| 4 Licensed under the Apache License, Version 2.0 (the "License"); | 4 Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 you may not use this file except in compliance with the License. | 5 you may not use this file except in compliance with the License. |
| 6 You may obtain a copy of the License at | 6 You may obtain a copy of the License at |
| 7 | 7 |
| 8 https://www.apache.org/licenses/LICENSE-2.0 | 8 https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | 9 |
| 10 Unless required by applicable law or agreed to in writing, software | 10 Unless required by applicable law or agreed to in writing, software |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 /** True if have google+ scopes */ | 223 /** True if have google+ scopes */ |
| 224 _hasPlusScopes: false, | 224 _hasPlusScopes: false, |
| 225 | 225 |
| 226 /** | 226 /** |
| 227 * array of <google-signin-aware> | 227 * array of <google-signin-aware> |
| 228 * state changes are broadcast to them | 228 * state changes are broadcast to them |
| 229 */ | 229 */ |
| 230 signinAwares: [], | 230 signinAwares: [], |
| 231 | 231 |
| 232 init: function() { | 232 init: function() { |
| 233 var that = this; | |
| 234 document.addEventListener('DOMContentLoaded', function() { | 233 document.addEventListener('DOMContentLoaded', function() { |
| 235 that._apiLoader = document.createElement('google-js-api'); | 234 this._apiLoader = document.createElement('google-js-api'); |
| 236 that._apiLoader.addEventListener('js-api-load', that.loadAuth2.bind(th
at)); | 235 this._apiLoader.addEventListener('js-api-load', this.loadAuth2.bind(th
is)); |
| 237 if (Polymer.Element) { | 236 if (Polymer.Element) { |
| 238 document.body.appendChild(that._apiLoader); | 237 document.body.appendChild(this._apiLoader); |
| 239 } | 238 } |
| 240 }) | 239 }.bind(this)); |
| 241 }, | 240 }, |
| 242 | 241 |
| 243 loadAuth2: function() { | 242 loadAuth2: function() { |
| 244 var that = this; | 243 var that = this; |
| 245 gapi.load('auth2', that.initAuth2.bind(that)); | 244 gapi.load('auth2', that.initAuth2.bind(that)); |
| 246 }, | 245 }, |
| 247 | 246 |
| 248 initAuth2: function() { | 247 initAuth2: function() { |
| 249 if (!('gapi' in window) || !('auth2' in window.gapi) || !this.clientId)
{ | 248 if (!('gapi' in window) || !('auth2' in window.gapi) || !this.clientId)
{ |
| 250 return; | 249 return; |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 }, | 818 }, |
| 820 | 819 |
| 821 _updateOfflineCode: function(code) { | 820 _updateOfflineCode: function(code) { |
| 822 if (code) { | 821 if (code) { |
| 823 this.fire('google-signin-offline-success', {code: code}); | 822 this.fire('google-signin-offline-success', {code: code}); |
| 824 } | 823 } |
| 825 } | 824 } |
| 826 }); | 825 }); |
| 827 })(); | 826 })(); |
| 828 </script> | 827 </script> |
| OLD | NEW |