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

Unified Diff: chrome/browser/ui/android/infobars/auto_login_prompter.cc

Issue 235863025: Remove desktop auto-login since we don't plan on shipping it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove redundant comment. Created 6 years, 8 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 | « chrome/browser/ui/android/infobars/auto_login_prompter.h ('k') | chrome/browser/ui/auto_login_prompter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/android/infobars/auto_login_prompter.cc
diff --git a/chrome/browser/ui/auto_login_prompter.cc b/chrome/browser/ui/android/infobars/auto_login_prompter.cc
similarity index 78%
rename from chrome/browser/ui/auto_login_prompter.cc
rename to chrome/browser/ui/android/infobars/auto_login_prompter.cc
index 9526e4e623bb60b6339d1ec151c26558456ef786..2cc1f249aeff428b04477c628f336db9aa8d6494 100644
--- a/chrome/browser/ui/auto_login_prompter.cc
+++ b/chrome/browser/ui/android/infobars/auto_login_prompter.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/ui/auto_login_prompter.h"
+#include "chrome/browser/ui/android/infobars/auto_login_prompter.h"
#include "base/bind.h"
#include "base/command_line.h"
@@ -26,30 +26,6 @@
using content::BrowserThread;
using content::WebContents;
-namespace {
-
-#if !defined(OS_ANDROID)
-bool FetchUsernameThroughSigninManager(Profile* profile, std::string* output) {
- // In an incognito window these services are not available.
- SigninManagerBase* signin_manager =
- SigninManagerFactory::GetInstance()->GetForProfile(profile);
- if (!signin_manager)
- return false;
-
- ProfileOAuth2TokenService* token_service =
- ProfileOAuth2TokenServiceFactory::GetForProfile(profile);
- if (!token_service || !token_service->RefreshTokenIsAvailable(
- signin_manager->GetAuthenticatedAccountId())) {
- return false;
- }
-
- *output = signin_manager->GetAuthenticatedUsername();
- return true;
-}
-#endif // !defined(OS_ANDROID)
-
-} // namespace
-
AutoLoginPrompter::AutoLoginPrompter(WebContents* web_contents,
const Params& params,
const GURL& url)
@@ -71,9 +47,6 @@ AutoLoginPrompter::~AutoLoginPrompter() {
void AutoLoginPrompter::ShowInfoBarIfPossible(net::URLRequest* request,
int child_id,
int route_id) {
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAutologin))
- return;
-
// See if the response contains the X-Auto-Login header. If so, this was
// a request for a login page, and the server is allowing the browser to
// suggest auto-login, if available.
@@ -106,13 +79,6 @@ void AutoLoginPrompter::ShowInfoBarUIThread(Params params,
if (!profile->GetPrefs()->GetBoolean(prefs::kAutologinEnabled))
return;
-#if !defined(OS_ANDROID)
- // On Android, the username is fetched on the Java side from the
- // AccountManager provided by the platform.
- if (!FetchUsernameThroughSigninManager(profile, &params.username))
- return;
-#endif
-
// Make sure that |account|, if specified, matches the logged in user.
// However, |account| is usually empty.
if (!params.username.empty() && !params.header.account.empty() &&
« no previous file with comments | « chrome/browser/ui/android/infobars/auto_login_prompter.h ('k') | chrome/browser/ui/auto_login_prompter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698