Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WEBKIT_COMMON_USER_AGENT_USER_AGENT_UTIL_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_USER_AGENT_H_ |
| 6 #define WEBKIT_COMMON_USER_AGENT_USER_AGENT_UTIL_H_ | 6 #define CONTENT_PUBLIC_COMMON_USER_AGENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "content/common/content_export.h" |
| 11 #include "webkit/common/user_agent/webkit_user_agent_export.h" | |
| 12 | 11 |
| 13 namespace webkit_glue { | 12 class GURL; |
| 13 | |
| 14 namespace content { | |
| 15 | |
| 16 // Returns the user agent to use for the given URL. SetUserAgent() must | |
| 17 // be called prior to calling this function. | |
|
jam
2014/03/05 00:09:26
nit: remove the second part of the comment since i
tfarina
2014/03/05 00:42:52
Done.
| |
| 18 CONTENT_EXPORT const std::string& GetUserAgent(const GURL& url); | |
| 14 | 19 |
| 15 // Builds a User-agent compatible string that describes the OS and CPU type. | 20 // Builds a User-agent compatible string that describes the OS and CPU type. |
| 16 WEBKIT_USER_AGENT_EXPORT std::string BuildOSCpuInfo(); | 21 CONTENT_EXPORT std::string BuildOSCpuInfo(); |
| 17 | 22 |
| 18 // Returns the WebKit version, in the form "major.minor (branch@revision)". | 23 // Returns the WebKit version, in the form "major.minor (branch@revision)". |
| 19 WEBKIT_USER_AGENT_EXPORT std::string GetWebKitVersion(); | 24 CONTENT_EXPORT std::string GetWebKitVersion(); |
| 20 | 25 |
| 21 // The following 2 functions return the major and minor webkit versions. | 26 // The following 2 functions return the major and minor webkit versions. |
| 22 WEBKIT_USER_AGENT_EXPORT int GetWebKitMajorVersion(); | 27 CONTENT_EXPORT int GetWebKitMajorVersion(); |
| 23 WEBKIT_USER_AGENT_EXPORT int GetWebKitMinorVersion(); | 28 CONTENT_EXPORT int GetWebKitMinorVersion(); |
| 24 | 29 |
| 25 WEBKIT_USER_AGENT_EXPORT std::string GetWebKitRevision(); | 30 CONTENT_EXPORT std::string GetWebKitRevision(); |
| 26 | 31 |
| 27 // Helper function to generate a full user agent string from a short | 32 // Helper function to generate a full user agent string from a short |
| 28 // product name. | 33 // product name. |
| 29 WEBKIT_USER_AGENT_EXPORT std::string BuildUserAgentFromProduct( | 34 CONTENT_EXPORT std::string BuildUserAgentFromProduct( |
| 30 const std::string& product); | 35 const std::string& product); |
| 31 | 36 |
| 32 // Builds a full user agent string given a string describing the OS and a | 37 // Builds a full user agent string given a string describing the OS and a |
| 33 // product name. | 38 // product name. |
| 34 WEBKIT_USER_AGENT_EXPORT std::string BuildUserAgentFromOSAndProduct( | 39 CONTENT_EXPORT std::string BuildUserAgentFromOSAndProduct( |
| 35 const std::string& os_info, | 40 const std::string& os_info, |
| 36 const std::string& product); | 41 const std::string& product); |
| 37 | 42 |
| 38 } // namespace webkit_glue | 43 } // namespace content |
| 39 | 44 |
| 40 #endif // WEBKIT_COMMON_USER_AGENT_USER_AGENT_UTIL_H_ | 45 #endif // CONTENT_PUBLIC_COMMON_USER_AGENT_H_ |
| OLD | NEW |