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

Unified Diff: chrome_frame/html_utils.h

Issue 259025: Add the chromeframe tag to the user agent header at runtime instead of static... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « chrome_frame/chrome_tab.cc ('k') | chrome_frame/html_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/html_utils.h
===================================================================
--- chrome_frame/html_utils.h (revision 29337)
+++ chrome_frame/html_utils.h (working copy)
@@ -11,6 +11,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "net/http/http_util.h"
#include "testing/gtest/include/gtest/gtest_prod.h"
// Forward declarations
@@ -117,4 +118,27 @@
DISALLOW_COPY_AND_ASSIGN(HTMLScanner);
};
+namespace http_utils {
+
+// Adds "chromeframe/x.y" to the end of the User-Agent string (x.y is the
+// version). If the cf tag has already been added to the string,
+// the original string is returned.
+std::string AddChromeFrameToUserAgentValue(const std::string& value);
+
+// Fetches the user agent from urlmon and adds chrome frame to the
+// comment section.
+// NOTE: The returned string includes the "User-Agent: " header name.
+std::string GetDefaultUserAgentHeaderWithCFTag();
+
+// Fetches the default user agent string from urlmon.
+// This value does not include the "User-Agent:" header name.
+std::string GetDefaultUserAgent();
+
+// Returns the Chrome Frame user agent. E.g. "chromeframe/1.0".
+// Note that in unit tests this will be "chromeframe/0.0" due to the version
+// table not being present in the unit test executable.
+const char* GetChromeFrameUserAgent();
+
+} // namespace http_utils
+
#endif // CHROME_FRAME_HTML_UTILS_H_
« no previous file with comments | « chrome_frame/chrome_tab.cc ('k') | chrome_frame/html_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698