Chromium Code Reviews| Index: chrome/browser/signin/dice_response_handler.h |
| diff --git a/chrome/browser/signin/dice_response_handler.h b/chrome/browser/signin/dice_response_handler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b4e1c639346c552f31f382b982d21fb86ea9aa1d |
| --- /dev/null |
| +++ b/chrome/browser/signin/dice_response_handler.h |
| @@ -0,0 +1,57 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_SIGNIN_DICE_RESPONSE_HANDLER_H_ |
| +#define CHROME_BROWSER_SIGNIN_DICE_RESPONSE_HANDLER_H_ |
| + |
| +#include <memory> |
| +#include <string> |
| + |
| +#include "components/keyed_service/core/keyed_service.h" |
| +#include "google_apis/gaia/gaia_auth_consumer.h" |
| + |
| +namespace signin { |
| +struct DiceResponseParams; |
| +} |
| + |
| +class AccountTrackerService; |
| +class GaiaAuthFetcher; |
| +class SigninClient; |
| +class ProfileOAuth2TokenService; |
| +class Profile; |
| + |
| +// Processes the Dice responses from Gaia. |
| +class DiceResponseHandler : public GaiaAuthConsumer, public KeyedService { |
| + public: |
| + // Returns the DiceResponseHandler associated with this profile. |
| + static DiceResponseHandler* GetForProfile(Profile* profile); |
| + |
| + DiceResponseHandler(SigninClient* signin_client, |
| + ProfileOAuth2TokenService* profile_oauth2_token_service, |
| + AccountTrackerService* account_tracker_service); |
| + |
| + // Must be called when receiving a Dice response header. |
| + void ProcessDiceHeader(const signin::DiceResponseParams& dice_params); |
| + |
| + private: |
| + ~DiceResponseHandler() override; |
| + |
| + // Process the Dice signin action. |
| + void ProcessDiceSigninHeader(const std::string& gaia_id, |
| + const std::string& email, |
| + const std::string& authorization_code); |
| + |
| + // GaiaAuthConsumer implementation: |
| + void OnClientOAuthSuccess(const ClientOAuthResult& result) override; |
| + void OnClientOAuthFailure(const GoogleServiceAuthError& error) override; |
| + |
| + std::unique_ptr<GaiaAuthFetcher> gaia_auth_fetcher_; |
| + std::string gaia_id_; |
| + std::string email_; |
| + SigninClient* signin_client_; |
| + 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
|
| + AccountTrackerService* account_tracker_service_; |
| +}; |
| + |
| +#endif // CHROME_BROWSER_SIGNIN_DICE_RESPONSE_HANDLER_H_ |