electron/atom/renderer/atom_render_view_observer.cc

38 lines
1 KiB
C++
Raw Normal View History

// Copyright (c) 2013 GitHub, Inc.
2014-04-25 09:49:37 +00:00
// Use of this source code is governed by the MIT license that can be
2013-04-12 01:46:58 +00:00
// found in the LICENSE file.
2014-03-16 00:30:26 +00:00
#include "atom/renderer/atom_render_view_observer.h"
2013-04-12 01:46:58 +00:00
#include "atom/common/api/api_messages.h"
2014-03-16 01:37:04 +00:00
#include "content/public/renderer/render_view.h"
#include "ipc/ipc_message_macros.h"
2014-01-30 14:47:21 +00:00
#include "third_party/WebKit/public/web/WebView.h"
2013-04-12 01:46:58 +00:00
namespace atom {
2018-03-09 09:31:09 +00:00
AtomRenderViewObserver::AtomRenderViewObserver(content::RenderView* render_view)
: content::RenderViewObserver(render_view) {}
2018-03-09 09:31:09 +00:00
AtomRenderViewObserver::~AtomRenderViewObserver() {}
2018-03-09 09:31:09 +00:00
bool AtomRenderViewObserver::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(AtomRenderViewObserver, message)
IPC_MESSAGE_HANDLER(AtomViewMsg_Offscreen, OnOffscreen)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
2018-03-09 09:31:09 +00:00
return handled;
}
2016-09-06 08:24:37 +00:00
void AtomRenderViewObserver::OnDestruct() {
delete this;
}
2018-03-09 09:31:09 +00:00
void AtomRenderViewObserver::OnOffscreen() {
blink::WebView::SetUseExternalPopupMenus(false);
}
2013-04-12 01:46:58 +00:00
} // namespace atom