Add WebContentsPreferences::IsNativeWindowOpenEnabled

This commit is contained in:
Ryohei Ikegami 2017-03-19 17:12:25 +09:00
parent a215e8fb82
commit f7935b429a
2 changed files with 16 additions and 0 deletions

View file

@ -208,6 +208,21 @@ bool WebContentsPreferences::IsSandboxed(content::WebContents* web_contents) {
return sandboxed; 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 // static
void WebContentsPreferences::OverrideWebkitPrefs( void WebContentsPreferences::OverrideWebkitPrefs(
content::WebContents* web_contents, content::WebPreferences* prefs) { content::WebContents* web_contents, content::WebPreferences* prefs) {

View file

@ -38,6 +38,7 @@ class WebContentsPreferences
content::WebContents* web_contents, base::CommandLine* command_line); content::WebContents* web_contents, base::CommandLine* command_line);
static bool IsSandboxed(content::WebContents* web_contents); static bool IsSandboxed(content::WebContents* web_contents);
static bool IsNativeWindowOpenEnabled(content::WebContents* web_contents);
// Modify the WebPreferences according to |web_contents|'s preferences. // Modify the WebPreferences according to |web_contents|'s preferences.
static void OverrideWebkitPrefs( static void OverrideWebkitPrefs(