| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "chrome/browser/extensions/api/identity/identity_signin_flow.h" | 13 #include "chrome/browser/extensions/api/identity/identity_signin_flow.h" |
| 14 #include "chrome/browser/extensions/api/identity/web_auth_flow.h" | 14 #include "chrome/browser/extensions/api/identity/web_auth_flow.h" |
| 15 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" | 15 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" |
| 16 #include "chrome/browser/extensions/extension_function.h" | 16 #include "chrome/browser/extensions/extension_function.h" |
| 17 #include "chrome/browser/extensions/extension_install_prompt.h" | 17 #include "chrome/browser/extensions/extension_install_prompt.h" |
| 18 #include "chrome/browser/signin/signin_global_error.h" | 18 #include "chrome/browser/signin/signin_global_error.h" |
| 19 #include "google_apis/gaia/oauth2_mint_token_flow.h" | 19 #include "google_apis/gaia/oauth2_mint_token_flow.h" |
| 20 | 20 |
| 21 class GetAuthTokenFunctionTest; | 21 class GetAuthTokenFunctionTest; |
| 22 class MockGetAuthTokenFunction; | 22 class MockGetAuthTokenFunction; |
| 23 class GoogleServiceAuthError; | 23 class GoogleServiceAuthError; |
| 24 class Profile; | 24 class Profile; |
| 25 class SigninManagerBase; |
| 25 | 26 |
| 26 namespace extensions { | 27 namespace extensions { |
| 27 | 28 |
| 28 namespace identity_constants { | 29 namespace identity_constants { |
| 29 extern const char kInvalidClientId[]; | 30 extern const char kInvalidClientId[]; |
| 30 extern const char kInvalidScopes[]; | 31 extern const char kInvalidScopes[]; |
| 31 extern const char kAuthFailure[]; | 32 extern const char kAuthFailure[]; |
| 32 extern const char kNoGrant[]; | 33 extern const char kNoGrant[]; |
| 33 extern const char kUserRejected[]; | 34 extern const char kUserRejected[]; |
| 34 extern const char kUserNotSignedIn[]; | 35 extern const char kUserNotSignedIn[]; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 private: | 150 private: |
| 150 friend class ProfileKeyedAPIFactory<IdentityAPI>; | 151 friend class ProfileKeyedAPIFactory<IdentityAPI>; |
| 151 | 152 |
| 152 // ProfileKeyedAPI implementation. | 153 // ProfileKeyedAPI implementation. |
| 153 static const char* service_name() { | 154 static const char* service_name() { |
| 154 return "IdentityAPI"; | 155 return "IdentityAPI"; |
| 155 } | 156 } |
| 156 static const bool kServiceIsNULLWhileTesting = true; | 157 static const bool kServiceIsNULLWhileTesting = true; |
| 157 | 158 |
| 158 Profile* profile_; | 159 Profile* profile_; |
| 159 SigninManager* signin_manager_; | 160 SigninManagerBase* signin_manager_; |
| 160 GoogleServiceAuthError error_; | 161 GoogleServiceAuthError error_; |
| 161 // Used to listen to notifications from the TokenService. | 162 // Used to listen to notifications from the TokenService. |
| 162 content::NotificationRegistrar registrar_; | 163 content::NotificationRegistrar registrar_; |
| 163 }; | 164 }; |
| 164 | 165 |
| 165 template <> | 166 template <> |
| 166 void ProfileKeyedAPIFactory<IdentityAPI>::DeclareFactoryDependencies(); | 167 void ProfileKeyedAPIFactory<IdentityAPI>::DeclareFactoryDependencies(); |
| 167 | 168 |
| 168 } // namespace extensions | 169 } // namespace extensions |
| 169 | 170 |
| 170 #endif // CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_API_H_ | 171 #endif // CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_API_H_ |
| OLD | NEW |