| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/browser/signin/dice_response_handler.h" | 5 #include "chrome/browser/signin/dice_response_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 149 |
| 150 DiceResponseHandler::~DiceResponseHandler() {} | 150 DiceResponseHandler::~DiceResponseHandler() {} |
| 151 | 151 |
| 152 void DiceResponseHandler::ProcessDiceHeader( | 152 void DiceResponseHandler::ProcessDiceHeader( |
| 153 const signin::DiceResponseParams& dice_params) { | 153 const signin::DiceResponseParams& dice_params) { |
| 154 DCHECK_EQ(switches::AccountConsistencyMethod::kDice, | 154 DCHECK_EQ(switches::AccountConsistencyMethod::kDice, |
| 155 switches::GetAccountConsistencyMethod()); | 155 switches::GetAccountConsistencyMethod()); |
| 156 | 156 |
| 157 switch (dice_params.user_intention) { | 157 switch (dice_params.user_intention) { |
| 158 case signin::DiceAction::SIGNIN: | 158 case signin::DiceAction::SIGNIN: |
| 159 ProcessDiceSigninHeader(dice_params.obfuscated_gaia_id, dice_params.email, | 159 ProcessDiceSigninHeader(dice_params.gaia_id, dice_params.email, |
| 160 dice_params.authorization_code); | 160 dice_params.authorization_code); |
| 161 return; | 161 return; |
| 162 case signin::DiceAction::SIGNOUT: | 162 case signin::DiceAction::SIGNOUT: |
| 163 case signin::DiceAction::SINGLE_SESSION_SIGNOUT: | 163 case signin::DiceAction::SINGLE_SESSION_SIGNOUT: |
| 164 LOG(ERROR) << "Signout through Dice is not implemented."; | 164 LOG(ERROR) << "Signout through Dice is not implemented."; |
| 165 return; | 165 return; |
| 166 case signin::DiceAction::NONE: | 166 case signin::DiceAction::NONE: |
| 167 NOTREACHED() << "Invalid Dice response parameters."; | 167 NOTREACHED() << "Invalid Dice response parameters."; |
| 168 return; | 168 return; |
| 169 } | 169 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 DeleteTokenFetcher(token_fetcher); | 217 DeleteTokenFetcher(token_fetcher); |
| 218 } | 218 } |
| 219 | 219 |
| 220 void DiceResponseHandler::OnTokenExchangeFailure( | 220 void DiceResponseHandler::OnTokenExchangeFailure( |
| 221 DiceTokenFetcher* token_fetcher, | 221 DiceTokenFetcher* token_fetcher, |
| 222 const GoogleServiceAuthError& error) { | 222 const GoogleServiceAuthError& error) { |
| 223 // TODO(droger): Handle authentication errors. | 223 // TODO(droger): Handle authentication errors. |
| 224 VLOG(1) << "Dice OAuth failed with error: " << error.ToString(); | 224 VLOG(1) << "Dice OAuth failed with error: " << error.ToString(); |
| 225 DeleteTokenFetcher(token_fetcher); | 225 DeleteTokenFetcher(token_fetcher); |
| 226 } | 226 } |
| OLD | NEW |