| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/net/gaia/token_service.h" | 5 #include "chrome/browser/net/gaia/token_service.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "chrome/browser/chrome_thread.h" |
| 8 #include "chrome/browser/profile.h" | 9 #include "chrome/browser/profile.h" |
| 9 #include "chrome/common/net/gaia/gaia_authenticator2.h" | 10 #include "chrome/common/net/gaia/gaia_authenticator2.h" |
| 10 #include "chrome/common/net/gaia/gaia_constants.h" | 11 #include "chrome/common/net/gaia/gaia_constants.h" |
| 12 #include "chrome/common/net/url_request_context_getter.h" |
| 11 #include "chrome/common/notification_service.h" | 13 #include "chrome/common/notification_service.h" |
| 12 | 14 |
| 13 // Unfortunately kNumServices must be defined in the .h. | 15 // Unfortunately kNumServices must be defined in the .h. |
| 14 const char* TokenService::kServices[] = {GaiaConstants::kSyncService, | 16 const char* TokenService::kServices[] = {GaiaConstants::kSyncService, |
| 15 GaiaConstants::kTalkService}; | 17 GaiaConstants::kTalkService}; |
| 16 TokenService::TokenService() | 18 TokenService::TokenService() |
| 17 : token_loading_query_(NULL) { | 19 : token_loading_query_(NULL) { |
| 18 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); | 20 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); |
| 19 } | 21 } |
| 20 | 22 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 if (!db_token.empty()) { | 200 if (!db_token.empty()) { |
| 199 LOG(INFO) << "Loading " << kServices[i] << "token from DB:" | 201 LOG(INFO) << "Loading " << kServices[i] << "token from DB:" |
| 200 << db_token; | 202 << db_token; |
| 201 (*in_memory_tokens)[kServices[i]] = db_token; | 203 (*in_memory_tokens)[kServices[i]] = db_token; |
| 202 FireTokenAvailableNotification(kServices[i], db_token); | 204 FireTokenAvailableNotification(kServices[i], db_token); |
| 203 // Failures are only for network errors. | 205 // Failures are only for network errors. |
| 204 } | 206 } |
| 205 } | 207 } |
| 206 } | 208 } |
| 207 } | 209 } |
| OLD | NEW |