api base
This commit is contained in:
parent
c45d9555e7
commit
0dbe4bc417
7 changed files with 188 additions and 216 deletions
|
@ -287,6 +287,9 @@ WebContents::WebContents(v8::Isolate* isolate,
|
|||
type_ = WEB_VIEW;
|
||||
else if (options.Get("isBackgroundPage", &b) && b)
|
||||
type_ = BACKGROUND_PAGE;
|
||||
|
||||
bool offscreen = false;
|
||||
options.Get("offScreen", &offscreen);
|
||||
|
||||
// Obtain the session.
|
||||
std::string partition;
|
||||
|
@ -310,8 +313,8 @@ WebContents::WebContents(v8::Isolate* isolate,
|
|||
guest_delegate_.reset(new WebViewGuestDelegate);
|
||||
params.guest_delegate = guest_delegate_.get();
|
||||
web_contents = content::WebContents::Create(params);
|
||||
} else {
|
||||
content::WebContents::CreateParams params(session->browser_context());
|
||||
} else if(offscreen) {
|
||||
content::WebContents::CreateParams params(session->browser_context());
|
||||
|
||||
auto view = new OffScreenWebContentsView();
|
||||
params.view = view;
|
||||
|
@ -319,6 +322,9 @@ WebContents::WebContents(v8::Isolate* isolate,
|
|||
|
||||
web_contents = content::WebContents::Create(params);
|
||||
view->SetWebContents(web_contents);
|
||||
} else {
|
||||
content::WebContents::CreateParams params(session->browser_context());
|
||||
web_contents = content::WebContents::Create(params);
|
||||
}
|
||||
|
||||
Observe(web_contents);
|
||||
|
|
|
@ -74,14 +74,6 @@ Window::Window(v8::Isolate* isolate, const mate::Dictionary& options) {
|
|||
mate::Dictionary web_preferences = mate::Dictionary::CreateEmpty(isolate);
|
||||
options.Get(options::kWebPreferences, &web_preferences);
|
||||
|
||||
bool b;
|
||||
if (options.Get("disableGPU", &b) && b) {
|
||||
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
||||
|
||||
command_line->AppendSwitch(::switches::kDisableGpu);
|
||||
command_line->AppendSwitch(::switches::kDisableGpuCompositing);
|
||||
}
|
||||
|
||||
// Copy the backgroundColor to webContents.
|
||||
v8::Local<v8::Value> value;
|
||||
if (options.Get(options::kBackgroundColor, &value))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue