summaryrefslogtreecommitdiffstats
path: root/chrome_frame/utils.h
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-22 17:02:58 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-22 17:02:58 +0000
commitd8e135173589b4d88f5d24dce9b81d7278d9c18a (patch)
tree67e4ca492ae31ad7e8c293575bcae9d777464519 /chrome_frame/utils.h
parent3d75a0c7627845e03ee87e82a5da40e133f55cc7 (diff)
downloadchromium_src-d8e135173589b4d88f5d24dce9b81d7278d9c18a.zip
chromium_src-d8e135173589b4d88f5d24dce9b81d7278d9c18a.tar.gz
chromium_src-d8e135173589b4d88f5d24dce9b81d7278d9c18a.tar.bz2
Committing http://codereview.chromium.org/3420004/show for grt@
Original description: - added detection of IE9 for ChromeFrame.IEVersion metric - replaced ChromeFrame.FullTabLaunchType metric with ChromeFrame.LaunchType metric, which logs more info regarding how it came to be that GCF rendered a page (but only for the CTransaction patch) BUG=43885 TEST=none Review URL: http://codereview.chromium.org/3443017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60188 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/utils.h')
-rw-r--r--chrome_frame/utils.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/chrome_frame/utils.h b/chrome_frame/utils.h
index d4781e1..665ebca 100644
--- a/chrome_frame/utils.h
+++ b/chrome_frame/utils.h
@@ -180,8 +180,36 @@ typedef enum IEVersion {
IE_6,
IE_7,
IE_8,
+ IE_9,
};
+// The renderer to be used for a page. Values for Chrome also convey the
+// reason why Chrome is used.
+enum RendererType {
+ RENDERER_TYPE_UNDETERMINED = 0,
+ RENDERER_TYPE_CHROME_MIN,
+ // NOTE: group all _CHROME_ values together below here, as they are used for
+ // generating metrics reported via UMA (adjust MIN/MAX as needed).
+ RENDERER_TYPE_CHROME_GCF_PROTOCOL = RENDERER_TYPE_CHROME_MIN,
+ RENDERER_TYPE_CHROME_HTTP_EQUIV,
+ RENDERER_TYPE_CHROME_RESPONSE_HEADER,
+ RENDERER_TYPE_CHROME_DEFAULT_RENDERER,
+ RENDERER_TYPE_CHROME_OPT_IN_URL,
+ RENDERER_TYPE_CHROME_WIDGET,
+ // NOTE: all _CHOME_ values must go above here (adjust MIN/MAX as needed).
+ RENDERER_TYPE_CHROME_MAX = RENDERER_TYPE_CHROME_WIDGET,
+ RENDERER_TYPE_OTHER,
+};
+
+// Returns true if the given RendererType represents Chrome.
+bool IsChrome(RendererType renderer_type);
+
+// Convenience macro for logging a sample for the launch type metric.
+#define THREAD_SAFE_UMA_LAUNCH_TYPE_COUNT(sample) \
+ THREAD_SAFE_UMA_HISTOGRAM_CUSTOM_COUNTS("ChromeFrame.LaunchType", sample, \
+ RENDERER_TYPE_CHROME_MIN, RENDERER_TYPE_CHROME_MAX, \
+ RENDERER_TYPE_CHROME_MAX + 1 - RENDERER_TYPE_CHROME_MIN)
+
// To get the IE version when Chrome Frame is hosted in IE. Make sure that
// the hosting browser is IE before calling this function, otherwise NON_IE
// will be returned.
@@ -252,7 +280,11 @@ bool IsUnpinnedMode();
bool IsGcfDefaultRenderer();
// Check if this url is opting into Chrome Frame based on static settings.
-bool IsOptInUrl(const wchar_t* url);
+// Returns one of:
+// - RENDERER_TYPE_UNDETERMINED if not opt-in or if explicit opt-out
+// - RENDERER_TYPE_CHROME_DEFAULT_RENDERER
+// - RENDERER_TYPE_CHROME_OPT_IN_URL
+RendererType RendererTypeForUrl(const std::wstring& url);
// A shortcut for QueryService
template <typename T>