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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "chrome/browser/browser_thread.h" | 9 #include "chrome/browser/browser_thread.h" |
10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
11 #include "chrome/common/chrome_switches.h" | 11 #include "chrome/common/chrome_switches.h" |
12 #include "chrome/common/net/gaia/gaia_authenticator2.h" | 12 #include "chrome/common/net/gaia/gaia_authenticator2.h" |
13 #include "chrome/common/net/gaia/gaia_constants.h" | 13 #include "chrome/common/net/gaia/gaia_constants.h" |
14 #include "chrome/common/net/url_request_context_getter.h" | 14 #include "chrome/common/net/url_request_context_getter.h" |
15 #include "chrome/common/notification_service.h" | 15 #include "chrome/common/notification_service.h" |
16 | 16 |
17 // Unfortunately kNumServices must be defined in the .h. | 17 // Unfortunately kNumServices must be defined in the .h. |
18 // TODO(chron): Sync doesn't use the TalkToken anymore so we can stop | 18 // TODO(chron): Sync doesn't use the TalkToken anymore so we can stop |
19 // requesting it. | 19 // requesting it. |
20 const char* TokenService::kServices[] = {GaiaConstants::kSyncService, | 20 const char* TokenService::kServices[] = { |
21 GaiaConstants::kTalkService}; | 21 GaiaConstants::kSyncService, |
| 22 GaiaConstants::kTalkService, |
| 23 GaiaConstants::kDeviceManagementService |
| 24 }; |
| 25 |
22 TokenService::TokenService() | 26 TokenService::TokenService() |
23 : token_loading_query_(0) { | 27 : token_loading_query_(0) { |
24 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 28 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
25 } | 29 } |
26 | 30 |
27 TokenService::~TokenService() { | 31 TokenService::~TokenService() { |
28 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 32 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
29 ResetCredentialsInMemory(); | 33 ResetCredentialsInMemory(); |
30 } | 34 } |
31 | 35 |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 } | 251 } |
248 | 252 |
249 void TokenService::Observe(NotificationType type, | 253 void TokenService::Observe(NotificationType type, |
250 const NotificationSource& source, | 254 const NotificationSource& source, |
251 const NotificationDetails& details) { | 255 const NotificationDetails& details) { |
252 DCHECK(type == NotificationType::TOKEN_UPDATED); | 256 DCHECK(type == NotificationType::TOKEN_UPDATED); |
253 TokenAvailableDetails* tok_details = | 257 TokenAvailableDetails* tok_details = |
254 Details<TokenAvailableDetails>(details).ptr(); | 258 Details<TokenAvailableDetails>(details).ptr(); |
255 OnIssueAuthTokenSuccess(tok_details->service(), tok_details->token()); | 259 OnIssueAuthTokenSuccess(tok_details->service(), tok_details->token()); |
256 } | 260 } |
OLD | NEW |