2014-04-04 16:50:38 +00:00
|
|
|
// Copyright 2014 The Chromium Embedded Framework Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be found
|
|
|
|
// in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef LIBCEF_RENDERER_RENDER_FRAME_OBSERVER_H_
|
|
|
|
#define LIBCEF_RENDERER_RENDER_FRAME_OBSERVER_H_
|
|
|
|
|
|
|
|
#include "content/public/renderer/render_frame_observer.h"
|
|
|
|
|
2021-05-14 12:58:55 -04:00
|
|
|
#include "services/service_manager/public/cpp/binder_registry.h"
|
|
|
|
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
|
|
|
|
|
2014-04-04 16:50:38 +00:00
|
|
|
namespace content {
|
|
|
|
class RenderFrame;
|
2019-07-16 13:59:21 -04:00
|
|
|
class RenderView;
|
|
|
|
} // namespace content
|
2014-04-04 16:50:38 +00:00
|
|
|
|
2019-05-24 23:23:43 +03:00
|
|
|
class CefFrameImpl;
|
|
|
|
|
2014-04-04 16:50:38 +00:00
|
|
|
class CefRenderFrameObserver : public content::RenderFrameObserver {
|
|
|
|
public:
|
|
|
|
explicit CefRenderFrameObserver(content::RenderFrame* render_frame);
|
2021-12-06 15:40:25 -05:00
|
|
|
|
|
|
|
CefRenderFrameObserver(const CefRenderFrameObserver&) = delete;
|
|
|
|
CefRenderFrameObserver& operator=(const CefRenderFrameObserver&) = delete;
|
|
|
|
|
2014-11-12 19:25:15 +00:00
|
|
|
~CefRenderFrameObserver() override;
|
2014-04-04 16:50:38 +00:00
|
|
|
|
2017-05-31 17:33:30 +02:00
|
|
|
// RenderFrameObserver methods:
|
2022-02-10 16:52:36 -05:00
|
|
|
void WasShown() override;
|
2020-07-08 13:23:29 -04:00
|
|
|
void DidCommitProvisionalLoad(ui::PageTransition transition) override;
|
2019-11-12 11:11:44 -05:00
|
|
|
void DidFailProvisionalLoad() override;
|
2017-05-31 17:33:30 +02:00
|
|
|
void DidFinishLoad() override;
|
2020-08-28 18:39:23 -04:00
|
|
|
void WillDetach() override;
|
2019-07-16 13:59:21 -04:00
|
|
|
void FocusedElementChanged(const blink::WebElement& element) override;
|
2017-07-26 19:19:27 -04:00
|
|
|
void DraggableRegionsChanged() override;
|
2015-04-20 14:11:11 +03:00
|
|
|
void DidCreateScriptContext(v8::Handle<v8::Context> context,
|
|
|
|
int world_id) override;
|
2014-11-12 19:25:15 +00:00
|
|
|
void WillReleaseScriptContext(v8::Handle<v8::Context> context,
|
|
|
|
int world_id) override;
|
2016-06-20 18:59:23 -04:00
|
|
|
void OnDestruct() override;
|
2021-05-14 12:58:55 -04:00
|
|
|
void OnInterfaceRequestForFrame(
|
|
|
|
const std::string& interface_name,
|
|
|
|
mojo::ScopedMessagePipeHandle* interface_pipe) override;
|
|
|
|
bool OnAssociatedInterfaceRequestForFrame(
|
|
|
|
const std::string& interface_name,
|
|
|
|
mojo::ScopedInterfaceEndpointHandle* handle) override;
|
|
|
|
|
|
|
|
service_manager::BinderRegistry* registry() { return ®istry_; }
|
|
|
|
blink::AssociatedInterfaceRegistry* associated_interfaces() {
|
|
|
|
return &associated_interfaces_;
|
|
|
|
}
|
2014-04-04 16:50:38 +00:00
|
|
|
|
2019-05-24 23:23:43 +03:00
|
|
|
void AttachFrame(CefFrameImpl* frame);
|
|
|
|
|
2014-04-04 16:50:38 +00:00
|
|
|
private:
|
2019-07-16 13:59:21 -04:00
|
|
|
void OnLoadStart();
|
2019-11-12 11:11:44 -05:00
|
|
|
void OnLoadError();
|
2019-07-16 13:59:21 -04:00
|
|
|
|
2019-05-24 23:23:43 +03:00
|
|
|
CefFrameImpl* frame_ = nullptr;
|
2017-09-06 17:40:58 -04:00
|
|
|
|
2021-05-14 12:58:55 -04:00
|
|
|
service_manager::BinderRegistry registry_;
|
|
|
|
|
|
|
|
// For interfaces which must be associated with some IPC::ChannelProxy,
|
|
|
|
// meaning that messages on the interface retain FIFO with respect to legacy
|
|
|
|
// Chrome IPC messages sent or dispatched on the channel.
|
|
|
|
blink::AssociatedInterfaceRegistry associated_interfaces_;
|
2014-04-04 16:50:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // LIBCEF_RENDERER_RENDER_FRAME_OBSERVER_H_
|