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 <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 11 matching lines...) Expand all Loading... | |
22 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" | 22 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" |
23 #include "chrome/browser/extensions/extension_function.h" | 23 #include "chrome/browser/extensions/extension_function.h" |
24 #include "chrome/browser/signin/signin_global_error.h" | 24 #include "chrome/browser/signin/signin_global_error.h" |
25 #include "google_apis/gaia/oauth2_mint_token_flow.h" | 25 #include "google_apis/gaia/oauth2_mint_token_flow.h" |
26 #include "google_apis/gaia/oauth2_token_service.h" | 26 #include "google_apis/gaia/oauth2_token_service.h" |
27 | 27 |
28 class GoogleServiceAuthError; | 28 class GoogleServiceAuthError; |
29 class MockGetAuthTokenFunction; | 29 class MockGetAuthTokenFunction; |
30 class Profile; | 30 class Profile; |
31 | 31 |
32 #if defined(OS_CHROMEOS) | |
pneubeck (no reviews)
2013/10/22 09:05:03
nit: if-defined not strictly necessary
satorux1
2013/10/22 09:56:43
Probably it's a good idea to have #ifdef to make i
| |
33 namespace chromeos { | |
34 class DeviceOAuth2TokenService; | |
35 } | |
36 #endif | |
37 | |
32 namespace extensions { | 38 namespace extensions { |
33 | 39 |
34 class GetAuthTokenFunctionTest; | 40 class GetAuthTokenFunctionTest; |
35 class MockGetAuthTokenFunction; | 41 class MockGetAuthTokenFunction; |
36 | 42 |
37 namespace identity_constants { | 43 namespace identity_constants { |
38 extern const char kInvalidClientId[]; | 44 extern const char kInvalidClientId[]; |
39 extern const char kInvalidScopes[]; | 45 extern const char kInvalidScopes[]; |
40 extern const char kAuthFailure[]; | 46 extern const char kAuthFailure[]; |
41 extern const char kNoGrant[]; | 47 extern const char kNoGrant[]; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, | 133 virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, |
128 const GoogleServiceAuthError& error) OVERRIDE; | 134 const GoogleServiceAuthError& error) OVERRIDE; |
129 | 135 |
130 // Starts a login access token request. | 136 // Starts a login access token request. |
131 virtual void StartLoginAccessTokenRequest(); | 137 virtual void StartLoginAccessTokenRequest(); |
132 | 138 |
133 #if defined(OS_CHROMEOS) | 139 #if defined(OS_CHROMEOS) |
134 // Starts a login access token request for device robot account. This method | 140 // Starts a login access token request for device robot account. This method |
135 // will be called only in enterprise kiosk mode in ChromeOS. | 141 // will be called only in enterprise kiosk mode in ChromeOS. |
136 virtual void StartDeviceLoginAccessTokenRequest(); | 142 virtual void StartDeviceLoginAccessTokenRequest(); |
143 | |
144 // Continuation of StartDeviceLoginAccessTokenRequest(). | |
145 virtual void DidGetTokenService(chromeos::DeviceOAuth2TokenService* service); | |
137 #endif | 146 #endif |
138 | 147 |
139 // Starts a mint token request to GAIA. | 148 // Starts a mint token request to GAIA. |
140 void StartGaiaRequest(const std::string& login_access_token); | 149 void StartGaiaRequest(const std::string& login_access_token); |
141 | 150 |
142 // Methods for invoking UI. Overridable for testing. | 151 // Methods for invoking UI. Overridable for testing. |
143 virtual void ShowLoginPopup(); | 152 virtual void ShowLoginPopup(); |
144 virtual void ShowOAuthApprovalDialog(const IssueAdviceInfo& issue_advice); | 153 virtual void ShowOAuthApprovalDialog(const IssueAdviceInfo& issue_advice); |
145 // Caller owns the returned instance. | 154 // Caller owns the returned instance. |
146 virtual OAuth2MintTokenFlow* CreateMintTokenFlow( | 155 virtual OAuth2MintTokenFlow* CreateMintTokenFlow( |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
299 AccountTracker account_tracker_; | 308 AccountTracker account_tracker_; |
300 IdentityEventRouter identity_event_router_; | 309 IdentityEventRouter identity_event_router_; |
301 }; | 310 }; |
302 | 311 |
303 template <> | 312 template <> |
304 void ProfileKeyedAPIFactory<IdentityAPI>::DeclareFactoryDependencies(); | 313 void ProfileKeyedAPIFactory<IdentityAPI>::DeclareFactoryDependencies(); |
305 | 314 |
306 } // namespace extensions | 315 } // namespace extensions |
307 | 316 |
308 #endif // CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_API_H_ | 317 #endif // CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_API_H_ |
OLD | NEW |