target_device_info.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright 2019 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_SEND_TAB_TO_SELF_TARGET_DEVICE_INFO_H_
  5. #define COMPONENTS_SEND_TAB_TO_SELF_TARGET_DEVICE_INFO_H_
  6. #include <string>
  7. #include "base/time/time.h"
  8. #include "components/sync/protocol/sync_enums.pb.h"
  9. namespace syncer {
  10. class DeviceInfo;
  11. } // namespace syncer
  12. namespace send_tab_to_self {
  13. struct SharingDeviceNames {
  14. std::string full_name;
  15. std::string short_name;
  16. };
  17. // Device information for generating send tab to self UI.
  18. struct TargetDeviceInfo {
  19. public:
  20. TargetDeviceInfo(const std::string& full_name,
  21. const std::string& short_name,
  22. const std::string& cache_guid,
  23. const sync_pb::SyncEnums::DeviceType device_type,
  24. base::Time last_updated_timestamp);
  25. TargetDeviceInfo(const TargetDeviceInfo& other);
  26. ~TargetDeviceInfo();
  27. bool operator==(const TargetDeviceInfo& rhs) const;
  28. // Device full name.
  29. std::string full_name;
  30. // Device short name.
  31. std::string short_name;
  32. // Device name
  33. std::string device_name;
  34. // Device guid.
  35. std::string cache_guid;
  36. // Device type.
  37. sync_pb::SyncEnums::DeviceType device_type;
  38. // Last updated timestamp.
  39. base::Time last_updated_timestamp;
  40. };
  41. // Returns full and short names for |device|.
  42. SharingDeviceNames GetSharingDeviceNames(const syncer::DeviceInfo* device);
  43. } // namespace send_tab_to_self
  44. #endif // COMPONENTS_SEND_TAB_TO_SELF_TARGET_DEVICE_INFO_H_