Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Unified Diff: chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc

Issue 15897006: Identity API: switch WebAuthFlow dialog to component app (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase to ToT Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698