diff options
author | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-30 22:52:34 +0000 |
---|---|---|
committer | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-30 22:52:34 +0000 |
commit | 57319e14f7429ef47086acfa1acf1e7f75c956a7 (patch) | |
tree | 7c20eef391e725a52d47a17fb7446a2163afe330 /chrome_frame/utils.h | |
parent | c1a9b640c320f20f6b797e103416195a14b2401d (diff) | |
download | chromium_src-57319e14f7429ef47086acfa1acf1e7f75c956a7.zip chromium_src-57319e14f7429ef47086acfa1acf1e7f75c956a7.tar.gz chromium_src-57319e14f7429ef47086acfa1acf1e7f75c956a7.tar.bz2 |
Add a setting to CF to remove 'chromeframe' from the UserAgent on a per-pattern basis.
Useful for testing and dealing with sites with broken UA parsing.
BUG=117157
TEST=chrome_frame_tests,chrome_frame_unittests,add a ExcludeUAFromDomain key to the CF settings, add some pattern values, observe that the UA string does not contain CF.
Review URL: http://codereview.chromium.org/9720001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129985 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/utils.h')
-rw-r--r-- | chrome_frame/utils.h | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/chrome_frame/utils.h b/chrome_frame/utils.h index b3899c3..d9f6580 100644 --- a/chrome_frame/utils.h +++ b/chrome_frame/utils.h @@ -15,33 +15,36 @@ #include "base/basictypes.h" #include "base/logging.h" #include "base/metrics/histogram.h" +#include "base/string16.h" #include "base/threading/thread.h" #include "base/win/scoped_comptr.h" #include "googleurl/src/gurl.h" #include "ui/gfx/rect.h" class FilePath; +class RegistryListPreferencesHolder; interface IBrowserService; interface IWebBrowser2; struct ContextMenuModel; // utils.h : Various utility functions and classes +extern const char kGCFProtocol[]; +extern const wchar_t kAllowUnsafeURLs[]; extern const wchar_t kChromeContentPrefix[]; -extern const char kGCFProtocol[]; -extern const wchar_t kChromeProtocolPrefix[]; -extern const wchar_t kChromeFrameHeadlessMode[]; extern const wchar_t kChromeFrameAccessibleMode[]; -extern const wchar_t kChromeFrameUnpinnedMode[]; -extern const wchar_t kAllowUnsafeURLs[]; -extern const wchar_t kEnableBuggyBhoIntercept[]; -extern const wchar_t kChromeMimeType[]; extern const wchar_t kChromeFrameAttachTabPattern[]; extern const wchar_t kChromeFrameConfigKey[]; -extern const wchar_t kRenderInGCFUrlList[]; -extern const wchar_t kRenderInHostUrlList[]; +extern const wchar_t kChromeFrameHeadlessMode[]; +extern const wchar_t kChromeFrameUnpinnedMode[]; +extern const wchar_t kChromeMimeType[]; +extern const wchar_t kChromeProtocolPrefix[]; +extern const wchar_t kEnableBuggyBhoIntercept[]; extern const wchar_t kEnableGCFRendererByDefault[]; +extern const wchar_t kExcludeUAFromDomainList[]; extern const wchar_t kIexploreProfileName[]; +extern const wchar_t kRenderInGCFUrlList[]; +extern const wchar_t kRenderInHostUrlList[]; extern const wchar_t kRundllProfileName[]; extern const wchar_t kUseBackgroundThreadForSubResources[]; @@ -272,6 +275,18 @@ bool IsGcfDefaultRenderer(); // - RENDERER_TYPE_CHROME_OPT_IN_URL RendererType RendererTypeForUrl(const std::wstring& url); +// Check if we should try to remove the CF user agent based on registry +// settings. +bool ShouldRemoveUAForUrl(const string16& url); + +// Testing methods that return the backing stores behind RendererTypeForUrl and +// ShouldRemoveUAForUrl. Intended to allow unit testing code that calls the +// above methods. +// TODO(robertshield): All of the FooForUrl code should be removed from here +// and further refactored. +RegistryListPreferencesHolder& GetRendererTypePreferencesHolderForTesting(); +RegistryListPreferencesHolder& GetUserAgentPreferencesHolderForTesting(); + // A shortcut for QueryService template <typename T> HRESULT DoQueryService(const IID& service_id, IUnknown* unk, T** service) { |