mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Support runtime configuration of renderer-related preferences (issue #1501).
- Persist modified user preferences including per-host zoom settings when a cache_path value is specified and persist_user_preferences is set to true via CefSettings or CefRequestContextSettings. - Avoid the need to duplicate files from chrome/ by having CefBrowserContext extend Chrome's Profile class.
This commit is contained in:
@@ -196,6 +196,11 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
|
||||
command_line->HasSwitch("proxy-pac-url") ||
|
||||
command_line->HasSwitch("proxy-server"));
|
||||
|
||||
// If allow running insecure content is enabled via the command-line then it
|
||||
// cannot be enabled via preferences.
|
||||
dict->SetBool("allow_running_insecure_content",
|
||||
command_line->HasSwitch("allow-running-insecure-content"));
|
||||
|
||||
// Serialize the state to JSON and return to the JavaScript caller.
|
||||
callback->Success(GetJSON(dict));
|
||||
}
|
||||
|
@@ -32,6 +32,12 @@
|
||||
<input type="checkbox" id="enable_spellchecking"/> Enable spell checking
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<br/>
|
||||
<input type="checkbox" id="allow_running_insecure_content"/> Allow running insecure content
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<br/>
|
||||
@@ -214,6 +220,19 @@
|
||||
response.browser.enable_spellchecking;
|
||||
}
|
||||
|
||||
// Web content settings.
|
||||
if (preferences_state.allow_running_insecure_content) {
|
||||
// Cannot disable running insecure content when enabled via the
|
||||
// command-line.
|
||||
document.getElementById("allow_running_insecure_content").checked =
|
||||
true;
|
||||
document.getElementById("allow_running_insecure_content").disabled =
|
||||
true;
|
||||
} else {
|
||||
document.getElementById("allow_running_insecure_content").checked =
|
||||
response.webkit.webprefs.allow_running_insecure_content;
|
||||
}
|
||||
|
||||
// Proxy settings.
|
||||
document.getElementById("proxy_type").value = response.proxy.mode;
|
||||
|
||||
@@ -252,6 +271,16 @@
|
||||
document.getElementById("enable_spellchecking").checked;
|
||||
}
|
||||
|
||||
// Web content settings.
|
||||
if (!preferences_state.allow_running_insecure_content) {
|
||||
has_preferences = true;
|
||||
|
||||
preferences.webkit = {};
|
||||
preferences.webkit.webprefs = {};
|
||||
preferences.webkit.webprefs.allow_running_insecure_content =
|
||||
document.getElementById("allow_running_insecure_content").checked;
|
||||
}
|
||||
|
||||
// Proxy settings.
|
||||
if (!preferences_state.proxy_configured) {
|
||||
has_preferences = true;
|
||||
|
Reference in New Issue
Block a user