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

Unified Diff: chrome/browser/chromeos/arc/arc_auth_service.cc

Issue 2508713003: arc: Prepare ArcAuthEndpoint flag for finch experiment. (Closed)
Patch Set: rebase Created 4 years, 1 month 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/chromeos/arc/arc_auth_service.cc
diff --git a/chrome/browser/chromeos/arc/arc_auth_service.cc b/chrome/browser/chromeos/arc/arc_auth_service.cc
index 4c6d1e520f3e7ddf89f3ef5ea23c30e1fbde396b..f1acced140db4c822db776b68419cf74b462d293 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service.cc
@@ -39,6 +39,7 @@
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/session_manager_client.h"
#include "components/arc/arc_bridge_service.h"
+#include "components/arc/arc_features.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_service.h"
#include "components/sync_preferences/pref_service_syncable.h"
@@ -401,21 +402,13 @@ void ArcAuthService::RequestAccountInfoInternal(
return;
}
- // If endpoint is passed via command line flag, use automatic auth code
- // fetching.
- const base::CommandLine* command_line =
- base::CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(chromeos::switches::kArcUseAuthEndpoint)) {
- std::string auth_endpoint = command_line->GetSwitchValueASCII(
- chromeos::switches::kArcUseAuthEndpoint);
- if (!auth_endpoint.empty()) {
- DCHECK(!auth_code_fetcher_);
- auth_code_fetcher_ = base::MakeUnique<ArcAuthCodeFetcher>(
- profile_, context_.get(), auth_endpoint);
- auth_code_fetcher_->Fetch(base::Bind(&ArcAuthService::OnAuthCodeFetched,
- weak_ptr_factory_.GetWeakPtr()));
- return;
- }
+ if (base::FeatureList::IsEnabled(arc::kArcUseAuthEndpointFeature)) {
+ DCHECK(!auth_code_fetcher_);
+ auth_code_fetcher_ =
+ base::MakeUnique<ArcAuthCodeFetcher>(profile_, context_.get());
+ auth_code_fetcher_->Fetch(base::Bind(&ArcAuthService::OnAuthCodeFetched,
+ weak_ptr_factory_.GetWeakPtr()));
+ return;
}
// Otherwise, show LSO page to user, and let them click "Sign in" button.

Powered by Google App Engine
This is Rietveld 408576698