| Index: chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc
|
| diff --git a/chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc b/chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc
|
| index d2b98eb47a768215c0b9a6fd946a2149b02a59db..cdfa8ff5cd42d9a91235031046ae9b071630694c 100644
|
| --- a/chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc
|
| +++ b/chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc
|
| @@ -15,12 +15,10 @@ namespace extensions {
|
|
|
| GaiaWebAuthFlow::GaiaWebAuthFlow(Delegate* delegate,
|
| Profile* profile,
|
| - chrome::HostDesktopType host_desktop_type,
|
| const std::string& extension_id,
|
| const OAuth2Info& oauth2_info)
|
| : delegate_(delegate),
|
| - profile_(profile),
|
| - host_desktop_type_(host_desktop_type) {
|
| + profile_(profile) {
|
| const char kOAuth2RedirectPathFormat[] = "/%s#";
|
| const char kOAuth2AuthorizeFormat[] =
|
| "%s?response_type=token&approval_prompt=force&authuser=0&"
|
| @@ -79,9 +77,23 @@ void GaiaWebAuthFlow::OnUbertokenFailure(const GoogleServiceAuthError& error) {
|
| }
|
|
|
| void GaiaWebAuthFlow::OnAuthFlowFailure(WebAuthFlow::Failure failure) {
|
| - DCHECK(failure == WebAuthFlow::WINDOW_CLOSED);
|
| + GaiaWebAuthFlow::Failure gaia_failure;
|
| +
|
| + switch (failure) {
|
| + case WebAuthFlow::WINDOW_CLOSED:
|
| + gaia_failure = GaiaWebAuthFlow::WINDOW_CLOSED;
|
| + break;
|
| + case WebAuthFlow::LOAD_FAILED:
|
| + gaia_failure = GaiaWebAuthFlow::LOAD_FAILED;
|
| + break;
|
| + default:
|
| + NOTREACHED() << "Unexpected error from web auth flow: " << failure;
|
| + gaia_failure = GaiaWebAuthFlow::LOAD_FAILED;
|
| + break;
|
| + }
|
| +
|
| delegate_->OnGaiaFlowFailure(
|
| - GaiaWebAuthFlow::WINDOW_CLOSED,
|
| + gaia_failure,
|
| GoogleServiceAuthError(GoogleServiceAuthError::NONE),
|
| std::string());
|
| }
|
| @@ -151,13 +163,10 @@ void GaiaWebAuthFlow::OnAuthFlowTitleChange(const std::string& title) {
|
| }
|
|
|
| scoped_ptr<WebAuthFlow> GaiaWebAuthFlow::CreateWebAuthFlow(GURL url) {
|
| - gfx::Rect initial_bounds;
|
| return scoped_ptr<WebAuthFlow>(new WebAuthFlow(this,
|
| profile_,
|
| url,
|
| - WebAuthFlow::INTERACTIVE,
|
| - initial_bounds,
|
| - host_desktop_type_));
|
| + WebAuthFlow::INTERACTIVE));
|
| }
|
|
|
| } // extensions
|
|
|