| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/common/chrome_notification_types.h" | 10 #include "chrome/common/chrome_notification_types.h" |
| 11 #include "chrome/common/chrome_switches.h" | 11 #include "chrome/common/chrome_switches.h" |
| 12 #include "chrome/common/net/gaia/gaia_auth_fetcher.h" | 12 #include "chrome/common/net/gaia/gaia_auth_fetcher.h" |
| 13 #include "chrome/common/net/gaia/gaia_constants.h" | 13 #include "chrome/common/net/gaia/gaia_constants.h" |
| 14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 15 #include "content/public/browser/notification_service.h" | 15 #include "content/public/browser/notification_service.h" |
| 16 #include "content/public/browser/notification_source.h" | 16 #include "content/public/browser/notification_source.h" |
| 17 #include "net/url_request/url_request_context_getter.h" | 17 #include "net/url_request/url_request_context_getter.h" |
| 18 | 18 |
| 19 using content::BrowserThread; |
| 20 |
| 19 // Unfortunately kNumServices must be defined in the .h. | 21 // Unfortunately kNumServices must be defined in the .h. |
| 20 // TODO(chron): Sync doesn't use the TalkToken anymore so we can stop | 22 // TODO(chron): Sync doesn't use the TalkToken anymore so we can stop |
| 21 // requesting it. | 23 // requesting it. |
| 22 const char* TokenService::kServices[] = { | 24 const char* TokenService::kServices[] = { |
| 23 GaiaConstants::kPicasaService, | 25 GaiaConstants::kPicasaService, |
| 24 GaiaConstants::kGaiaService, | 26 GaiaConstants::kGaiaService, |
| 25 GaiaConstants::kSyncService, | 27 GaiaConstants::kSyncService, |
| 26 GaiaConstants::kTalkService, | 28 GaiaConstants::kTalkService, |
| 27 GaiaConstants::kDeviceManagementService, | 29 GaiaConstants::kDeviceManagementService, |
| 28 }; | 30 }; |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 } | 410 } |
| 409 | 411 |
| 410 void TokenService::Observe(int type, | 412 void TokenService::Observe(int type, |
| 411 const content::NotificationSource& source, | 413 const content::NotificationSource& source, |
| 412 const content::NotificationDetails& details) { | 414 const content::NotificationDetails& details) { |
| 413 DCHECK_EQ(type, chrome::NOTIFICATION_TOKEN_UPDATED); | 415 DCHECK_EQ(type, chrome::NOTIFICATION_TOKEN_UPDATED); |
| 414 TokenAvailableDetails* tok_details = | 416 TokenAvailableDetails* tok_details = |
| 415 content::Details<TokenAvailableDetails>(details).ptr(); | 417 content::Details<TokenAvailableDetails>(details).ptr(); |
| 416 OnIssueAuthTokenSuccess(tok_details->service(), tok_details->token()); | 418 OnIssueAuthTokenSuccess(tok_details->service(), tok_details->token()); |
| 417 } | 419 } |
| OLD | NEW |