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

Side by Side Diff: chrome/browser/signin/signin_promo_util.cc

Issue 2138643004: [Autofill] Add support for signin promo on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@aaa
Patch Set: nits Created 4 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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 "chrome/browser/signin/signin_promo_util.h"
6
7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/signin/signin_manager_factory.h"
9 #include "components/signin/core/browser/signin_manager.h"
10 #include "net/base/network_change_notifier.h"
11
12 namespace signin {
13
14 bool ShouldShowPromo(Profile* profile) {
15 #if defined(OS_CHROMEOS)
16 // There's no need to show the sign in promo on cros since cros users are
17 // already logged in.
18 return false;
19 #else
20
21 // Don't bother if we don't have any kind of network connection.
22 if (net::NetworkChangeNotifier::IsOffline())
23 return false;
24
25 // Don't show for supervised profiles.
26 if (profile->IsSupervised())
27 return false;
28
29 // Display the signin promo if the user is not signed in.
30 SigninManager* signin =
31 SigninManagerFactory::GetForProfile(profile->GetOriginalProfile());
32 return !signin->AuthInProgress() && signin->IsSigninAllowed() &&
33 !signin->IsAuthenticated();
34 #endif
35 }
36
37 } // namespace signin
OLDNEW
« no previous file with comments | « chrome/browser/signin/signin_promo_util.h ('k') | chrome/browser/ui/android/autofill/autofill_popup_view_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698