It's renamed to tizen_webview::WrtIpcMessageData with additional methods.
In addition, following refactorings were performed during the task.
* rename function:
- ewk_ipc_wrt_message_send_private
=> tizen_webview::WrtIpc::SendMessage
- ewk_ipc_plugins_message_send_private
=> tizen_webview::WrtPluginsIpc::SendMessage
- ewk_ipc_plugins_sync_message_send_private
=> tizen_webview::WrtPluginsIpc::SendSyncMessage
* delete file:
- impl/API/ewk_ipc_message_private.h|cc => merged to tw_wrt.h|cc
Issue: CBEFL-92
Change-Id: I3bd7ee4d296a5e04b6852f357c3746af8c2b5aaa
+++ /dev/null
-/*
- * Copyright (C) 2013 Samsung Electronics
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-/**
- * @file ewk_ipc_message.h
- * @brief Custom support for ipc messages
- */
-
-#ifndef EWK_IPC_MESSAGE_H
-#define EWK_IPC_MESSAGE_H
-
-
-typedef struct Ewk_IPC_Wrt_Message_Data Ewk_IPC_Wrt_Message_Data;
-
-
-#endif // EWK_IPC_MESSAGE_H
'API/ewk_geolocation_private.h',
'API/ewk_hit_test_private.cc',
'API/ewk_hit_test_private.h',
- 'API/ewk_ipc_message_private.cc',
- 'API/ewk_ipc_message_private.h',
'API/ewk_notification_private.cc',
'API/ewk_notification_private.h',
'API/ewk_policy_decision_private.cc',
'<(chrome_src_dir)/tizen_webview/public/tw_url.h',
'<(chrome_src_dir)/tizen_webview/public/tw_web_context.h',
'<(chrome_src_dir)/tizen_webview/public/tw_web_context.cc',
+ '<(chrome_src_dir)/tizen_webview/public/tw_wrt.h',
+ '<(chrome_src_dir)/tizen_webview/public/tw_wrt.cc',
'<(chrome_src_dir)/tizen_webview/tw_misc_utility.h',
'<(chrome_src_dir)/tizen_webview/tw_misc_utility.cc',
'url_request_context_getter_efl.cc',
#include "content/public/common/referrer.h"
#include "API/ewk_hit_test_private.h"
#include "API/ewk_text_style_private.h"
-#include "API/ewk_ipc_message_private.h"
#include "cache_params_efl.h"
#include "public/ewk_view.h"
#include "navigation_policy_params.h"
-#include "public/ewk_ipc_message.h"
#include "renderer/print_pages_params.h"
#include "third_party/WebKit/public/web/WebNavigationPolicy.h"
#include "third_party/WebKit/public/web/WebNavigationType.h"
#include "url/gurl.h"
#include "tizen_webview/public/tw_hit_test.h"
+#include "tizen_webview/public/tw_wrt.h"
#include <string>
#include <map>
IPC_STRUCT_TRAITS_MEMBER(filename)
IPC_STRUCT_TRAITS_END()
-IPC_STRUCT_TRAITS_BEGIN(Ewk_IPC_Wrt_Message_Data)
+IPC_STRUCT_TRAITS_BEGIN(tizen_webview::WrtIpcMessageData)
IPC_STRUCT_TRAITS_MEMBER(type)
IPC_STRUCT_TRAITS_MEMBER(value)
IPC_STRUCT_TRAITS_MEMBER(id)
std::string) // result: encodedBundle
IPC_MESSAGE_CONTROL1(EwkViewMsg_SendWrtMessage,
- Ewk_IPC_Wrt_Message_Data /* data */);
+ tizen_webview::WrtIpcMessageData /* data */);
IPC_MESSAGE_ROUTED0(EwkViewMsg_GetSelectionStyle)
Ewk_CSP_Header_Type /* header type */)
IPC_SYNC_MESSAGE_ROUTED1_1(EwkHostMsg_WrtSyncMessage,
- Ewk_IPC_Wrt_Message_Data /* data */,
+ tizen_webview::WrtIpcMessageData /* data */,
std::string /*result*/);
IPC_MESSAGE_ROUTED3(EwkViewMsg_Scale,
int /* callback id */)
IPC_MESSAGE_ROUTED1(EwkHostMsg_WrtMessage,
- Ewk_IPC_Wrt_Message_Data /* data */);
+ tizen_webview::WrtIpcMessageData /* data */);
IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeContentsSize,
int, /* width */
#include "common/render_messages_efl.h"
#include "tizen_webview/public/tw_security_origin.h"
+#include "tizen_webview/public/tw_wrt.h"
#include "tizen_webview/tw_misc_utility.h"
using content::BrowserThread;
}
}
-void EWebContext::SendWrtMessage(const Ewk_IPC_Wrt_Message_Data& data) {
+void EWebContext::SendWrtMessage(const tizen_webview::WrtIpcMessageData& data) {
content::RenderProcessHost::iterator i(content::RenderProcessHost::AllHostsIterator());
for (; !i.IsAtEnd(); i.Advance()) {
i.GetCurrentValue()->Send(new EwkViewMsg_SendWrtMessage(data));
namespace tizen_webview {
class URL;
class WebContext;
+class WrtIpcMessageData;
}
typedef std::map<std::string, std::string> HTTPCustomHeadersEflMap;
class CookieManager;
-struct Ewk_IPC_Wrt_Message_Data;
namespace content {
class BrowserContextEfl;
Evas_Object *AddFaviconObject(const char* uri, Evas* canvas) const;
void SendWidgetInfo(int widget_id, double scale, const std::string &theme, const std::string &encoded_bundle);
- void SendWrtMessage(const Ewk_IPC_Wrt_Message_Data& message);
+ void SendWrtMessage(const tizen_webview::WrtIpcMessageData& message);
void SetPixmap(int pixmap) { m_pixmap = pixmap; }
int Pixmap() const { return m_pixmap; }
#include "API/ewk_user_media_private.h"
#include "public/ewk_notification.h"
#include "public/ewk_policy_decision.h"
-#include "public/ewk_ipc_message.h"
#include "tizen_webview/public/tw_custom_handlers.h"
#include <Evas.h>
namespace tizen_webview {
class Notification;
+class WrtIpcMessageData;
}
namespace EWebViewCallbacks {
DECLARE_EWK_VIEW_CALLBACK(BackForwardListChange, "back,forward,list,changed", void);
DECLARE_EWK_VIEW_CALLBACK(WebProcessCrashed, "webprocess,crashed", bool*);
DECLARE_EWK_VIEW_CALLBACK(ConsoleMessage, "console,message", _Ewk_Console_Message*);
-DECLARE_EWK_VIEW_CALLBACK(WrtPluginsMessage, "wrt,message", Ewk_IPC_Wrt_Message_Data*);
+DECLARE_EWK_VIEW_CALLBACK(WrtPluginsMessage, "wrt,message", tizen_webview::WrtIpcMessageData*);
DECLARE_EWK_VIEW_CALLBACK(IconReceived, "icon,received", void);
}
wrt_widget_->SetWidgetInfo(widgetHandle, scaleFactor, encodedBundle, theme);
}
-void ContentRendererClientEfl::WrtMessageReceived(const Ewk_IPC_Wrt_Message_Data& data) {
+void ContentRendererClientEfl::WrtMessageReceived(const tizen_webview::WrtIpcMessageData& data) {
wrt_widget_->messageReceived(data);
}
#include "content/public/renderer/content_renderer_client.h"
#include "v8/include/v8.h"
#include "renderer/render_process_observer_efl.h"
-#include "public/ewk_ipc_message.h"
namespace content {
class RenderView;
class DocumentState;
}
+namespace tizen_webview {
+class WrtIpcMessageData;
+}
+
namespace visitedlink {
class VisitedLinkSlave;
}
const std::string &encodedBundle,
const std::string &theme);
- void WrtMessageReceived(const Ewk_IPC_Wrt_Message_Data& data);
+ void WrtMessageReceived(const tizen_webview::WrtIpcMessageData& data);
virtual void DidCreateScriptContext(blink::WebFrame* frame,
v8::Handle<v8::Context> context,
content_client_->SetWidgetInfo(widget_id, scale, encoded_bundle, theme);
}
-void RenderProcessObserverEfl::OnWrtMessage(const Ewk_IPC_Wrt_Message_Data& data)
+void RenderProcessObserverEfl::OnWrtMessage(const tizen_webview::WrtIpcMessageData& data)
{
content_client_->WrtMessageReceived(data);
}
#include "content/public/renderer/render_process_observer.h"
#include "common/render_messages_efl.h"
#include "cache_params_efl.h"
-#include "public/ewk_ipc_message.h"
namespace IPC {
class Message;
const std::string &theme,
const std::string &encoded_bundle);
void OnSetCache(const CacheParamsEfl& params);
- void OnWrtMessage(const Ewk_IPC_Wrt_Message_Data& data);
+ void OnWrtMessage(const tizen_webview::WrtIpcMessageData& data);
ContentRendererClientEfl* content_client_;
bool webkit_initialized_;
CacheParamsEfl pending_cache_params_;
--- /dev/null
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "tw_wrt.h"
+
+#include "content/public/renderer/render_view.h"
+#include "common/render_messages_efl.h"
+#include "eweb_context.h"
+#include "tizen_webview/public/tw_web_context.h"
+
+namespace tizen_webview {
+
+const char* WrtIpcMessageData::GetType() const {
+ return type.c_str();
+}
+
+void WrtIpcMessageData::SetType(const char* val) {
+ type = val;
+}
+
+const char* WrtIpcMessageData::GetValue() const {
+ return value.c_str();
+}
+
+void WrtIpcMessageData::SetValue(const char* val) {
+ value = val;
+}
+
+const char* WrtIpcMessageData::GetId() const {
+ return id.c_str();
+}
+
+void WrtIpcMessageData::SetId(const char* val) {
+ id = val;
+}
+
+const char* WrtIpcMessageData::GetReferenceId() const {
+ return reference_id.c_str();
+}
+
+void WrtIpcMessageData::SetReferenceId(const char* val) {
+ reference_id = val;
+}
+
+
+bool WrtIpc::SendMessage(WebContext* ctx, const WrtIpcMessageData& data) {
+ EWebContext* web_context = ctx->GetImpl();
+ if (!web_context) {
+ return false;
+ }
+ web_context->SendWrtMessage(data);
+ return true;
+}
+
+bool WrtPluginsIpc::SendMessage(int routing_id, const WrtIpcMessageData& data) {
+ content::RenderView* rv = content::RenderView::FromRoutingID(routing_id);
+ if (!rv) {
+ return false;
+ }
+ rv->Send(new EwkHostMsg_WrtMessage(rv->GetRoutingID(), data));
+ return true;
+}
+
+bool WrtPluginsIpc::SendSyncMessage(int routing_id, WrtIpcMessageData* data) {
+ content::RenderView* rv = content::RenderView::FromRoutingID(routing_id);
+ if (!rv) {
+ return false;
+ }
+
+ rv->Send(new EwkHostMsg_WrtSyncMessage(routing_id, *data, &data->value));
+ return true;
+}
+
+} // namespace tizen_webview
--- /dev/null
+// Copyright (c) 2014 The Chromium 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 TIZEN_WEBVIEW_PUBLIC_TW_WRT_H_
+#define TIZEN_WEBVIEW_PUBLIC_TW_WRT_H_
+
+#include <string>
+
+namespace tizen_webview {
+
+struct WrtIpcMessageData {
+ std::string type;
+ std::string value;
+ std::string id;
+ std::string reference_id;
+
+ const char* GetType() const;
+ void SetType(const char* val);
+ const char* GetValue() const;
+ void SetValue(const char* val);
+ const char* GetId() const;
+ void SetId(const char* val);
+ const char* GetReferenceId() const;
+ void SetReferenceId(const char* val);
+};
+
+class WebContext;
+
+struct WrtIpc {
+ static bool SendMessage(WebContext* ctx, const WrtIpcMessageData& data);
+};
+
+struct WrtPluginsIpc {
+ static bool SendMessage(int routing_id, const WrtIpcMessageData& data);
+ static bool SendSyncMessage(int routing_id, WrtIpcMessageData* data);
+};
+
+} // namespace tizen_webview
+
+#endif // TIZEN_WEBVIEW_PUBLIC_TW_WRT_H_
#include "printing/pdf_metafile_skia.h"
#include "url/gurl.h"
#include "browser/favicon/favicon_service.h"
+
+#include "tizen_webview/public/tw_web_context.h"
#include "tizen_webview/public/tw_input_type.h"
#ifdef TIZEN_AUTOFILL_SUPPORT
web_view_->SmartCallback<EWebViewCallbacks::FormSubmit>().call(url.GetContent().c_str());
}
-void WebContentsDelegateEfl::OnWrtPluginMessage(const Ewk_IPC_Wrt_Message_Data& data) {
- scoped_ptr<Ewk_IPC_Wrt_Message_Data> p(new Ewk_IPC_Wrt_Message_Data);
+void WebContentsDelegateEfl::OnWrtPluginMessage(const tizen_webview::WrtIpcMessageData& data) {
+ scoped_ptr<tizen_webview::WrtIpcMessageData> p(new tizen_webview::WrtIpcMessageData);
p->type = data.type;
p->value = data.value;
p->id = data.id;
web_view_->SmartCallback<EWebViewCallbacks::WrtPluginsMessage>().call(p.get());
}
-void WebContentsDelegateEfl::OnWrtPluginSyncMessage(const Ewk_IPC_Wrt_Message_Data& data,
+void WebContentsDelegateEfl::OnWrtPluginSyncMessage(const tizen_webview::WrtIpcMessageData& data,
IPC::Message* reply) {
- scoped_ptr<Ewk_IPC_Wrt_Message_Data> tmp(new Ewk_IPC_Wrt_Message_Data);
+ scoped_ptr<tizen_webview::WrtIpcMessageData> tmp(new tizen_webview::WrtIpcMessageData);
tmp->type = data.type;
web_view_->SmartCallback<EWebViewCallbacks::WrtPluginsMessage>().call(tmp.get());
EwkHostMsg_WrtSyncMessage::WriteReplyParams(reply, tmp->value);
#include "browser/javascript_dialog_manager_efl.h"
#include "browser_context_efl.h"
#include "eweb_view.h"
-#include "public/ewk_ipc_message.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/common/frame_navigate_params.h"
class DidPrintPagesParams;
+namespace tizen_webview {
+class WrtIpcMessageData;
+}
+
namespace content {
struct DateTimeSuggestion;
private:
void OnGetContentSecurityPolicy(IPC::Message* reply_msg);
- void OnWrtPluginMessage(const Ewk_IPC_Wrt_Message_Data& data);
- void OnWrtPluginSyncMessage(const Ewk_IPC_Wrt_Message_Data& data,
+ void OnWrtPluginMessage(const tizen_webview::WrtIpcMessageData& data);
+ void OnWrtPluginSyncMessage(const tizen_webview::WrtIpcMessageData& data,
IPC::Message* reply);
EWebView* web_view_;
return dynamicPlugin;
}
-void DynamicPlugin::messageReceived(const Ewk_IPC_Wrt_Message_Data& data) {
- if(!m_onIPCMessage)
+void DynamicPlugin::messageReceived(const tizen_webview::WrtIpcMessageData& data) {
+ if (!m_onIPCMessage)
return;
m_onIPCMessage(data);
#include <string>
#include "v8/include/v8.h"
-#include "public/ewk_ipc_message.h"
+
+
+namespace tizen_webview {
+class WrtIpcMessageData;
+}
typedef void (*startSessionFun)(int,
v8::Handle<v8::Context>,
const char*,
const char*);
-typedef void (*onIPCMessageFun)(const Ewk_IPC_Wrt_Message_Data&);
+typedef void (*onIPCMessageFun)(const tizen_webview::WrtIpcMessageData&);
typedef void (*parseUrlFun)(std::string*, std::string*, int);
typedef void (*databaseAttachFun)(int);
void parseURL(std::string* old_url, std::string* new_url, int widget_id);
- void messageReceived(const Ewk_IPC_Wrt_Message_Data& data);
+ void messageReceived(const tizen_webview::WrtIpcMessageData& data);
~DynamicPlugin();
//TODO: stop session
}
-void WrtWidget::messageReceived(const Ewk_IPC_Wrt_Message_Data& data) {
- if (widgetHandle_ != -1) {
- DynamicPlugin::instance().messageReceived(data);
- }
+void WrtWidget::messageReceived(const tizen_webview::WrtIpcMessageData& data) {
+ if (widgetHandle_ != -1)
+ DynamicPlugin::instance().messageReceived(data);
}
#include <string>
#include "url/gurl.h"
#include "v8/include/v8.h"
-#include "public/ewk_ipc_message.h"
+
+namespace tizen_webview {
+class WrtIpcMessageData;
+}
class WrtWidget {
public:
const std::string& encodedBundle,
const std::string& theme);
- void messageReceived(const Ewk_IPC_Wrt_Message_Data& data);
+ void messageReceived(const tizen_webview::WrtIpcMessageData& data);
void ParseUrl(const GURL& url, GURL& new_url);