Use native window.open implementation

This commit is contained in:
Ryohei Ikegami 2017-03-19 17:41:20 +09:00
parent 054ba7a964
commit a1f9a45276
7 changed files with 22 additions and 15 deletions

View file

@ -142,7 +142,7 @@ void AtomBrowserClient::RenderProcessWillLaunch(
content::WebContents* web_contents = GetWebContentsFromProcessID(process_id);
ProcessPreferences process_prefs;
process_prefs.sandbox = WebContentsPreferences::IsSandboxed(web_contents);
process_prefs.native_window_open = WebContentsPreferences::IsNativeWindowOpenEnabled(web_contents);
process_prefs.native_window_open = WebContentsPreferences::UsesNativeWindowOpen(web_contents);
AddProcessPreferences(host->GetID(), process_prefs);
// ensure the ProcessPreferences is removed later
host->AddObserver(this);

View file

@ -102,6 +102,8 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches(
// integration.
if (IsSandboxed(web_contents))
command_line->AppendSwitch(switches::kEnableSandbox);
if (UsesNativeWindowOpen(web_contents))
command_line->AppendSwitch(switches::kNativeWindowOpen);
// The preload script.
base::FilePath::StringType preload;
@ -208,7 +210,7 @@ bool WebContentsPreferences::IsSandboxed(content::WebContents* web_contents) {
return sandboxed;
}
bool WebContentsPreferences::IsNativeWindowOpenEnabled(content::WebContents* web_contents) {
bool WebContentsPreferences::UsesNativeWindowOpen(content::WebContents* web_contents) {
WebContentsPreferences* self;
if (!web_contents)
return false;

View file

@ -38,7 +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);
static bool UsesNativeWindowOpen(content::WebContents* web_contents);
// Modify the WebPreferences according to |web_contents|'s preferences.
static void OverrideWebkitPrefs(

View file

@ -163,6 +163,7 @@ const char kGuestInstanceID[] = "guest-instance-id";
const char kOpenerID[] = "opener-id";
const char kScrollBounce[] = "scroll-bounce";
const char kHiddenPage[] = "hidden-page";
const char kNativeWindowOpen[] = "native-window-open";
// Widevine options
// Path to Widevine CDM binaries.

View file

@ -89,6 +89,7 @@ extern const char kGuestInstanceID[];
extern const char kOpenerID[];
extern const char kScrollBounce[];
extern const char kHiddenPage[];
extern const char kNativeWindowOpen[];
extern const char kWidevineCdmPath[];
extern const char kWidevineCdmVersion[];