user_agent.h revision a1401311d1ab56c4ed0a474bd38c108f75cb0cd9
1// Copyright 2014 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
5#ifndef CONTENT_PUBLIC_COMMON_USER_AGENT_H_
6#define CONTENT_PUBLIC_COMMON_USER_AGENT_H_
7
8#include <string>
9
10#include "content/common/content_export.h"
11
12namespace content {
13
14// Returns the WebKit version, in the form "major.minor (branch@revision)".
15CONTENT_EXPORT std::string GetWebKitVersion();
16
17// The following 2 functions return the major and minor webkit versions.
18CONTENT_EXPORT int GetWebKitMajorVersion();
19CONTENT_EXPORT int GetWebKitMinorVersion();
20
21CONTENT_EXPORT std::string GetWebKitRevision();
22
23// Builds a User-agent compatible string that describes the OS and CPU type.
24CONTENT_EXPORT std::string BuildOSCpuInfo();
25
26// Helper function to generate a full user agent string from a short
27// product name.
28CONTENT_EXPORT std::string BuildUserAgentFromProduct(
29    const std::string& product);
30
31// Builds a full user agent string given a string describing the OS and a
32// product name.
33CONTENT_EXPORT std::string BuildUserAgentFromOSAndProduct(
34    const std::string& os_info,
35    const std::string& product);
36
37}  // namespace content
38
39#endif  // CONTENT_PUBLIC_COMMON_USER_AGENT_H_
40