summaryrefslogtreecommitdiffstats
path: root/chrome_frame/html_utils.h
diff options
context:
space:
mode:
authortommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-17 04:48:37 +0000
committertommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-17 04:48:37 +0000
commit3f55e8712f88d8477d9e58f68958e83c92664389 (patch)
tree21f9eeeda041fd570c31d8b0f266f780b767418f /chrome_frame/html_utils.h
parentcd1c89e833b7e67b7a7ca8799122e07b65999771 (diff)
downloadchromium_src-3f55e8712f88d8477d9e58f68958e83c92664389.zip
chromium_src-3f55e8712f88d8477d9e58f68958e83c92664389.tar.gz
chromium_src-3f55e8712f88d8477d9e58f68958e83c92664389.tar.bz2
Add the chromeframe tag to the user agent header at runtime instead of statically in the registry.TEST=Try disabling GCF and see if the chromeframe tag in the user agent is still set. It should not be. Also make sure you don't have an older version installed... the chromeframe tag should not be in the registry - if it is, you've got an older version still registered. This should fix the issue with going to wave.google.com after disabling chrome frame and seeing the white page of death.R=amitBUG=22760
Review URL: http://codereview.chromium.org/259025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29370 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/html_utils.h')
-rw-r--r--chrome_frame/html_utils.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/chrome_frame/html_utils.h b/chrome_frame/html_utils.h
index 4b89a2d..369950c 100644
--- a/chrome_frame/html_utils.h
+++ b/chrome_frame/html_utils.h
@@ -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 @@ class HTMLScanner {
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_