adds offscreen renderer ipc message to disable external popups

This commit is contained in:
gellert 2017-04-11 14:19:34 +02:00 committed by Heilig Benedek
parent 6b33564056
commit 155fef99ae
4 changed files with 11 additions and 3 deletions

View file

@ -4,7 +4,7 @@
#include "atom/browser/osr/osr_web_contents_view.h"
#include "content/common/worker_messages.h"
#include "atom/common/api/api_messages.h"
#include "content/public/browser/render_view_host.h"
#include "third_party/WebKit/public/platform/WebScreenInfo.h"
#include "ui/display/screen.h"
@ -127,8 +127,7 @@ void OffScreenWebContentsView::RenderViewCreated(
GetView()->InstallTransparency();
#if defined(OS_MACOSX)
host->Send(new WorkerProcessMsg_DisableExternalPopupMenus(
host->GetRoutingID()));
host->Send(new AtomViewMsg_Offscreen(host->GetRoutingID()));
#endif
}

View file

@ -35,6 +35,8 @@ IPC_MESSAGE_ROUTED3(AtomViewMsg_Message,
base::string16 /* channel */,
base::ListValue /* arguments */)
IPC_MESSAGE_ROUTED0(AtomViewMsg_Offscreen)
// Sent by the renderer when the draggable regions are updated.
IPC_MESSAGE_ROUTED1(AtomViewHostMsg_UpdateDraggableRegions,
std::vector<atom::DraggableRegion> /* regions */)

View file

@ -136,6 +136,7 @@ bool AtomRenderViewObserver::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(AtomRenderViewObserver, message)
IPC_MESSAGE_HANDLER(AtomViewMsg_Message, OnBrowserMessage)
IPC_MESSAGE_HANDLER(AtomViewMsg_Offscreen, OnOffscreen)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@ -169,4 +170,8 @@ void AtomRenderViewObserver::OnBrowserMessage(bool send_to_all,
}
}
void AtomRenderViewObserver::OnOffscreen() {
blink::WebView::setUseExternalPopupMenus(false);
}
} // namespace atom

View file

@ -40,6 +40,8 @@ class AtomRenderViewObserver : public content::RenderViewObserver {
const base::string16& channel,
const base::ListValue& args);
void OnOffscreen();
AtomRendererClient* renderer_client_;
// Whether the document object has been created.