Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1287)

Unified Diff: webkit/glue/user_agent.h

Issue 10869073: Split user agent code out of the 'glue' target (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add new test file to patch Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/glue/user_agent.h
diff --git a/webkit/glue/user_agent.h b/webkit/glue/user_agent.h
index 5d2594aae21b9df11d319b740e0ce912b66d4e02..e357e4bf069aae74eb5aad2a35ebacb37d646ba5 100644
--- a/webkit/glue/user_agent.h
+++ b/webkit/glue/user_agent.h
@@ -8,9 +8,23 @@
#include <string>
#include "base/basictypes.h"
+#include "webkit/glue/webkit_glue_export.h"
+
+class GURL;
namespace webkit_glue {
+// Sets the user agent. Pass true for overriding if this is a custom
+// user agent instead of the default one (in order to turn off any browser
+// sniffing workarounds). This must be called before GetUserAgent() can
+// be called.
+WEBKIT_GLUE_EXPORT void SetUserAgent(const std::string& user_agent,
+ bool overriding);
+
+// Returns the user agent to use for the given URL. SetUserAgent() must
+// be called prior to calling this function.
+WEBKIT_GLUE_EXPORT const std::string& GetUserAgent(const GURL& url);
+
// Builds a User-agent compatible string that describes the OS and CPU type.
std::string BuildOSCpuInfo();

Powered by Google App Engine
This is Rietveld 408576698