OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/invalidation/ticl_invalidation_service.h" | 5 #include "chrome/browser/invalidation/ticl_invalidation_service.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/invalidation/invalidation_service_util.h" | 10 #include "chrome/browser/invalidation/invalidation_service_util.h" |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 return false; | 313 return false; |
314 } | 314 } |
315 | 315 |
316 if (signin_manager_->GetAuthenticatedUsername().empty()) { | 316 if (signin_manager_->GetAuthenticatedUsername().empty()) { |
317 DVLOG(2) << "Not starting TiclInvalidationService: User is not signed in."; | 317 DVLOG(2) << "Not starting TiclInvalidationService: User is not signed in."; |
318 return false; | 318 return false; |
319 } | 319 } |
320 | 320 |
321 if (!oauth2_token_service_) { | 321 if (!oauth2_token_service_) { |
322 DVLOG(2) | 322 DVLOG(2) |
323 << "Not starting TiclInvalidationService: TokenService unavailable."; | 323 << "Not starting TiclInvalidationService: " |
| 324 << "OAuth2TokenService unavailable."; |
324 return false; | 325 return false; |
325 } | 326 } |
326 | 327 |
327 if (!oauth2_token_service_->RefreshTokenIsAvailable( | 328 if (!oauth2_token_service_->RefreshTokenIsAvailable( |
328 oauth2_token_service_->GetPrimaryAccountId())) { | 329 oauth2_token_service_->GetPrimaryAccountId())) { |
329 DVLOG(2) | 330 DVLOG(2) |
330 << "Not starting TiclInvalidationServce: Waiting for refresh token."; | 331 << "Not starting TiclInvalidationServce: Waiting for refresh token."; |
331 return false; | 332 return false; |
332 } | 333 } |
333 | 334 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 } | 398 } |
398 | 399 |
399 // This service always expects to have a valid invalidator storage. | 400 // This service always expects to have a valid invalidator storage. |
400 // So we must not only clear the old one, but also start a new one. | 401 // So we must not only clear the old one, but also start a new one. |
401 invalidator_storage_->Clear(); | 402 invalidator_storage_->Clear(); |
402 invalidator_storage_.reset(new InvalidatorStorage(profile_->GetPrefs())); | 403 invalidator_storage_.reset(new InvalidatorStorage(profile_->GetPrefs())); |
403 invalidator_storage_->SetInvalidatorClientId(GenerateInvalidatorClientId()); | 404 invalidator_storage_->SetInvalidatorClientId(GenerateInvalidatorClientId()); |
404 } | 405 } |
405 | 406 |
406 } // namespace invalidation | 407 } // namespace invalidation |
OLD | NEW |