| 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 // The TokenService will supply authentication tokens for any service that | 5 // The TokenService will supply authentication tokens for any service that |
| 6 // needs it, such as sync. Whenever the user logs in, a controller watching | 6 // needs it, such as sync. Whenever the user logs in, a controller watching |
| 7 // the token service is expected to call ClientLogin to derive a new SID and | 7 // the token service is expected to call ClientLogin to derive a new SID and |
| 8 // LSID. Whenever such credentials are available, the TokenService should be | 8 // LSID. Whenever such credentials are available, the TokenService should be |
| 9 // updated with new credentials. The controller should then start fetching | 9 // updated with new credentials. The controller should then start fetching |
| 10 // tokens, which will be written to the database after retrieval, as well as | 10 // tokens, which will be written to the database after retrieval, as well as |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // } | 32 // } |
| 33 | 33 |
| 34 #ifndef CHROME_BROWSER_NET_GAIA_TOKEN_SERVICE_H_ | 34 #ifndef CHROME_BROWSER_NET_GAIA_TOKEN_SERVICE_H_ |
| 35 #define CHROME_BROWSER_NET_GAIA_TOKEN_SERVICE_H_ | 35 #define CHROME_BROWSER_NET_GAIA_TOKEN_SERVICE_H_ |
| 36 #pragma once | 36 #pragma once |
| 37 | 37 |
| 38 #include <map> | 38 #include <map> |
| 39 #include <string> | 39 #include <string> |
| 40 #include <vector> | 40 #include <vector> |
| 41 #include "base/scoped_ptr.h" | 41 #include "base/scoped_ptr.h" |
| 42 #include "chrome/browser/webdata/web_data_service.h" |
| 42 #include "chrome/common/net/gaia/gaia_auth_consumer.h" | 43 #include "chrome/common/net/gaia/gaia_auth_consumer.h" |
| 43 #include "chrome/common/net/gaia/gaia_authenticator2.h" | 44 #include "chrome/common/net/gaia/gaia_authenticator2.h" |
| 44 #include "chrome/test/testing_profile.h" | |
| 45 #include "base/gtest_prod_util.h" | 45 #include "base/gtest_prod_util.h" |
| 46 | 46 |
| 47 class URLRequestContextGetter; | 47 class URLRequestContextGetter; |
| 48 class Profile; |
| 48 | 49 |
| 49 // The TokenService is a Profile member, so all calls are expected | 50 // The TokenService is a Profile member, so all calls are expected |
| 50 // from the UI thread. | 51 // from the UI thread. |
| 51 class TokenService : public GaiaAuthConsumer, | 52 class TokenService : public GaiaAuthConsumer, |
| 52 public WebDataServiceConsumer { | 53 public WebDataServiceConsumer { |
| 53 public: | 54 public: |
| 54 TokenService(); | 55 TokenService(); |
| 55 virtual ~TokenService(); | 56 virtual ~TokenService(); |
| 56 | 57 |
| 57 // Notification classes | 58 // Notification classes |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 // Map from service to token. | 168 // Map from service to token. |
| 168 std::map<std::string, std::string> token_map_; | 169 std::map<std::string, std::string> token_map_; |
| 169 | 170 |
| 170 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryBasic); | 171 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryBasic); |
| 171 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryAdvanced); | 172 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryAdvanced); |
| 172 | 173 |
| 173 DISALLOW_COPY_AND_ASSIGN(TokenService); | 174 DISALLOW_COPY_AND_ASSIGN(TokenService); |
| 174 }; | 175 }; |
| 175 | 176 |
| 176 #endif // CHROME_BROWSER_NET_GAIA_TOKEN_SERVICE_H_ | 177 #endif // CHROME_BROWSER_NET_GAIA_TOKEN_SERVICE_H_ |
| OLD | NEW |