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

Unified Diff: webkit/glue/webkit_glue.h

Issue 8002003: Revert "Remove webkit_glue::BuildUserAgent(), change the contract in webkit_glue" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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
« no previous file with comments | « webkit/glue/user_agent.cc ('k') | webkit/glue/webkit_glue.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webkit_glue.h
diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h
index 37a56a466e1d86fb49d16883860bb237a0d1039b..54cfdc1f29aaa9099f33b0dddb42cb704e4c88a4 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 -------------------------------
« no previous file with comments | « webkit/glue/user_agent.cc ('k') | webkit/glue/webkit_glue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698