2014-10-31 18:17:05 +00:00
|
|
|
// 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
|
|
|
|
2015-06-23 12:14:03 +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) {}
|
2015-01-24 04:43:38 +00:00
|
|
|
|
2018-04-18 01:55:30 +00:00
|
|
|
AtomRenderViewObserver::~AtomRenderViewObserver() {}
|
2016-08-20 15:01:26 +00:00
|
|
|
|
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()
|
2016-08-20 15:01:26 +00:00
|
|
|
|
2018-03-09 09:31:09 +00:00
|
|
|
return handled;
|
2016-08-20 15:01:26 +00:00
|
|
|
}
|
|
|
|
|
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
|