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 3// found in the LICENSE file. 4 5#ifndef CHROME_BROWSER_PASSWORD_MANAGER_SYNC_METRICS_H_ 6#define CHROME_BROWSER_PASSWORD_MANAGER_SYNC_METRICS_H_ 7 8#include <string> 9 10class Profile; 11 12namespace password_manager_sync_metrics { 13 14// Returns the sync username for |profile|. Returns an empty string if the 15// |profile| isn't syncing. This function tries to return an empty string if 16// the user isn't syncing passwords, but it is not always possibly to determine 17// since this code can be called during sync setup (http://crbug.com/393626). 18std::string GetSyncUsername(Profile* profile); 19 20// Returns true if |username| and |origin| correspond to the account which is 21// syncing. Will return false if |profile| is not syncing. 22bool IsSyncAccountCredential(Profile* profile, 23 const std::string& username, 24 const std::string& origin); 25 26} // namespace password_manager_sync_metrics 27 28#endif // CHROME_BROWSER_PASSWORD_MANAGER_SYNC_METRICS_H_ 29