session_sync_prefs.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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_SESSIONS_SESSION_SYNC_PREFS_H_
  5. #define COMPONENTS_SYNC_SESSIONS_SESSION_SYNC_PREFS_H_
  6. #include <string>
  7. #include "base/memory/raw_ptr.h"
  8. class PrefService;
  9. class PrefRegistrySimple;
  10. namespace sync_sessions {
  11. // Use this for the unique machine tag used for session sync.
  12. class SessionSyncPrefs {
  13. public:
  14. static void RegisterProfilePrefs(PrefRegistrySimple* registry);
  15. explicit SessionSyncPrefs(PrefService* pref_service);
  16. SessionSyncPrefs(const SessionSyncPrefs&) = delete;
  17. SessionSyncPrefs& operator=(const SessionSyncPrefs&) = delete;
  18. ~SessionSyncPrefs();
  19. std::string GetLegacySyncSessionsGUID() const;
  20. void ClearLegacySyncSessionsGUID();
  21. void SetLegacySyncSessionsGUIDForTesting(const std::string& guid);
  22. private:
  23. const raw_ptr<PrefService> pref_service_;
  24. };
  25. } // namespace sync_sessions
  26. #endif // COMPONENTS_SYNC_SESSIONS_SESSION_SYNC_PREFS_H_