Merge remote-tracking branch 'origin/chromium-upgrade/72'
This commit is contained in:
commit
f3e30c7ae3
178 changed files with 2102 additions and 1734 deletions
|
@ -30,7 +30,7 @@
|
|||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/sys_info.h"
|
||||
#include "base/system/sys_info.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/icon_manager.h"
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
|
@ -780,24 +780,24 @@ void App::OnGpuProcessCrashed(base::TerminationStatus status) {
|
|||
|
||||
void App::BrowserChildProcessLaunchedAndConnected(
|
||||
const content::ChildProcessData& data) {
|
||||
ChildProcessLaunched(data.process_type, data.GetHandle());
|
||||
ChildProcessLaunched(data.process_type, data.GetProcess().Handle());
|
||||
}
|
||||
|
||||
void App::BrowserChildProcessHostDisconnected(
|
||||
const content::ChildProcessData& data) {
|
||||
ChildProcessDisconnected(base::GetProcId(data.GetHandle()));
|
||||
ChildProcessDisconnected(base::GetProcId(data.GetProcess().Handle()));
|
||||
}
|
||||
|
||||
void App::BrowserChildProcessCrashed(
|
||||
const content::ChildProcessData& data,
|
||||
const content::ChildProcessTerminationInfo& info) {
|
||||
ChildProcessDisconnected(base::GetProcId(data.GetHandle()));
|
||||
ChildProcessDisconnected(base::GetProcId(data.GetProcess().Handle()));
|
||||
}
|
||||
|
||||
void App::BrowserChildProcessKilled(
|
||||
const content::ChildProcessData& data,
|
||||
const content::ChildProcessTerminationInfo& info) {
|
||||
ChildProcessDisconnected(base::GetProcId(data.GetHandle()));
|
||||
ChildProcessDisconnected(base::GetProcId(data.GetProcess().Handle()));
|
||||
}
|
||||
|
||||
void App::RenderProcessReady(content::RenderProcessHost* host) {
|
||||
|
@ -1387,7 +1387,9 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
void* priv) {
|
||||
v8::Isolate* isolate = context->GetIsolate();
|
||||
mate::Dictionary dict(isolate, exports);
|
||||
dict.Set("App", atom::api::App::GetConstructor(isolate)->GetFunction());
|
||||
dict.Set("App", atom::api::App::GetConstructor(isolate)
|
||||
->GetFunction(context)
|
||||
.ToLocalChecked());
|
||||
dict.Set("app", atom::api::App::Create(isolate));
|
||||
#if defined(OS_MACOSX)
|
||||
auto browser = base::Unretained(Browser::Get());
|
||||
|
|
|
@ -147,7 +147,9 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Isolate* isolate = context->GetIsolate();
|
||||
mate::Dictionary dict(isolate, exports);
|
||||
dict.Set("autoUpdater", AutoUpdater::Create(isolate));
|
||||
dict.Set("AutoUpdater", AutoUpdater::GetConstructor(isolate)->GetFunction());
|
||||
dict.Set("AutoUpdater", AutoUpdater::GetConstructor(isolate)
|
||||
->GetFunction(context)
|
||||
.ToLocalChecked());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -159,8 +159,9 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Isolate* isolate = context->GetIsolate();
|
||||
BrowserView::SetConstructor(isolate, base::Bind(&BrowserView::New));
|
||||
|
||||
mate::Dictionary browser_view(
|
||||
isolate, BrowserView::GetConstructor(isolate)->GetFunction());
|
||||
mate::Dictionary browser_view(isolate, BrowserView::GetConstructor(isolate)
|
||||
->GetFunction(context)
|
||||
.ToLocalChecked());
|
||||
browser_view.SetMethod("fromId",
|
||||
&mate::TrackableObject<BrowserView>::FromWeakMapID);
|
||||
browser_view.SetMethod("getAllViews",
|
||||
|
|
|
@ -59,8 +59,9 @@ void BrowserWindow::OverrideNSWindowContentView(InspectableWebContents* iwc) {
|
|||
// Make NativeWindow use a NSView as content view.
|
||||
static_cast<NativeWindowMac*>(window())->OverrideNSWindowContentView();
|
||||
// Add webview to contentView.
|
||||
NSView* webView = iwc->GetView()->GetNativeView();
|
||||
NSView* contentView = [window()->GetNativeWindow() contentView];
|
||||
NSView* webView = iwc->GetView()->GetNativeView().GetNativeNSView();
|
||||
NSView* contentView =
|
||||
[window()->GetNativeWindow().GetNativeNSWindow() contentView];
|
||||
[webView setFrame:[contentView bounds]];
|
||||
|
||||
// ensure that buttons view is floated to top of view hierarchy
|
||||
|
@ -80,7 +81,7 @@ void BrowserWindow::UpdateDraggableRegions(
|
|||
// All ControlRegionViews should be added as children of the WebContentsView,
|
||||
// because WebContentsView will be removed and re-added when entering and
|
||||
// leaving fullscreen mode.
|
||||
NSView* webView = web_contents()->GetNativeView();
|
||||
NSView* webView = web_contents()->GetNativeView().GetNativeNSView();
|
||||
NSInteger webViewWidth = NSWidth([webView bounds]);
|
||||
NSInteger webViewHeight = NSHeight([webView bounds]);
|
||||
|
||||
|
|
|
@ -194,7 +194,9 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
void* priv) {
|
||||
v8::Isolate* isolate = context->GetIsolate();
|
||||
mate::Dictionary(isolate, exports)
|
||||
.Set("Debugger", Debugger::GetConstructor(isolate)->GetFunction());
|
||||
.Set("Debugger", Debugger::GetConstructor(isolate)
|
||||
->GetFunction(context)
|
||||
.ToLocalChecked());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -244,8 +244,9 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
void* priv) {
|
||||
v8::Isolate* isolate = context->GetIsolate();
|
||||
mate::Dictionary(isolate, exports)
|
||||
.Set("DownloadItem",
|
||||
atom::api::DownloadItem::GetConstructor(isolate)->GetFunction());
|
||||
.Set("DownloadItem", atom::api::DownloadItem::GetConstructor(isolate)
|
||||
->GetFunction(context)
|
||||
.ToLocalChecked());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -132,8 +132,9 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Isolate* isolate = context->GetIsolate();
|
||||
mate::Dictionary dict(isolate, exports);
|
||||
dict.Set("inAppPurchase", InAppPurchase::Create(isolate));
|
||||
dict.Set("InAppPurchase",
|
||||
InAppPurchase::GetConstructor(isolate)->GetFunction());
|
||||
dict.Set("InAppPurchase", InAppPurchase::GetConstructor(isolate)
|
||||
->GetFunction(context)
|
||||
.ToLocalChecked());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -233,7 +233,9 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
Menu::SetConstructor(isolate, base::Bind(&Menu::New));
|
||||
|
||||
mate::Dictionary dict(isolate, exports);
|
||||
dict.Set("Menu", Menu::GetConstructor(isolate)->GetFunction());
|
||||
dict.Set(
|
||||
"Menu",
|
||||
Menu::GetConstructor(isolate)->GetFunction(context).ToLocalChecked());
|
||||
#if defined(OS_MACOSX)
|
||||
dict.SetMethod("setApplicationMenu", &Menu::SetApplicationMenu);
|
||||
dict.SetMethod("sendActionToFirstResponder",
|
||||
|
|
|
@ -56,7 +56,7 @@ void MenuMac::PopupOnUI(const base::WeakPtr<NativeWindow>& native_window,
|
|||
base::Closure callback) {
|
||||
if (!native_window)
|
||||
return;
|
||||
NSWindow* nswindow = native_window->GetNativeWindow();
|
||||
NSWindow* nswindow = native_window->GetNativeWindow().GetNativeNSWindow();
|
||||
|
||||
auto close_callback = base::Bind(
|
||||
&MenuMac::OnClosed, weak_factory_.GetWeakPtr(), window_id, callback);
|
||||
|
@ -99,7 +99,7 @@ void MenuMac::PopupOnUI(const base::WeakPtr<NativeWindow>& native_window,
|
|||
|
||||
[popup_controllers_[window_id] setCloseCallback:close_callback];
|
||||
// Make sure events can be pumped while the menu is up.
|
||||
base::MessageLoop::ScopedNestableTaskAllower allow;
|
||||
base::MessageLoopCurrent::ScopedNestableTaskAllower allow;
|
||||
|
||||
// One of the events that could be pumped is |window.close()|.
|
||||
// User-initiated event-tracking loops protect against this by
|
||||
|
|
|
@ -31,7 +31,9 @@ void Net::BuildPrototype(v8::Isolate* isolate,
|
|||
}
|
||||
|
||||
v8::Local<v8::Value> Net::URLRequest(v8::Isolate* isolate) {
|
||||
return URLRequest::GetConstructor(isolate)->GetFunction();
|
||||
return URLRequest::GetConstructor(isolate)
|
||||
->GetFunction(isolate->GetCurrentContext())
|
||||
.ToLocalChecked();
|
||||
}
|
||||
|
||||
} // namespace api
|
||||
|
@ -53,7 +55,8 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
|
||||
mate::Dictionary dict(isolate, exports);
|
||||
dict.Set("net", Net::Create(isolate));
|
||||
dict.Set("Net", Net::GetConstructor(isolate)->GetFunction());
|
||||
dict.Set("Net",
|
||||
Net::GetConstructor(isolate)->GetFunction(context).ToLocalChecked());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -263,8 +263,9 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
Notification::SetConstructor(isolate, base::Bind(&Notification::New));
|
||||
|
||||
mate::Dictionary dict(isolate, exports);
|
||||
dict.Set("Notification",
|
||||
Notification::GetConstructor(isolate)->GetFunction());
|
||||
dict.Set("Notification", Notification::GetConstructor(isolate)
|
||||
->GetFunction(context)
|
||||
.ToLocalChecked());
|
||||
|
||||
dict.SetMethod("isSupported", &Notification::IsSupported);
|
||||
}
|
||||
|
|
|
@ -141,8 +141,9 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Isolate* isolate = context->GetIsolate();
|
||||
mate::Dictionary dict(isolate, exports);
|
||||
dict.Set("powerMonitor", PowerMonitor::Create(isolate));
|
||||
dict.Set("PowerMonitor",
|
||||
PowerMonitor::GetConstructor(isolate)->GetFunction());
|
||||
dict.Set("PowerMonitor", PowerMonitor::GetConstructor(isolate)
|
||||
->GetFunction(context)
|
||||
.ToLocalChecked());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -164,7 +164,9 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Isolate* isolate = context->GetIsolate();
|
||||
mate::Dictionary dict(isolate, exports);
|
||||
dict.Set("screen", Screen::Create(isolate));
|
||||
dict.Set("Screen", Screen::GetConstructor(isolate)->GetFunction());
|
||||
dict.Set(
|
||||
"Screen",
|
||||
Screen::GetConstructor(isolate)->GetFunction(context).ToLocalChecked());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -444,10 +444,9 @@ void Session::ClearStorageData(mate::Arguments* args) {
|
|||
// https://w3c.github.io/mediacapture-main/#dom-mediadeviceinfo-deviceid
|
||||
MediaDeviceIDSalt::Reset(browser_context()->prefs());
|
||||
}
|
||||
storage_partition->ClearData(
|
||||
options.storage_types, options.quota_types, options.origin,
|
||||
content::StoragePartition::OriginMatcherFunction(), base::Time(),
|
||||
base::Time::Max(), base::Bind(&OnClearStorageDataDone, callback));
|
||||
storage_partition->ClearData(options.storage_types, options.quota_types,
|
||||
options.origin, base::Time(), base::Time::Max(),
|
||||
base::Bind(&OnClearStorageDataDone, callback));
|
||||
}
|
||||
|
||||
void Session::FlushStorageData() {
|
||||
|
@ -805,8 +804,12 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
void* priv) {
|
||||
v8::Isolate* isolate = context->GetIsolate();
|
||||
mate::Dictionary dict(isolate, exports);
|
||||
dict.Set("Session", Session::GetConstructor(isolate)->GetFunction());
|
||||
dict.Set("Cookies", Cookies::GetConstructor(isolate)->GetFunction());
|
||||
dict.Set(
|
||||
"Session",
|
||||
Session::GetConstructor(isolate)->GetFunction(context).ToLocalChecked());
|
||||
dict.Set(
|
||||
"Cookies",
|
||||
Cookies::GetConstructor(isolate)->GetFunction(context).ToLocalChecked());
|
||||
dict.SetMethod("fromPartition", &FromPartition);
|
||||
}
|
||||
|
||||
|
|
|
@ -121,8 +121,9 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Isolate* isolate = context->GetIsolate();
|
||||
mate::Dictionary dict(isolate, exports);
|
||||
dict.Set("systemPreferences", SystemPreferences::Create(isolate));
|
||||
dict.Set("SystemPreferences",
|
||||
SystemPreferences::GetConstructor(isolate)->GetFunction());
|
||||
dict.Set("SystemPreferences", SystemPreferences::GetConstructor(isolate)
|
||||
->GetFunction(context)
|
||||
.ToLocalChecked());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -1179,8 +1179,9 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Isolate* isolate = context->GetIsolate();
|
||||
TopLevelWindow::SetConstructor(isolate, base::Bind(&TopLevelWindow::New));
|
||||
|
||||
mate::Dictionary constructor(
|
||||
isolate, TopLevelWindow::GetConstructor(isolate)->GetFunction());
|
||||
mate::Dictionary constructor(isolate, TopLevelWindow::GetConstructor(isolate)
|
||||
->GetFunction(context)
|
||||
.ToLocalChecked());
|
||||
constructor.SetMethod("fromId",
|
||||
&mate::TrackableObject<TopLevelWindow>::FromWeakMapID);
|
||||
constructor.SetMethod("getAllWindows",
|
||||
|
|
|
@ -254,7 +254,9 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
Tray::SetConstructor(isolate, base::Bind(&Tray::New));
|
||||
|
||||
mate::Dictionary dict(isolate, exports);
|
||||
dict.Set("Tray", Tray::GetConstructor(isolate)->GetFunction());
|
||||
dict.Set(
|
||||
"Tray",
|
||||
Tray::GetConstructor(isolate)->GetFunction(context).ToLocalChecked());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -76,8 +76,9 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Isolate* isolate = context->GetIsolate();
|
||||
View::SetConstructor(isolate, base::Bind(&View::New));
|
||||
|
||||
mate::Dictionary constructor(isolate,
|
||||
View::GetConstructor(isolate)->GetFunction());
|
||||
mate::Dictionary constructor(
|
||||
isolate,
|
||||
View::GetConstructor(isolate)->GetFunction(context).ToLocalChecked());
|
||||
|
||||
mate::Dictionary dict(isolate, exports);
|
||||
dict.Set("View", constructor);
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#include "atom/common/native_mate_converters/value_converter.h"
|
||||
#include "atom/common/options_switches.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
#include "base/threading/thread_task_runner_handle.h"
|
||||
|
@ -240,7 +241,7 @@ namespace api {
|
|||
namespace {
|
||||
|
||||
content::ServiceWorkerContext* GetServiceWorkerContext(
|
||||
const content::WebContents* web_contents) {
|
||||
content::WebContents* web_contents) {
|
||||
auto* context = web_contents->GetBrowserContext();
|
||||
auto* site_instance = web_contents->GetSiteInstance();
|
||||
if (!context || !site_instance)
|
||||
|
@ -421,15 +422,14 @@ void WebContents::InitWithSessionAndOptions(
|
|||
|
||||
#if defined(OS_LINUX) || defined(OS_WIN)
|
||||
// Update font settings.
|
||||
CR_DEFINE_STATIC_LOCAL(
|
||||
const gfx::FontRenderParams, params,
|
||||
(gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr)));
|
||||
prefs->should_antialias_text = params.antialiasing;
|
||||
prefs->use_subpixel_positioning = params.subpixel_positioning;
|
||||
prefs->hinting = params.hinting;
|
||||
prefs->use_autohinter = params.autohinter;
|
||||
prefs->use_bitmaps = params.use_bitmaps;
|
||||
prefs->subpixel_rendering = params.subpixel_rendering;
|
||||
static const base::NoDestructor<gfx::FontRenderParams> params(
|
||||
gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr));
|
||||
prefs->should_antialias_text = params->antialiasing;
|
||||
prefs->use_subpixel_positioning = params->subpixel_positioning;
|
||||
prefs->hinting = params->hinting;
|
||||
prefs->use_autohinter = params->autohinter;
|
||||
prefs->use_bitmaps = params->use_bitmaps;
|
||||
prefs->subpixel_rendering = params->subpixel_rendering;
|
||||
#endif
|
||||
|
||||
// Save the preferences in C++.
|
||||
|
@ -470,9 +470,9 @@ WebContents::~WebContents() {
|
|||
RenderViewDeleted(web_contents()->GetRenderViewHost());
|
||||
|
||||
if (type_ == WEB_VIEW) {
|
||||
DCHECK(!web_contents()->GetOuterWebContents())
|
||||
<< "Should never manually destroy an attached webview";
|
||||
// For webview simply destroy the WebContents immediately.
|
||||
// TODO(zcbenz): Add an internal API for webview instead of using
|
||||
// destroy(), so we don't have to add a special branch here.
|
||||
DestroyWebContents(false /* async */);
|
||||
} else if (type_ == BROWSER_WINDOW && owner_window()) {
|
||||
// For BrowserWindow we should close the window and clean up everything
|
||||
|
@ -617,15 +617,15 @@ void WebContents::UpdateTargetURL(content::WebContents* source,
|
|||
Emit("update-target-url", url);
|
||||
}
|
||||
|
||||
void WebContents::HandleKeyboardEvent(
|
||||
bool WebContents::HandleKeyboardEvent(
|
||||
content::WebContents* source,
|
||||
const content::NativeWebKeyboardEvent& event) {
|
||||
if (type_ == WEB_VIEW && embedder_) {
|
||||
// Send the unhandled keyboard events back to the embedder.
|
||||
embedder_->HandleKeyboardEvent(source, event);
|
||||
return embedder_->HandleKeyboardEvent(source, event);
|
||||
} else {
|
||||
// Go to the default keyboard handling.
|
||||
CommonWebContentsDelegate::HandleKeyboardEvent(source, event);
|
||||
return CommonWebContentsDelegate::HandleKeyboardEvent(source, event);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1129,7 +1129,7 @@ void WebContents::NavigationEntryCommitted(
|
|||
void WebContents::SetBackgroundThrottling(bool allowed) {
|
||||
background_throttling_ = allowed;
|
||||
|
||||
const auto* contents = web_contents();
|
||||
auto* contents = web_contents();
|
||||
if (!contents) {
|
||||
return;
|
||||
}
|
||||
|
@ -1188,8 +1188,9 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
|
|||
if (!options.Get("httpReferrer", ¶ms.referrer)) {
|
||||
GURL http_referrer;
|
||||
if (options.Get("httpReferrer", &http_referrer))
|
||||
params.referrer = content::Referrer(http_referrer.GetAsReferrer(),
|
||||
blink::kWebReferrerPolicyDefault);
|
||||
params.referrer =
|
||||
content::Referrer(http_referrer.GetAsReferrer(),
|
||||
network::mojom::ReferrerPolicy::kDefault);
|
||||
}
|
||||
|
||||
std::string user_agent;
|
||||
|
@ -1793,7 +1794,7 @@ void WebContents::StartDrag(const mate::Dictionary& item,
|
|||
|
||||
// Start dragging.
|
||||
if (!files.empty()) {
|
||||
base::MessageLoop::ScopedNestableTaskAllower allow;
|
||||
base::MessageLoopCurrent::ScopedNestableTaskAllower allow;
|
||||
DragFileItems(files, icon->image(), web_contents()->GetNativeView());
|
||||
} else {
|
||||
args->ThrowError("Must specify either 'file' or 'files' option");
|
||||
|
@ -2149,6 +2150,7 @@ void WebContents::BuildPrototype(v8::Isolate* isolate,
|
|||
.SetMethod("startDrag", &WebContents::StartDrag)
|
||||
.SetMethod("isGuest", &WebContents::IsGuest)
|
||||
.SetMethod("attachToIframe", &WebContents::AttachToIframe)
|
||||
.SetMethod("detachFromOuterFrame", &WebContents::DetachFromOuterFrame)
|
||||
.SetMethod("isOffscreen", &WebContents::IsOffScreen)
|
||||
#if BUILDFLAG(ENABLE_OSR)
|
||||
.SetMethod("startPainting", &WebContents::StartPainting)
|
||||
|
@ -2284,7 +2286,9 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
void* priv) {
|
||||
v8::Isolate* isolate = context->GetIsolate();
|
||||
mate::Dictionary dict(isolate, exports);
|
||||
dict.Set("WebContents", WebContents::GetConstructor(isolate)->GetFunction());
|
||||
dict.Set("WebContents", WebContents::GetConstructor(isolate)
|
||||
->GetFunction(context)
|
||||
.ToLocalChecked());
|
||||
dict.SetMethod("create", &WebContents::Create);
|
||||
dict.SetMethod("fromId", &mate::TrackableObject<WebContents>::FromWeakMapID);
|
||||
dict.SetMethod("getAllWebContents",
|
||||
|
|
|
@ -242,6 +242,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
|||
bool IsGuest() const;
|
||||
void AttachToIframe(content::WebContents* embedder_web_contents,
|
||||
int embedder_frame_id);
|
||||
void DetachFromOuterFrame();
|
||||
|
||||
// Methods for offscreen rendering
|
||||
bool IsOffScreen() const;
|
||||
|
@ -362,7 +363,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
|||
void CloseContents(content::WebContents* source) override;
|
||||
void ActivateContents(content::WebContents* contents) override;
|
||||
void UpdateTargetURL(content::WebContents* source, const GURL& url) override;
|
||||
void HandleKeyboardEvent(
|
||||
bool HandleKeyboardEvent(
|
||||
content::WebContents* source,
|
||||
const content::NativeWebKeyboardEvent& event) override;
|
||||
content::KeyboardEventProcessingResult PreHandleKeyboardEvent(
|
||||
|
|
|
@ -4,9 +4,12 @@
|
|||
|
||||
#include "atom/browser/api/atom_api_web_contents.h"
|
||||
|
||||
#include "content/browser/web_contents/web_contents_impl.h"
|
||||
|
||||
#if BUILDFLAG(ENABLE_OSR)
|
||||
#include "atom/browser/osr/osr_render_widget_host_view.h"
|
||||
#include "atom/browser/osr/osr_web_contents_view.h"
|
||||
#include "content/browser/web_contents/web_contents_impl.h"
|
||||
#endif
|
||||
|
||||
// Including both web_contents_impl.h and node.h would introduce a error, we
|
||||
// have to isolate the usage of WebContentsImpl into a clean file to fix it:
|
||||
|
@ -16,6 +19,13 @@ namespace atom {
|
|||
|
||||
namespace api {
|
||||
|
||||
void WebContents::DetachFromOuterFrame() {
|
||||
// See detach_webview_frame.patch on how to detach.
|
||||
auto* impl = static_cast<content::WebContentsImpl*>(web_contents());
|
||||
impl->GetRenderManagerForTesting()->RemoveOuterDelegateFrame();
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_OSR)
|
||||
OffScreenWebContentsView* WebContents::GetOffScreenWebContentsView() const {
|
||||
if (IsOffScreen()) {
|
||||
const auto* impl =
|
||||
|
@ -35,6 +45,7 @@ OffScreenRenderWidgetHostView* WebContents::GetOffScreenRenderWidgetHostView()
|
|||
return nullptr;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace api
|
||||
|
|
@ -17,7 +17,7 @@ bool WebContents::IsFocused() const {
|
|||
return false;
|
||||
|
||||
if (GetType() != BACKGROUND_PAGE) {
|
||||
auto window = [web_contents()->GetNativeView() window];
|
||||
auto window = [web_contents()->GetNativeView().GetNativeNSView() window];
|
||||
// On Mac the render widget host view does not lose focus when the window
|
||||
// loses focus so check if the top level window is the key window.
|
||||
if (window && ![window isKeyWindow])
|
||||
|
|
|
@ -35,7 +35,8 @@ v8::Local<v8::Object> CreateEventObject(v8::Isolate* isolate) {
|
|||
}
|
||||
|
||||
return v8::Local<v8::ObjectTemplate>::New(isolate, event_template)
|
||||
->NewInstance();
|
||||
->NewInstance(isolate->GetCurrentContext())
|
||||
.ToLocalChecked();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue