1 // Copyright (c) 2012 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.
5 #ifndef WEBKIT_COMMON_USER_AGENT_USER_AGENT_UTIL_H_
6 #define WEBKIT_COMMON_USER_AGENT_USER_AGENT_UTIL_H_
10 #include "base/basictypes.h"
11 #include "webkit/common/user_agent/webkit_user_agent_export.h"
13 namespace webkit_glue
{
15 // Builds a User-agent compatible string that describes the OS and CPU type.
16 WEBKIT_USER_AGENT_EXPORT
std::string
BuildOSCpuInfo();
18 // Returns the WebKit version, in the form "major.minor (branch@revision)".
19 WEBKIT_USER_AGENT_EXPORT
std::string
GetWebKitVersion();
21 // The following 2 functions return the major and minor webkit versions.
22 WEBKIT_USER_AGENT_EXPORT
int GetWebKitMajorVersion();
23 WEBKIT_USER_AGENT_EXPORT
int GetWebKitMinorVersion();
25 WEBKIT_USER_AGENT_EXPORT
std::string
GetWebKitRevision();
27 // Helper function to generate a full user agent string from a short
29 WEBKIT_USER_AGENT_EXPORT
std::string
BuildUserAgentFromProduct(
30 const std::string
& product
);
32 // Builds a full user agent string given a string describing the OS and a
34 WEBKIT_USER_AGENT_EXPORT
std::string
BuildUserAgentFromOSAndProduct(
35 const std::string
& os_info
,
36 const std::string
& product
);
38 } // namespace webkit_glue
40 #endif // WEBKIT_COMMON_USER_AGENT_USER_AGENT_UTIL_H_