summaryrefslogtreecommitdiffstats
path: root/chrome_frame/utils.cc
diff options
context:
space:
mode:
authortommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-11 03:47:43 +0000
committertommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-11 03:47:43 +0000
commit7ab36c4f07b585449febcc6f2c59a9f5a0a40eed (patch)
tree72c59f9c527a7276fa7d94d7d7ba0e9d31c320af /chrome_frame/utils.cc
parentdb1cad416f942052953deda261035186535349c9 (diff)
downloadchromium_src-7ab36c4f07b585449febcc6f2c59a9f5a0a40eed.zip
chromium_src-7ab36c4f07b585449febcc6f2c59a9f5a0a40eed.tar.gz
chromium_src-7ab36c4f07b585449febcc6f2c59a9f5a0a40eed.tar.bz2
Support GCF as the default HTML viewer as well as supporting an exclusion list.
Now, there are two URL lists that we support and a master REG_DWORD value ("IsDefaultRenderer" ) to switch between them. Note that the OptInUrls key is no longer supported but the URL lists mentioned below function in the same way OptInUrls used to. This is basically how it works: if IsDefaultRenderer Url list name is "RenderInHostUrls" and lists patterns that the host (IE) should render. if not IsDefaultRenderer (i.e. it's 0) Url list name is "RenderInGcfUrls" and lists patterns that GCF should render. Also fixing typo :) TEST=See description above and in bug report. BUG= 50788 Review URL: http://codereview.chromium.org/3131003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55664 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/utils.cc')
-rw-r--r--chrome_frame/utils.cc39
1 files changed, 31 insertions, 8 deletions
diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc
index c92c0f1..f60f6c0 100644
--- a/chrome_frame/utils.cc
+++ b/chrome_frame/utils.cc
@@ -48,8 +48,10 @@ const wchar_t kChromeFrameAttachTabPattern[] = L"*?attach_external_tab&*";
static const wchar_t kChromeFrameConfigKey[] =
L"Software\\Google\\ChromeFrame";
-static const wchar_t kChromeFrameOptinUrlsKey[] = L"OptinUrls";
+static const wchar_t kRenderInGCFUrlList[] = L"RenderInGcfUrls";
+static const wchar_t kRenderInHostUrlList[] = L"RenderInHostUrls";
static const wchar_t kEnableGCFProtocol[] = L"EnableGCFProtocol";
+static const wchar_t kEnableGCFRendererByDefault[] = L"IsDefaultRenderer";
static const wchar_t kEnableBuggyBhoIntercept[] = L"EnableBuggyBhoIntercept";
static const wchar_t kChromeFrameNPAPIKey[] =
@@ -696,19 +698,40 @@ bool DeleteConfigValue(const wchar_t* value_name) {
}
bool IsOptInUrl(const wchar_t* url) {
+ // TODO(tommi): Unit test.
RegKey config_key;
if (!config_key.Open(HKEY_CURRENT_USER, kChromeFrameConfigKey, KEY_READ))
return false;
- RegistryValueIterator optin_urls_list(config_key.Handle(),
- kChromeFrameOptinUrlsKey);
- while (optin_urls_list.Valid()) {
- if (MatchPatternWide(url, optin_urls_list.Name()))
- return true;
- ++optin_urls_list;
+ bool load_in_chrome_frame = false;
+
+ const wchar_t* url_list_name = NULL;
+ int render_in_cf_by_default = FALSE;
+ config_key.ReadValueDW(kEnableGCFRendererByDefault,
+ reinterpret_cast<DWORD*>(&render_in_cf_by_default));
+ if (render_in_cf_by_default) {
+ url_list_name = kRenderInHostUrlList;
+ load_in_chrome_frame = true; // change the default to true.
+ } else {
+ url_list_name = kRenderInGCFUrlList;
}
- return false;
+ bool match_found = false;
+ RegistryValueIterator url_list(config_key.Handle(), url_list_name);
+ while (!match_found && url_list.Valid()) {
+ if (MatchPatternWide(url, url_list.Name())) {
+ match_found = true;
+ } else {
+ ++url_list;
+ }
+ }
+
+ if (match_found) {
+ // The lists are there to opt out of whatever is the default.
+ load_in_chrome_frame = !load_in_chrome_frame;
+ }
+
+ return load_in_chrome_frame;
}
HRESULT NavigateBrowserToMoniker(IUnknown* browser, IMoniker* moniker,