OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/password_manager/password_store_factory.h" | 5 #include "chrome/browser/password_manager/password_store_factory.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/environment.h" | 8 #include "base/environment.h" |
9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 bool ShouldAffiliationBasedMatchingBeActive(Profile* profile) { | 92 bool ShouldAffiliationBasedMatchingBeActive(Profile* profile) { |
93 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 93 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
94 if (!password_manager::IsAffiliationBasedMatchingEnabled(*command_line)) | 94 if (!password_manager::IsAffiliationBasedMatchingEnabled(*command_line)) |
95 return false; | 95 return false; |
96 | 96 |
97 DCHECK(profile); | 97 DCHECK(profile); |
98 ProfileSyncService* profile_sync_service = | 98 ProfileSyncService* profile_sync_service = |
99 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); | 99 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); |
100 return profile_sync_service && | 100 return profile_sync_service && |
101 profile_sync_service->IsSyncEnabledAndLoggedIn() && | 101 profile_sync_service->CanSyncStart() && |
102 profile_sync_service->IsSyncActive() && | 102 profile_sync_service->IsSyncActive() && |
103 profile_sync_service->GetPreferredDataTypes().Has(syncer::PASSWORDS) && | 103 profile_sync_service->GetPreferredDataTypes().Has(syncer::PASSWORDS) && |
104 !profile_sync_service->IsUsingSecondaryPassphrase(); | 104 !profile_sync_service->IsUsingSecondaryPassphrase(); |
105 } | 105 } |
106 | 106 |
107 bool ShouldPropagatingPasswordChangesToWebCredentialsBeEnabled() { | 107 bool ShouldPropagatingPasswordChangesToWebCredentialsBeEnabled() { |
108 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 108 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
109 return password_manager::IsPropagatingPasswordChangesToWebCredentialsEnabled( | 109 return password_manager::IsPropagatingPasswordChangesToWebCredentialsEnabled( |
110 *command_line); | 110 *command_line); |
111 } | 111 } |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 break; | 448 break; |
449 case LIBSECRET: | 449 case LIBSECRET: |
450 usage = OTHER_LIBSECRET; | 450 usage = OTHER_LIBSECRET; |
451 break; | 451 break; |
452 } | 452 } |
453 } | 453 } |
454 UMA_HISTOGRAM_ENUMERATION("PasswordManager.LinuxBackendStatistics", usage, | 454 UMA_HISTOGRAM_ENUMERATION("PasswordManager.LinuxBackendStatistics", usage, |
455 MAX_BACKEND_USAGE_VALUE); | 455 MAX_BACKEND_USAGE_VALUE); |
456 } | 456 } |
457 #endif | 457 #endif |
OLD | NEW |