[Win] Allow display of mixed content on Windows by default
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Aug 2015 23:50:19 +0000 (23:50 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Aug 2015 23:50:19 +0000 (23:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=147693
<rdar://problem/22059707>

Reviewed by Alex Christensen.

* Interfaces/IWebPreferencesPrivate.idl: Add preference accessor
to allow getting/setting use of insecure content.
* WebPreferenceKeysPrivate.h: Add new key for preference.
* WebPreferences.cpp: Implement preference accessor.
* WebPreferences.h:
* WebView.cpp: Set WebCore settings to match prefernces for
loading mixed content.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188005 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/win/ChangeLog
Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
Source/WebKit/win/WebPreferenceKeysPrivate.h
Source/WebKit/win/WebPreferences.cpp
Source/WebKit/win/WebPreferences.h
Source/WebKit/win/WebView.cpp

index 32e2dd4..0a9b942 100644 (file)
@@ -1,3 +1,19 @@
+2015-08-05  Brent Fulgham  <bfulgham@apple.com>
+
+        [Win] Allow display of mixed content on Windows by default
+        https://bugs.webkit.org/show_bug.cgi?id=147693
+        <rdar://problem/22059707>
+
+        Reviewed by Alex Christensen.
+
+        * Interfaces/IWebPreferencesPrivate.idl: Add preference accessor
+        to allow getting/setting use of insecure content.
+        * WebPreferenceKeysPrivate.h: Add new key for preference.
+        * WebPreferences.cpp: Implement preference accessor.
+        * WebPreferences.h:
+        * WebView.cpp: Set WebCore settings to match prefernces for
+        loading mixed content.
+
 2015-08-05  Filip Pizlo  <fpizlo@apple.com>
 
         Unreviewed, roll out http://trac.webkit.org/changeset/187972.
index 7d25a43..2c47954 100644 (file)
@@ -166,4 +166,6 @@ interface IWebPreferencesPrivate2 : IWebPreferencesPrivate
 {
     HRESULT javaScriptRuntimeFlags([out, retval] unsigned* flags);
     HRESULT setJavaScriptRuntimeFlags([in] unsigned flags);
+    HRESULT allowDisplayAndRunningOfInsecureContent([out, retval] BOOL* enabled);
+    HRESULT setAllowDisplayAndRunningOfInsecureContent([in] BOOL enabled);
 }
\ No newline at end of file
index a2fb951..30846ed 100644 (file)
 #define WebKitMockScrollbarsEnabledPreferenceKey "WebKitMockScrollbarsEnabled"
 
 #define WebKitEnableInheritURIQueryComponentPreferenceKey "WebKitEnableInheritURIQueryComponent"
+
+#define WebKitAllowDisplayAndRunningOfInsecureContentPreferenceKey "WebKitAllowDisplayAndRunningOfInsecureContent"
index 00c4074..6514e56 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2014 Apple Inc.  All rights reserved.
+ * Copyright (C) 2006-2011, 2014-2015 Apple Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -293,6 +293,8 @@ void WebPreferences::initializeDefaultSettings()
 
     CFDictionaryAddValue(defaults, CFSTR(WebKitRequestAnimationFrameEnabledPreferenceKey), kCFBooleanFalse);
 
+    CFDictionaryAddValue(defaults, CFSTR(WebKitAllowDisplayAndRunningOfInsecureContentPreferenceKey), kCFBooleanTrue);
+
     defaultSettings = defaults;
 }
 
@@ -1842,3 +1844,15 @@ HRESULT WebPreferences::setEnableInheritURIQueryComponent(BOOL enabled)
     setBoolValue(WebKitEnableInheritURIQueryComponentPreferenceKey, enabled);
     return S_OK;
 }
+
+HRESULT WebPreferences::allowDisplayAndRunningOfInsecureContent(BOOL* enabled)
+{
+    *enabled = boolValueForKey(WebKitAllowDisplayAndRunningOfInsecureContentPreferenceKey);
+    return S_OK;
+}
+
+HRESULT WebPreferences::setAllowDisplayAndRunningOfInsecureContent(BOOL enabled)
+{
+    setBoolValue(WebKitAllowDisplayAndRunningOfInsecureContentPreferenceKey, enabled);
+    return S_OK;
+}
index f6397c2..d27637d 100644 (file)
@@ -490,6 +490,8 @@ public:
     // IWebPreferencesPrivate2
     virtual HRESULT STDMETHODCALLTYPE javaScriptRuntimeFlags(unsigned*);
     virtual HRESULT STDMETHODCALLTYPE setJavaScriptRuntimeFlags(unsigned);
+    virtual HRESULT STDMETHODCALLTYPE allowDisplayAndRunningOfInsecureContent(BOOL*);
+    virtual HRESULT STDMETHODCALLTYPE setAllowDisplayAndRunningOfInsecureContent(BOOL);
 
     // WebPreferences
 
index 7ca6c14..8d2f5dd 100644 (file)
@@ -5248,6 +5248,12 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
         return hr;
     settings.setEnableInheritURIQueryComponent(enabled);
 
+    hr = prefsPrivate->allowDisplayAndRunningOfInsecureContent(&enabled);
+    if (FAILED(hr))
+        return hr;
+    settings.setAllowDisplayOfInsecureContent(!!enabled);
+    settings.setAllowRunningOfInsecureContent(!!enabled);
+
     hr = prefsPrivate->javaScriptRuntimeFlags(&javaScriptRuntimeFlags);
     if (FAILED(hr))
         return hr;