| OLD | NEW |
| 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 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/location.h" | 6 #include "base/location.h" |
| 7 #include "base/single_thread_task_runner.h" | 7 #include "base/single_thread_task_runner.h" |
| 8 #include "base/thread_task_runner_handle.h" | 8 #include "base/thread_task_runner_handle.h" |
| 9 #include "components/gcm_driver/gcm_driver.h" | 9 #include "components/gcm_driver/gcm_driver.h" |
| 10 #include "components/invalidation/gcm_invalidation_bridge.h" | 10 #include "components/invalidation/gcm_invalidation_bridge.h" |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 error, | 239 error, |
| 240 std::string())); | 240 std::string())); |
| 241 request_token_callback_.Reset(); | 241 request_token_callback_.Reset(); |
| 242 access_token_request_.reset(); | 242 access_token_request_.reset(); |
| 243 } | 243 } |
| 244 | 244 |
| 245 void GCMInvalidationBridge::InvalidateToken(const std::string& token) { | 245 void GCMInvalidationBridge::InvalidateToken(const std::string& token) { |
| 246 DCHECK(CalledOnValidThread()); | 246 DCHECK(CalledOnValidThread()); |
| 247 OAuth2TokenService::ScopeSet scopes; | 247 OAuth2TokenService::ScopeSet scopes; |
| 248 scopes.insert(GaiaConstants::kChromeSyncOAuth2Scope); | 248 scopes.insert(GaiaConstants::kChromeSyncOAuth2Scope); |
| 249 identity_provider_->GetTokenService()->InvalidateToken( | 249 identity_provider_->GetTokenService()->InvalidateAccessToken( |
| 250 identity_provider_->GetActiveAccountId(), scopes, token); | 250 identity_provider_->GetActiveAccountId(), scopes, token); |
| 251 } | 251 } |
| 252 | 252 |
| 253 void GCMInvalidationBridge::Register( | 253 void GCMInvalidationBridge::Register( |
| 254 syncer::GCMNetworkChannelDelegate::RegisterCallback callback) { | 254 syncer::GCMNetworkChannelDelegate::RegisterCallback callback) { |
| 255 DCHECK(CalledOnValidThread()); | 255 DCHECK(CalledOnValidThread()); |
| 256 // No-op if GCMClient is disabled. | 256 // No-op if GCMClient is disabled. |
| 257 if (gcm_driver_ == NULL) | 257 if (gcm_driver_ == NULL) |
| 258 return; | 258 return; |
| 259 | 259 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 | 368 |
| 369 void GCMInvalidationBridge::OnDisconnected() { | 369 void GCMInvalidationBridge::OnDisconnected() { |
| 370 core_thread_task_runner_->PostTask( | 370 core_thread_task_runner_->PostTask( |
| 371 FROM_HERE, | 371 FROM_HERE, |
| 372 base::Bind(&GCMInvalidationBridge::Core::OnConnectionStateChanged, | 372 base::Bind(&GCMInvalidationBridge::Core::OnConnectionStateChanged, |
| 373 core_, | 373 core_, |
| 374 false)); | 374 false)); |
| 375 } | 375 } |
| 376 | 376 |
| 377 } // namespace invalidation | 377 } // namespace invalidation |
| OLD | NEW |