Yao Xiao | 3a83d79 | 2022-11-04 19:46:36 | [diff] [blame] | 1 | // Copyright 2022 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 | #ifndef CONTENT_BROWSER_BROWSING_TOPICS_HEADER_UTIL_H_ |
| 6 | #define CONTENT_BROWSER_BROWSING_TOPICS_HEADER_UTIL_H_ |
| 7 | |
| 8 | #include "components/browsing_topics/common/common_types.h" |
| 9 | #include "content/public/browser/render_frame_host.h" |
Abigail Katcoff | 5b17107 | 2023-04-28 14:25:06 | [diff] [blame] | 10 | #include "services/network/public/mojom/parsed_headers.mojom-forward.h" |
Yao Xiao | 3a83d79 | 2022-11-04 19:46:36 | [diff] [blame] | 11 | #include "third_party/blink/public/mojom/browsing_topics/browsing_topics.mojom.h" |
| 12 | |
| 13 | namespace content { |
| 14 | |
Avi Drissman | 3d7558df8 | 2025-08-01 17:21:20 | [diff] [blame] | 15 | inline constexpr char kBrowsingTopicsRequestHeaderKey[] = "Sec-Browsing-Topics"; |
Yao Xiao | 3a83d79 | 2022-11-04 19:46:36 | [diff] [blame] | 16 | |
Yao Xiao | dd39a3e | 2023-05-27 16:21:06 | [diff] [blame] | 17 | // Derive the header value for `Sec-Browsing-Topics` given `topics` and |
| 18 | // `num_versions_in_epochs`. |
Yao Xiao | 3a83d79 | 2022-11-04 19:46:36 | [diff] [blame] | 19 | std::string CONTENT_EXPORT |
Yao Xiao | dd39a3e | 2023-05-27 16:21:06 | [diff] [blame] | 20 | DeriveTopicsHeaderValue(const std::vector<blink::mojom::EpochTopicPtr>& topics, |
| 21 | int num_versions_in_epochs); |
Yao Xiao | 3a83d79 | 2022-11-04 19:46:36 | [diff] [blame] | 22 | |
| 23 | // Handle the response for topics eligible requests. |
Abigail Katcoff | 5b17107 | 2023-04-28 14:25:06 | [diff] [blame] | 24 | void CONTENT_EXPORT HandleTopicsEligibleResponse( |
| 25 | const network::mojom::ParsedHeadersPtr& parsed_headers, |
| 26 | const url::Origin& caller_origin, |
| 27 | RenderFrameHost& request_initiator_frame, |
| 28 | browsing_topics::ApiCallerSource caller_source); |
Yao Xiao | 3a83d79 | 2022-11-04 19:46:36 | [diff] [blame] | 29 | |
| 30 | } // namespace content |
| 31 | |
| 32 | #endif // CONTENT_BROWSER_BROWSING_TOPICS_HEADER_UTIL_H_ |