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

Unified Diff: components/arc/auth/arc_auth_fetcher.cc

Issue 1847463002: arc: Use v2/auth LSO page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 9 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
« no previous file with comments | « components/arc/auth/arc_auth_fetcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/auth/arc_auth_fetcher.cc
diff --git a/components/arc/auth/arc_auth_fetcher.cc b/components/arc/auth/arc_auth_fetcher.cc
deleted file mode 100644
index e67333fe430000af346a84b0ff91162bc82e24fb..0000000000000000000000000000000000000000
--- a/components/arc/auth/arc_auth_fetcher.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2016 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.
-
-#include "components/arc/auth/arc_auth_fetcher.h"
-
-#include "base/strings/stringprintf.h"
-#include "google_apis/gaia/gaia_constants.h"
-#include "google_apis/gaia/gaia_urls.h"
-
-namespace arc {
-
-namespace {
-
-const char kGMSCoreClientId[] =
- "1070009224336-sdh77n7uot3oc99ais00jmuft6sk2fg9.apps.googleusercontent.com";
-
-} // namespace
-
-ArcAuthFetcher::ArcAuthFetcher(net::URLRequestContextGetter* getter,
- Delegate* delegate)
- : delegate_(delegate), auth_fetcher_(this, std::string(), getter) {
- FetchAuthCode();
-}
-
-// static
-GURL ArcAuthFetcher::CreateURL() {
- std::string query_string =
- base::StringPrintf("?scope=%s&client_id=%s",
- GaiaConstants::kOAuth1LoginScope, kGMSCoreClientId);
- return GaiaUrls::GetInstance()->client_login_to_oauth2_url().Resolve(
- query_string);
-}
-
-void ArcAuthFetcher::FetchAuthCode() {
- DCHECK(!auth_fetcher_.HasPendingFetch());
- auth_fetcher_.StartCookieForOAuthLoginTokenExchange(
- false, /* fetch_token_from_auth_code */
- std::string(), /* session_index */
- kGMSCoreClientId, std::string() /* device_id */);
-}
-
-void ArcAuthFetcher::OnClientOAuthCode(const std::string& auth_code) {
- DCHECK(!auth_fetcher_.HasPendingFetch());
- delegate_->OnAuthCodeFetched(auth_code);
-}
-
-void ArcAuthFetcher::OnClientOAuthFailure(const GoogleServiceAuthError& error) {
- // UNEXPECTED_SERVICE_RESPONSE indicates no cookies in response, but request
- // is completed successfully.
- if (error.state() == GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE) {
- delegate_->OnAuthCodeNeedUI();
- } else {
- VLOG(2) << "ARC Auth request failed: " << error.ToString() << ".";
- delegate_->OnAuthCodeFailed();
- }
-}
-
-} // namespace arc
« no previous file with comments | « components/arc/auth/arc_auth_fetcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698