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:58:59 +00:00
|
|
|
#ifndef ATOM_RENDERER_ATOM_RENDER_VIEW_OBSERVER_H_
|
|
|
|
#define ATOM_RENDERER_ATOM_RENDER_VIEW_OBSERVER_H_
|
2013-04-12 01:46:58 +00:00
|
|
|
|
2014-09-01 07:36:37 +00:00
|
|
|
#include "base/strings/string16.h"
|
2013-04-12 01:46:58 +00:00
|
|
|
#include "content/public/renderer/render_view_observer.h"
|
2017-08-21 23:09:28 +00:00
|
|
|
#include "third_party/WebKit/public/web/WebLocalFrame.h"
|
2013-04-12 01:46:58 +00:00
|
|
|
|
2013-04-23 04:18:07 +00:00
|
|
|
namespace base {
|
|
|
|
class ListValue;
|
|
|
|
}
|
|
|
|
|
2013-04-12 01:46:58 +00:00
|
|
|
namespace atom {
|
|
|
|
|
2013-04-20 03:13:06 +00:00
|
|
|
class AtomRendererClient;
|
|
|
|
|
2013-12-23 14:08:45 +00:00
|
|
|
class AtomRenderViewObserver : public content::RenderViewObserver {
|
2013-04-12 15:16:16 +00:00
|
|
|
public:
|
2013-04-20 03:13:06 +00:00
|
|
|
explicit AtomRenderViewObserver(content::RenderView* render_view,
|
|
|
|
AtomRendererClient* renderer_client);
|
2013-04-12 01:46:58 +00:00
|
|
|
|
2013-04-20 06:03:55 +00:00
|
|
|
protected:
|
2013-04-12 15:16:16 +00:00
|
|
|
virtual ~AtomRenderViewObserver();
|
2013-04-12 01:46:58 +00:00
|
|
|
|
2017-08-21 23:09:28 +00:00
|
|
|
virtual void EmitIPCEvent(blink::WebLocalFrame* frame,
|
2016-08-20 15:01:26 +00:00
|
|
|
const base::string16& channel,
|
|
|
|
const base::ListValue& args);
|
|
|
|
|
2013-04-20 06:03:55 +00:00
|
|
|
private:
|
2013-04-23 04:18:07 +00:00
|
|
|
// content::RenderViewObserver implementation.
|
2015-01-10 01:24:36 +00:00
|
|
|
bool OnMessageReceived(const IPC::Message& message) override;
|
2016-09-06 08:24:37 +00:00
|
|
|
void OnDestruct() override;
|
2013-04-23 04:18:07 +00:00
|
|
|
|
2016-05-27 07:58:49 +00:00
|
|
|
void OnBrowserMessage(bool send_to_all,
|
|
|
|
const base::string16& channel,
|
2013-04-23 12:57:14 +00:00
|
|
|
const base::ListValue& args);
|
2013-04-23 04:18:07 +00:00
|
|
|
|
2017-04-11 12:19:34 +00:00
|
|
|
void OnOffscreen();
|
|
|
|
|
2016-12-09 00:58:27 +00:00
|
|
|
AtomRendererClient* renderer_client_;
|
|
|
|
|
2013-04-12 01:46:58 +00:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(AtomRenderViewObserver);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace atom
|
|
|
|
|
2014-03-16 00:58:59 +00:00
|
|
|
#endif // ATOM_RENDERER_ATOM_RENDER_VIEW_OBSERVER_H_
|