Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_SIGNIN_DICE_RESPONSE_HANDLER_H_ | |
| 6 #define CHROME_BROWSER_SIGNIN_DICE_RESPONSE_HANDLER_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 #include <string> | |
| 10 | |
| 11 #include "components/keyed_service/core/keyed_service.h" | |
| 12 #include "google_apis/gaia/gaia_auth_consumer.h" | |
| 13 | |
| 14 namespace signin { | |
| 15 struct DiceResponseParams; | |
| 16 } | |
| 17 | |
| 18 class AccountTrackerService; | |
| 19 class GaiaAuthFetcher; | |
| 20 class SigninClient; | |
| 21 class ProfileOAuth2TokenService; | |
| 22 class Profile; | |
| 23 | |
| 24 // Processes the Dice responses from Gaia. | |
| 25 class DiceResponseHandler : public GaiaAuthConsumer, public KeyedService { | |
| 26 public: | |
| 27 // Returns the DiceResponseHandler associated with this profile. | |
| 28 static DiceResponseHandler* GetForProfile(Profile* profile); | |
| 29 | |
| 30 DiceResponseHandler(SigninClient* signin_client, | |
| 31 ProfileOAuth2TokenService* profile_oauth2_token_service, | |
| 32 AccountTrackerService* account_tracker_service); | |
| 33 | |
| 34 // Must be called when receiving a Dice response header. | |
| 35 void ProcessDiceHeader(const signin::DiceResponseParams& dice_params); | |
| 36 | |
| 37 private: | |
| 38 ~DiceResponseHandler() override; | |
| 39 | |
| 40 // Process the Dice signin action. | |
| 41 void ProcessDiceSigninHeader(const std::string& gaia_id, | |
| 42 const std::string& email, | |
| 43 const std::string& authorization_code); | |
| 44 | |
| 45 // GaiaAuthConsumer implementation: | |
| 46 void OnClientOAuthSuccess(const ClientOAuthResult& result) override; | |
| 47 void OnClientOAuthFailure(const GoogleServiceAuthError& error) override; | |
| 48 | |
| 49 std::unique_ptr<GaiaAuthFetcher> gaia_auth_fetcher_; | |
| 50 std::string gaia_id_; | |
| 51 std::string email_; | |
| 52 SigninClient* signin_client_; | |
| 53 ProfileOAuth2TokenService* profile_oauth2_token_service_; | |
|
msarda
2017/06/22 09:11:31
There is only one token_service. Let's rename:
s/p
droger
2017/06/22 12:39:07
No, UpdateCredentials is specific to ProfileOAuth2
| |
| 54 AccountTrackerService* account_tracker_service_; | |
| 55 }; | |
| 56 | |
| 57 #endif // CHROME_BROWSER_SIGNIN_DICE_RESPONSE_HANDLER_H_ | |
| OLD | NEW |