Updated required code to handle missing additional features for popup windows

This commit is contained in:
Michael Vasseur 2016-09-15 15:37:35 +02:00 committed by Cheng Zhao
parent ef88a06f08
commit c811188e22
9 changed files with 35 additions and 17 deletions

View file

@ -525,6 +525,7 @@ void App::OnLogin(LoginHandler* login_handler,
void App::OnCreateWindow(const GURL& target_url,
const std::string& frame_name,
WindowOpenDisposition disposition,
const std::vector<base::string16>& features,
int render_process_id,
int render_frame_id) {
v8::Locker locker(isolate());
@ -535,7 +536,10 @@ void App::OnCreateWindow(const GURL& target_url,
content::WebContents::FromRenderFrameHost(rfh);
if (web_contents) {
auto api_web_contents = WebContents::CreateFrom(isolate(), web_contents);
api_web_contents->OnCreateWindow(target_url, frame_name, disposition);
api_web_contents->OnCreateWindow(target_url,
frame_name,
disposition,
features);
}
}

View file

@ -6,6 +6,7 @@
#define ATOM_BROWSER_API_ATOM_API_APP_H_
#include <string>
#include <vector>
#include "atom/browser/api/event_emitter.h"
#include "atom/browser/atom_browser_client.h"
@ -50,6 +51,7 @@ class App : public AtomBrowserClient::Delegate,
void OnCreateWindow(const GURL& target_url,
const std::string& frame_name,
WindowOpenDisposition disposition,
const std::vector<base::string16>& features,
int render_process_id,
int render_frame_id);

View file

@ -416,11 +416,12 @@ bool WebContents::AddMessageToConsole(content::WebContents* source,
void WebContents::OnCreateWindow(const GURL& target_url,
const std::string& frame_name,
WindowOpenDisposition disposition) {
WindowOpenDisposition disposition,
const std::vector<base::string16>& features) {
if (type_ == BROWSER_WINDOW || type_ == OFF_SCREEN)
Emit("-new-window", target_url, frame_name, disposition);
Emit("-new-window", target_url, frame_name, disposition, features);
else
Emit("new-window", target_url, frame_name, disposition);
Emit("new-window", target_url, frame_name, disposition, features);
}
void WebContents::WebContentsCreated(content::WebContents* source_contents,

View file

@ -178,7 +178,8 @@ class WebContents : public mate::TrackableObject<WebContents>,
// Create window with the given disposition.
void OnCreateWindow(const GURL& target_url,
const std::string& frame_name,
WindowOpenDisposition disposition);
WindowOpenDisposition disposition,
const std::vector<base::string16>& features);
// Returns the web preferences of current WebContents.
v8::Local<v8::Value> GetWebPreferences(v8::Isolate* isolate);

View file

@ -318,6 +318,7 @@ bool AtomBrowserClient::CanCreateWindow(
const content::Referrer& referrer,
WindowOpenDisposition disposition,
const blink::WebWindowFeatures& features,
const std::vector<base::string16>& additional_features,
bool user_gesture,
bool opener_suppressed,
content::ResourceContext* context,
@ -339,6 +340,7 @@ bool AtomBrowserClient::CanCreateWindow(
target_url,
frame_name,
disposition,
additional_features,
render_process_id,
opener_render_frame_id));
}

View file

@ -88,6 +88,7 @@ class AtomBrowserClient : public brightray::BrowserClient,
const content::Referrer& referrer,
WindowOpenDisposition disposition,
const blink::WebWindowFeatures& features,
const std::vector<base::string16>& additional_features,
bool user_gesture,
bool opener_suppressed,
content::ResourceContext* context,