mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Add WebContentsPreferences::IsNativeWindowOpenEnabled
This commit is contained in:
@@ -208,6 +208,21 @@ bool WebContentsPreferences::IsSandboxed(content::WebContents* web_contents) {
|
||||
return sandboxed;
|
||||
}
|
||||
|
||||
bool WebContentsPreferences::IsNativeWindowOpenEnabled(content::WebContents* web_contents) {
|
||||
WebContentsPreferences* self;
|
||||
if (!web_contents)
|
||||
return false;
|
||||
|
||||
self = FromWebContents(web_contents);
|
||||
if (!self)
|
||||
return false;
|
||||
|
||||
base::DictionaryValue& web_preferences = self->web_preferences_;
|
||||
bool use = false;
|
||||
web_preferences.GetBoolean("nativeWindowOpen", &use);
|
||||
return use;
|
||||
}
|
||||
|
||||
// static
|
||||
void WebContentsPreferences::OverrideWebkitPrefs(
|
||||
content::WebContents* web_contents, content::WebPreferences* prefs) {
|
||||
|
||||
@@ -38,6 +38,7 @@ class WebContentsPreferences
|
||||
content::WebContents* web_contents, base::CommandLine* command_line);
|
||||
|
||||
static bool IsSandboxed(content::WebContents* web_contents);
|
||||
static bool IsNativeWindowOpenEnabled(content::WebContents* web_contents);
|
||||
|
||||
// Modify the WebPreferences according to |web_contents|'s preferences.
|
||||
static void OverrideWebkitPrefs(
|
||||
|
||||
Reference in New Issue
Block a user