| 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 #ifndef COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_SYNC_UTIL_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_SYNC_UTIL_H_ |
| 6 #define COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_SYNC_UTIL_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_SYNC_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "components/autofill/core/common/password_form.h" | 10 #include "components/autofill/core/common/password_form.h" |
| 11 #include "components/signin/core/browser/signin_manager.h" | 11 #include "components/signin/core/browser/signin_manager.h" |
| 12 #include "components/sync/driver/sync_service.h" | 12 #include "components/sync/driver/sync_service.h" |
| 13 | 13 |
| 14 namespace password_manager { | 14 namespace password_manager { |
| 15 namespace sync_util { | 15 namespace sync_util { |
| 16 | 16 |
| 17 // Returns the sync username received from |signin_manager| (if not null). | 17 // Returns the sync username received from |signin_manager| (if not null). |
| 18 // Moreover, using |sync_service| (if not null), this function also tries to | 18 // Moreover, using |sync_service| (if not null), this function also tries to |
| 19 // return an empty string if the user isn't syncing passwords, but it is not | 19 // return an empty string if the user isn't syncing passwords, but it is not |
| 20 // always possible to determine since this code can be called during sync setup | 20 // always possible to determine since this code can be called during sync setup |
| 21 // (http://crbug.com/393626). | 21 // (http://crbug.com/393626). |
| 22 std::string GetSyncUsernameIfSyncingPasswords( | 22 std::string GetSyncUsernameIfSyncingPasswords( |
| 23 const syncer::SyncService* sync_service, | 23 const sync_driver::SyncService* sync_service, |
| 24 const SigninManagerBase* signin_manager); | 24 const SigninManagerBase* signin_manager); |
| 25 | 25 |
| 26 // Returns true if |form| corresponds to the account specified by | 26 // Returns true if |form| corresponds to the account specified by |
| 27 // GetSyncUsernameIfSyncingPasswords. Returns false if | 27 // GetSyncUsernameIfSyncingPasswords. Returns false if |
| 28 // GetSyncUsernameIfSyncingPasswords does not specify any account. | 28 // GetSyncUsernameIfSyncingPasswords does not specify any account. |
| 29 bool IsSyncAccountCredential(const autofill::PasswordForm& form, | 29 bool IsSyncAccountCredential(const autofill::PasswordForm& form, |
| 30 const syncer::SyncService* sync_service, | 30 const sync_driver::SyncService* sync_service, |
| 31 const SigninManagerBase* signin_manager); | 31 const SigninManagerBase* signin_manager); |
| 32 | 32 |
| 33 } // namespace sync_util | 33 } // namespace sync_util |
| 34 } // namespace password_manager | 34 } // namespace password_manager |
| 35 | 35 |
| 36 #endif // COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_SYNC_UTIL_H_ | 36 #endif // COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_SYNC_UTIL_H_ |
| OLD | NEW |