summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webkit_glue.h
diff options
context:
space:
mode:
authordpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-22 20:50:22 +0000
committerdpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-22 20:50:22 +0000
commit6444576f29eba3eb674a7809c00cd9b586ddc575 (patch)
treea45bf9577da6b999ad79b2f30bfd17811d83dcf2 /webkit/glue/webkit_glue.h
parent6f03db06811b7bc1ff33427c834a52e29f4e57b8 (diff)
downloadchromium_src-6444576f29eba3eb674a7809c00cd9b586ddc575.zip
chromium_src-6444576f29eba3eb674a7809c00cd9b586ddc575.tar.gz
chromium_src-6444576f29eba3eb674a7809c00cd9b586ddc575.tar.bz2
Revert "Remove webkit_glue::BuildUserAgent(), change the contract in webkit_glue"
TBR=jam@chromium.org BUG=90442 TEST=none Review URL: http://codereview.chromium.org/8002003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102353 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webkit_glue.h')
-rw-r--r--webkit/glue/webkit_glue.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h
index 37a56a4..54cfdc1 100644
--- a/webkit/glue/webkit_glue.h
+++ b/webkit/glue/webkit_glue.h
@@ -88,14 +88,14 @@ string16 DumpFrameScrollPosition(WebKit::WebFrame* web_frame, bool recursive);
string16 DumpHistoryState(const std::string& history_state, int indent,
bool is_current);
-// 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.
-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.
+// Called to override the default user agent with a custom one. Call this
+// before anyone actually asks for the user agent in order to prevent
+// inconsistent behavior.
+void SetUserAgent(const std::string& new_user_agent);
+
+// Returns the user agent to use for the given URL, which is usually the
+// default user agent but may be overriden by a call to SetUserAgent() (which
+// should be done at startup).
const std::string& GetUserAgent(const GURL& url);
// Creates serialized state for the specified URL. This is a variant of
@@ -147,6 +147,10 @@ WebKit::WebCanvas* ToWebCanvas(skia::PlatformCanvas*);
// used to get memory usage statistics.
int GetGlyphPageCount();
+// Construct the User-Agent header, filling in |result|.
+// - If mimic_windows is true, produce a fake Windows Chrome string.
+std::string BuildUserAgent(bool mimic_windows);
+
//---- END FUNCTIONS IMPLEMENTED BY WEBKIT/GLUE -------------------------------