Linux: Depend on liberation-fonts package for RPMs.
[chromium-blink-merge.git] / components / password_manager / sync / browser / password_sync_util.h
blob6123e401498baa67563d788a8612fedd08c2982e
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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_SYNC_UTIL_H_
6 #define COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_SYNC_UTIL_H_
8 #include <string>
10 #include "components/autofill/core/common/password_form.h"
11 #include "components/signin/core/browser/signin_manager.h"
12 #include "components/sync_driver/sync_service.h"
14 namespace password_manager {
15 namespace sync_util {
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
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
21 // (http://crbug.com/393626).
22 std::string GetSyncUsernameIfSyncingPasswords(
23 const sync_driver::SyncService* sync_service,
24 const SigninManagerBase* signin_manager);
26 // Returns true if |form| corresponds to the account specified by
27 // GetSyncUsernameIfSyncingPasswords. Returns false if
28 // GetSyncUsernameIfSyncingPasswords does not specify any account.
29 bool IsSyncAccountCredential(const autofill::PasswordForm& form,
30 const sync_driver::SyncService* sync_service,
31 const SigninManagerBase* signin_manager);
33 } // namespace sync_util
34 } // namespace password_manager
36 #endif // COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_SYNC_UTIL_H_