| 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_API_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "chrome/browser/extensions/api/identity/identity_mint_queue.h" | 14 #include "chrome/browser/extensions/api/identity/identity_mint_queue.h" |
| 15 #include "chrome/browser/extensions/api/identity/identity_signin_flow.h" | 15 #include "chrome/browser/extensions/api/identity/identity_signin_flow.h" |
| 16 #include "chrome/browser/extensions/api/identity/web_auth_flow.h" | 16 #include "chrome/browser/extensions/api/identity/web_auth_flow.h" |
| 17 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" | 17 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" |
| 18 #include "chrome/browser/extensions/extension_function.h" | 18 #include "chrome/browser/extensions/extension_function.h" |
| 19 #include "chrome/browser/extensions/extension_install_prompt.h" | 19 #include "chrome/browser/extensions/extension_install_prompt.h" |
| 20 #include "chrome/browser/signin/signin_global_error.h" | 20 #include "chrome/browser/signin/signin_global_error.h" |
| 21 #include "google_apis/gaia/oauth2_mint_token_flow.h" | 21 #include "google_apis/gaia/oauth2_mint_token_flow.h" |
| 22 | 22 |
| 23 class GetAuthTokenFunctionTest; | 23 class GetAuthTokenFunctionTest; |
| 24 class MockGetAuthTokenFunction; | 24 class MockGetAuthTokenFunction; |
| 25 class GoogleServiceAuthError; | 25 class GoogleServiceAuthError; |
| 26 class Profile; | 26 class Profile; |
| 27 class SigninManagerBase; |
| 27 | 28 |
| 28 namespace extensions { | 29 namespace extensions { |
| 29 | 30 |
| 30 namespace identity_constants { | 31 namespace identity_constants { |
| 31 extern const char kInvalidClientId[]; | 32 extern const char kInvalidClientId[]; |
| 32 extern const char kInvalidScopes[]; | 33 extern const char kInvalidScopes[]; |
| 33 extern const char kAuthFailure[]; | 34 extern const char kAuthFailure[]; |
| 34 extern const char kNoGrant[]; | 35 extern const char kNoGrant[]; |
| 35 extern const char kUserRejected[]; | 36 extern const char kUserRejected[]; |
| 36 extern const char kUserNotSignedIn[]; | 37 extern const char kUserNotSignedIn[]; |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 private: | 188 private: |
| 188 friend class ProfileKeyedAPIFactory<IdentityAPI>; | 189 friend class ProfileKeyedAPIFactory<IdentityAPI>; |
| 189 | 190 |
| 190 // ProfileKeyedAPI implementation. | 191 // ProfileKeyedAPI implementation. |
| 191 static const char* service_name() { | 192 static const char* service_name() { |
| 192 return "IdentityAPI"; | 193 return "IdentityAPI"; |
| 193 } | 194 } |
| 194 static const bool kServiceIsNULLWhileTesting = true; | 195 static const bool kServiceIsNULLWhileTesting = true; |
| 195 | 196 |
| 196 Profile* profile_; | 197 Profile* profile_; |
| 197 SigninManager* signin_manager_; | 198 SigninManagerBase* signin_manager_; |
| 198 GoogleServiceAuthError error_; | 199 GoogleServiceAuthError error_; |
| 199 // Used to listen to notifications from the TokenService. | 200 // Used to listen to notifications from the TokenService. |
| 200 content::NotificationRegistrar registrar_; | 201 content::NotificationRegistrar registrar_; |
| 201 IdentityMintRequestQueue mint_queue_; | 202 IdentityMintRequestQueue mint_queue_; |
| 202 }; | 203 }; |
| 203 | 204 |
| 204 template <> | 205 template <> |
| 205 void ProfileKeyedAPIFactory<IdentityAPI>::DeclareFactoryDependencies(); | 206 void ProfileKeyedAPIFactory<IdentityAPI>::DeclareFactoryDependencies(); |
| 206 | 207 |
| 207 } // namespace extensions | 208 } // namespace extensions |
| 208 | 209 |
| 209 #endif // CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_API_H_ | 210 #endif // CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_API_H_ |
| OLD | NEW |