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

Side by Side Diff: ios/chrome/browser/signin/signin_capability.cc

Issue 2585233003: Upstream Chrome on iOS source code [2/11]. (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ios/chrome/browser/signin/signin_capability.h"
6
7 #include "base/logging.h"
8 #include "components/signin/core/browser/signin_error_controller.h"
9 #include "components/signin/core/browser/signin_manager.h"
10 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
11 #include "ios/chrome/browser/signin/signin_error_controller_factory.h"
12 #include "ios/chrome/browser/signin/signin_manager_factory.h"
13
14 bool CanPresentAutoLogin(ios::ChromeBrowserState* browser_state) {
15 // User must be signed in and not have an error.
16 SigninManager* signin =
17 ios::SigninManagerFactory::GetForBrowserState(browser_state);
18 DCHECK(signin);
19 std::string username = signin->GetAuthenticatedAccountInfo().email;
20 if (!username.length())
21 return false;
22 SigninErrorController* error_controller =
23 ios::SigninErrorControllerFactory::GetForBrowserState(browser_state);
24 DCHECK(error_controller);
25 return !error_controller->HasError();
26 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/signin/signin_capability.h ('k') | ios/chrome/browser/snapshots/snapshot_overlay_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698