bool WebContentsDelegateEfl::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(WebContentsDelegateEfl, message)
-#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
- // FIXME: WebContentsObserver is IPC:: listener only cannot send
IPC_MESSAGE_HANDLER_DELAY_REPLY(EwkHostMsg_GetContentSecurityPolicy,
OnGetContentSecurityPolicy)
-#endif
IPC_MESSAGE_HANDLER(EwkHostMsg_DidPrintPagesToPdf,
OnPrintedMetafileReceived)
IPC_MESSAGE_HANDLER(EwkHostMsg_WrtMessage, OnWrtPluginMessage)
-#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
- // FIXME: WebContentsObserver is IPC:: listener only cannot send
IPC_MESSAGE_HANDLER_DELAY_REPLY(EwkHostMsg_WrtSyncMessage,
OnWrtPluginSyncMessage)
-#endif
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
is_main_frame);
}
+bool WebContentsDelegateEfl::Send(IPC::Message* message) {
+ if (!web_contents_.GetRenderViewHost()) {
+ delete message;
+ return false;
+ }
+ return web_contents_.GetRenderViewHost()->Send(message);
+}
+
void WebContentsDelegateEfl::OnWrtPluginMessage(
const Ewk_Wrt_Message_Data& data) {
std::unique_ptr<Ewk_Wrt_Message_Data> p(new Ewk_Wrt_Message_Data);
Ewk_Wrt_Message_Data tmp = data;
web_view_->SmartCallback<EWebViewCallbacks::WrtPluginsMessage>().call(&tmp);
EwkHostMsg_WrtSyncMessage::WriteReplyParams(reply, tmp.value);
-#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
- // WebContentsObserver is IPC:: listener only cannot send
Send(reply);
-#endif
}
void WebContentsDelegateEfl::DidFirstVisuallyNonEmptyPaint() {
pending_content_security_policy_->header_type);
pending_content_security_policy_.reset();
}
-#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
- // WebContentsObserver is IPC:: listener only cannot send
Send(reply_msg);
-#endif
}
void WebContentsDelegateEfl::OnPrintedMetafileReceived(
struct DateTimeSuggestion;
class WebContentsDelegateEfl : public WebContentsDelegate,
- public WebContentsObserver {
+ public WebContentsObserver,
+ public IPC::Sender {
public:
WebContentsDelegateEfl(EWebView*);
~WebContentsDelegateEfl();
int error_code,
const base::string16& error_description) override;
+ // IPC::Sender-----------------------------------------------------------
+ bool Send(IPC::Message* message) override;
+
// EWK_BRINGUP: These APIs are removed in upstream.
void TitleWasSet(content::NavigationEntry* entry, bool explicit_set);