| // Copyright 2021 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #ifndef COMPONENTS_EMBEDDER_SUPPORT_USER_AGENT_UTILS_H_ |
| #define COMPONENTS_EMBEDDER_SUPPORT_USER_AGENT_UTILS_H_ |
| |
| #include <string> |
| |
| #include "build/build_config.h" |
| #include "third_party/blink/public/common/user_agent/user_agent_metadata.h" |
| |
| namespace blink { |
| struct UserAgentMetadata; |
| } |
| |
| namespace content { |
| class WebContents; |
| } |
| |
| namespace embedder_support { |
| |
| // Returns the product used in building the user-agent. |
| std::string GetProduct(); |
| |
| // Returns the user agent string for Chrome. |
| std::string GetUserAgent(); |
| |
| blink::UserAgentMetadata GetUserAgentMetadata(); |
| |
| blink::UserAgentBrandList GenerateBrandVersionList( |
| int seed, |
| base::Optional<std::string> brand, |
| std::string major_version, |
| base::Optional<std::string> maybe_greasey_brand); |
| |
| #if defined(OS_ANDROID) |
| // This sets a user agent string to simulate a desktop user agent on mobile. |
| void SetDesktopUserAgentOverride(content::WebContents* web_contents, |
| const blink::UserAgentMetadata& metadata); |
| #endif |
| |
| } // namespace embedder_support |
| |
| #endif // COMPONENTS_EMBEDDER_SUPPORT_USER_AGENT_UTILS_H_ |