| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/signin/token_service.h" | 5 #include "chrome/browser/signin/token_service.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/webdata/web_data_service_factory.h" | 12 #include "chrome/browser/webdata/web_data_service_factory.h" |
| 13 #include "chrome/common/chrome_notification_types.h" | 13 #include "chrome/common/chrome_notification_types.h" |
| 14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
| 15 #include "chrome/common/net/gaia/gaia_auth_fetcher.h" | |
| 16 #include "chrome/common/net/gaia/gaia_constants.h" | |
| 17 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
| 18 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
| 19 #include "content/public/browser/notification_service.h" | 17 #include "content/public/browser/notification_service.h" |
| 20 #include "content/public/browser/notification_source.h" | 18 #include "content/public/browser/notification_source.h" |
| 19 #include "google_apis/gaia/gaia_auth_fetcher.h" |
| 20 #include "google_apis/gaia/gaia_constants.h" |
| 21 #include "net/url_request/url_request_context_getter.h" | 21 #include "net/url_request/url_request_context_getter.h" |
| 22 | 22 |
| 23 using content::BrowserThread; | 23 using content::BrowserThread; |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 // List of services that are capable of ClientLogin-based authentication. | 27 // List of services that are capable of ClientLogin-based authentication. |
| 28 const char* kServices[] = { | 28 const char* kServices[] = { |
| 29 GaiaConstants::kGaiaService, | 29 GaiaConstants::kGaiaService, |
| 30 GaiaConstants::kSyncService, | 30 GaiaConstants::kSyncService, |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 } | 406 } |
| 407 | 407 |
| 408 void TokenService::Observe(int type, | 408 void TokenService::Observe(int type, |
| 409 const content::NotificationSource& source, | 409 const content::NotificationSource& source, |
| 410 const content::NotificationDetails& details) { | 410 const content::NotificationDetails& details) { |
| 411 DCHECK_EQ(type, chrome::NOTIFICATION_TOKEN_UPDATED); | 411 DCHECK_EQ(type, chrome::NOTIFICATION_TOKEN_UPDATED); |
| 412 TokenAvailableDetails* tok_details = | 412 TokenAvailableDetails* tok_details = |
| 413 content::Details<TokenAvailableDetails>(details).ptr(); | 413 content::Details<TokenAvailableDetails>(details).ptr(); |
| 414 OnIssueAuthTokenSuccess(tok_details->service(), tok_details->token()); | 414 OnIssueAuthTokenSuccess(tok_details->service(), tok_details->token()); |
| 415 } | 415 } |
| OLD | NEW |