sync_auth_util.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2018 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. #ifndef COMPONENTS_SYNC_DRIVER_SYNC_AUTH_UTIL_H_
  5. #define COMPONENTS_SYNC_DRIVER_SYNC_AUTH_UTIL_H_
  6. #include "components/signin/public/identity_manager/account_info.h"
  7. class GoogleServiceAuthError;
  8. namespace signin {
  9. class IdentityManager;
  10. } // namespace signin
  11. namespace syncer {
  12. struct SyncAccountInfo {
  13. SyncAccountInfo();
  14. SyncAccountInfo(const CoreAccountInfo& account_info, bool is_sync_consented);
  15. CoreAccountInfo account_info;
  16. bool is_sync_consented = false;
  17. };
  18. // Determines which account should be used for Sync and returns the
  19. // corresponding SyncAccountInfo. This is exposed so that autofill metrics
  20. // code can use it.
  21. SyncAccountInfo DetermineAccountToUse(
  22. signin::IdentityManager* identity_manager);
  23. // Returns whether |auth_error| indicates the user has locally signed out of
  24. // content area, rejecting credentials.
  25. bool IsWebSignout(const GoogleServiceAuthError& auth_error);
  26. } // namespace syncer
  27. #endif // COMPONENTS_SYNC_DRIVER_SYNC_AUTH_UTIL_H_