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

Unified Diff: chrome_frame/utils.cc

Issue 3131003: Support GCF as the default HTML viewer. I simply extended the IsOptInUrl che... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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/protocol_sink_wrap.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/utils.cc
===================================================================
--- chrome_frame/utils.cc (revision 55568)
+++ chrome_frame/utils.cc (working copy)
@@ -48,8 +48,10 @@
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[] =
@@ -700,15 +702,35 @@
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;
+ } 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;
amit 2010/08/10 20:36:25 true! :) We definitely need a unit test for this.
+ }
+
+ return load_in_chrome_frame;
}
HRESULT NavigateBrowserToMoniker(IUnknown* browser, IMoniker* moniker,
« no previous file with comments | « chrome_frame/protocol_sink_wrap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698