OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/passwords/password_bubble_experiment.h" | 5 #include "chrome/browser/ui/passwords/password_bubble_experiment.h" |
6 | 6 |
7 #include "base/metrics/field_trial.h" | 7 #include "base/metrics/field_trial.h" |
8 #include "chrome/browser/password_manager/password_manager_util.h" | |
8 #include "chrome/browser/signin/signin_manager_factory.h" | 9 #include "chrome/browser/signin/signin_manager_factory.h" |
9 #include "components/signin/core/browser/signin_manager.h" | 10 #include "chrome/browser/sync/profile_sync_service.h" |
engedy
2015/05/13 14:41:20
nit: I think this include is not needed. The facto
vabr (Chromium)
2015/05/13 14:55:06
Done. But not in the client -- the factory only fo
engedy
2015/05/13 14:57:33
Yeah, I only meant removing the include here.
| |
11 #include "chrome/browser/sync/profile_sync_service_factory.h" | |
10 | 12 |
11 namespace password_bubble_experiment { | 13 namespace password_bubble_experiment { |
12 namespace { | 14 namespace { |
13 | 15 |
14 const char kBrandingExperimentName[] = "PasswordBubbleBranding"; | 16 const char kBrandingExperimentName[] = "PasswordBubbleBranding"; |
15 const char kSmartLockBrandingGroupName[] = "SmartLockBranding"; | 17 const char kSmartLockBrandingGroupName[] = "SmartLockBranding"; |
16 | 18 |
17 } // namespace | 19 } // namespace |
18 | 20 |
19 void RecordBubbleClosed( | 21 void RecordBubbleClosed( |
20 PrefService* prefs, | 22 PrefService* prefs, |
21 password_manager::metrics_util::UIDismissalReason reason) { | 23 password_manager::metrics_util::UIDismissalReason reason) { |
22 // TODO(vasilii): store the statistics. | 24 // TODO(vasilii): store the statistics. |
23 } | 25 } |
24 | 26 |
25 bool IsEnabledSmartLockBranding(Profile* profile) { | 27 bool IsEnabledSmartLockBranding(Profile* profile) { |
26 SigninManagerBase* signin = SigninManagerFactory::GetForProfile(profile); | 28 const ProfileSyncService* sync_service = |
27 return (signin && signin->IsAuthenticated() && | 29 ProfileSyncServiceFactory::GetForProfile(profile); |
30 return (password_manager_util::GetPasswordSyncState(sync_service) && | |
engedy
2015/05/13 14:41:20
nit: Are these enclossing parens needed for clang-
vabr (Chromium)
2015/05/13 14:55:06
Done.
| |
28 base::FieldTrialList::FindFullName(kBrandingExperimentName) == | 31 base::FieldTrialList::FindFullName(kBrandingExperimentName) == |
29 kSmartLockBrandingGroupName); | 32 kSmartLockBrandingGroupName); |
30 } | 33 } |
31 | 34 |
32 | 35 |
33 } // namespace password_bubble_experiment | 36 } // namespace password_bubble_experiment |
OLD | NEW |