OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/password_manager/core/browser/password_manager_util.h" | 5 #include "components/password_manager/core/browser/password_manager_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "components/autofill/core/common/password_form.h" | 10 #include "components/autofill/core/common/password_form.h" |
11 #include "components/password_manager/core/browser/log_manager.h" | 11 #include "components/password_manager/core/browser/log_manager.h" |
12 #include "components/sync/driver/sync_service.h" | 12 #include "components/sync/driver/sync_service.h" |
13 | 13 |
14 namespace password_manager_util { | 14 namespace password_manager_util { |
15 | 15 |
16 password_manager::PasswordSyncState GetPasswordSyncState( | 16 password_manager::PasswordSyncState GetPasswordSyncState( |
17 const sync_driver::SyncService* sync_service) { | 17 const syncer::SyncService* sync_service) { |
18 if (sync_service && sync_service->IsFirstSetupComplete() && | 18 if (sync_service && sync_service->IsFirstSetupComplete() && |
19 sync_service->IsSyncActive() && | 19 sync_service->IsSyncActive() && |
20 sync_service->GetActiveDataTypes().Has(syncer::PASSWORDS)) { | 20 sync_service->GetActiveDataTypes().Has(syncer::PASSWORDS)) { |
21 return sync_service->IsUsingSecondaryPassphrase() | 21 return sync_service->IsUsingSecondaryPassphrase() |
22 ? password_manager::SYNCING_WITH_CUSTOM_PASSPHRASE | 22 ? password_manager::SYNCING_WITH_CUSTOM_PASSPHRASE |
23 : password_manager::SYNCING_NORMAL_ENCRYPTION; | 23 : password_manager::SYNCING_NORMAL_ENCRYPTION; |
24 } | 24 } |
25 return password_manager::NOT_SYNCING_PASSWORDS; | 25 return password_manager::NOT_SYNCING_PASSWORDS; |
26 } | 26 } |
27 | 27 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 old_vector.weak_clear(); // All owned by |new_vector| by now. | 92 old_vector.weak_clear(); // All owned by |new_vector| by now. |
93 return new_vector; | 93 return new_vector; |
94 } | 94 } |
95 | 95 |
96 bool IsLoggingActive(const password_manager::PasswordManagerClient* client) { | 96 bool IsLoggingActive(const password_manager::PasswordManagerClient* client) { |
97 const password_manager::LogManager* log_manager = client->GetLogManager(); | 97 const password_manager::LogManager* log_manager = client->GetLogManager(); |
98 return log_manager && log_manager->IsLoggingActive(); | 98 return log_manager && log_manager->IsLoggingActive(); |
99 } | 99 } |
100 | 100 |
101 } // namespace password_manager_util | 101 } // namespace password_manager_util |
OLD | NEW |