Alex Kingsborough | 20cc27c | 2024-01-03 23:05:11 | [diff] [blame] | 1 | // Copyright 2023 The Chromium Authors |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "components/push_notification/push_notification_client_id.h" |
| 6 | |
| 7 | namespace push_notification { |
| 8 | |
| 9 | std::optional<std::string> GetClientIdStr(ClientId id) { |
| 10 | switch (id) { |
| 11 | case ClientId::kNearbyPresence: |
| 12 | return kNearbyPresenceClientId; |
| 13 | default: |
| 14 | return std::nullopt; |
| 15 | } |
| 16 | } |
| 17 | |
Alex Kingsborough | 06fa525 | 2024-01-09 21:26:10 | [diff] [blame] | 18 | std::optional<ClientId> GetClientIdFromStr(const std::string& id_string) { |
Alex Kingsborough | 20cc27c | 2024-01-03 23:05:11 | [diff] [blame] | 19 | if (id_string == kNearbyPresenceClientId) { |
| 20 | return ClientId::kNearbyPresence; |
| 21 | } |
Alex Kingsborough | 06fa525 | 2024-01-09 21:26:10 | [diff] [blame] | 22 | return std::nullopt; |
Alex Kingsborough | 20cc27c | 2024-01-03 23:05:11 | [diff] [blame] | 23 | } |
| 24 | |
| 25 | } // namespace push_notification |