Remove tw_hit_test
authorArnaud Renevier <a.renevier@samsung.com>
Mon, 13 Apr 2015 18:19:57 +0000 (11:19 -0700)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
There were two distinct classes: Ewk_Hit_Test and _Ewk_Hit_Test.
Ewk_Hit_Test was a subclass of tizen_webview::Hit_Test _Ewk_Hit_Test
owned an Ewk_Hit_Test and accessed it's properties.

This patch simplifies everything: there is now only _Ewk_Hit_Test, and
Ewk_Hit_Test is an alias to it.

Bug: http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=11619

Change-Id: I885c5c8350f306b44c2d8ed19ab1c9a2ff43894a
Signed-off-by: Arnaud Renevier <a.renevier@samsung.com>
20 files changed:
tizen_src/ewk/efl_integration/common/render_messages_ewk.h
tizen_src/ewk/efl_integration/efl_integration.gypi
tizen_src/ewk/efl_integration/eweb_view.cc
tizen_src/ewk/efl_integration/eweb_view.h
tizen_src/ewk/efl_integration/private/chromium_glue.cc
tizen_src/ewk/efl_integration/private/chromium_glue.h
tizen_src/ewk/efl_integration/private/ewk_hit_test_private.cc
tizen_src/ewk/efl_integration/private/ewk_hit_test_private.h
tizen_src/ewk/efl_integration/public/ewk_hit_test.cc
tizen_src/ewk/efl_integration/public/ewk_hit_test.h
tizen_src/ewk/efl_integration/public/ewk_view.cc
tizen_src/ewk/efl_integration/renderer/render_view_observer_efl.cc
tizen_src/ewk/efl_integration/renderer/render_view_observer_efl.h
tizen_src/ewk/efl_integration/selection_controller_efl.cc
tizen_src/ewk/efl_integration/selection_controller_efl.h
tizen_src/ewk/efl_integration/tizen_webview/public/tw_callbacks.h
tizen_src/ewk/efl_integration/tizen_webview/public/tw_hit_test.cc [deleted file]
tizen_src/ewk/efl_integration/tizen_webview/public/tw_hit_test.h [deleted file]
tizen_src/ewk/efl_integration/tizen_webview/public/tw_webview.cc
tizen_src/ewk/efl_integration/tizen_webview/public/tw_webview.h

index f2752e2..2cd2cbe 100644 (file)
@@ -15,8 +15,8 @@
 #include "private/ewk_hit_test_private.h"
 #include "private/ewk_text_style_private.h"
 #include "private/ewk_wrt_private.h"
+#include "public/ewk_hit_test.h"
 #include "public/ewk_view.h"
-#include "tizen_webview/public/tw_hit_test.h"
 #include "tizen_webview/public/tw_settings.h"
 #include "third_party/WebKit/public/web/WebNavigationPolicy.h"
 #include "third_party/WebKit/public/web/WebNavigationType.h"
@@ -72,7 +72,7 @@ IPC_STRUCT_TRAITS_END()
 
 IPC_ENUM_TRAITS(Ewk_CSP_Header_Type)
 
-IPC_ENUM_TRAITS(tizen_webview::Hit_Test_Mode)
+IPC_ENUM_TRAITS(Ewk_Hit_Test_Mode)
 
 IPC_STRUCT_TRAITS_BEGIN(DidPrintPagesParams)
   IPC_STRUCT_TRAITS_MEMBER(metafile_data_handle)
@@ -202,12 +202,12 @@ IPC_MESSAGE_ROUTED1(EwkViewMsg_GetMHTMLData,
 IPC_MESSAGE_ROUTED3(EwkViewMsg_DoHitTest,
                     int, /* horizontal position */
                     int, /* vertical position */
-                    tizen_webview::Hit_Test_Mode /* mode */)
+                    Ewk_Hit_Test_Mode /* mode */)
 
 IPC_MESSAGE_ROUTED4(EwkViewMsg_DoHitTestAsync,
                     int, /* horizontal position */
                     int, /* vertical position */
-                    tizen_webview::Hit_Test_Mode, /* mode */
+                    Ewk_Hit_Test_Mode, /* mode */
                     int64_t /* request id */)
 
 // Tells the renderer to clear the cache.
index c6f1ccc..2ebf889 100644 (file)
       'tizen_webview/public/tw_context_menu_controller.h',
       'tizen_webview/public/tw_selection_controller.h',
       'tizen_webview/public/tw_selection_controller.cc',
-      'tizen_webview/public/tw_hit_test.h',
       'tizen_webview/public/tw_web_context.h',
       #'tizen_webview/public/tw_webview_evas_event_handler.h',
       #'tizen_webview/public/tw_webview_evas_event_handler.cc',
       'tizen_webview/public/tw_webview.h',
-      'tizen_webview/public/tw_hit_test.cc',
       'tizen_webview/public/tw_webview.cc',
       'tizen_webview/public/tw_web_context.cc',
       'tizen_webview/public/tw_touch_point.cc',
index 6136c97..aecf81a 100644 (file)
@@ -20,6 +20,7 @@
 #include "private/ewk_settings_private.h"
 #include "private/ewk_text_style_private.h"
 #include "web_contents_delegate_efl.h"
+#include "public/ewk_hit_test.h"
 #include "public/platform/WebString.h"
 #include "base/command_line.h"
 #include "base/files/file_path.h"
@@ -51,7 +52,6 @@
 #include "ui/gfx/screen.h"
 #include "devtools_delegate_efl.h"
 
-#include "tizen_webview/public/tw_hit_test.h"
 #include "tizen_webview/public/tw_web_context.h"
 #include "tizen_webview/public/tw_webview.h"
 #include "tizen_webview/public/tw_webview_delegate.h"
@@ -132,24 +132,24 @@ static content::WebContents* NullCreateWebContents(void*) {
 class WebViewAsyncRequestHitTestDataCallback
 {
  public:
-  WebViewAsyncRequestHitTestDataCallback(int x, int y, tizen_webview::Hit_Test_Mode mode)
+  WebViewAsyncRequestHitTestDataCallback(int x, int y, Ewk_Hit_Test_Mode mode)
       : x_(x)
       , y_(y)
       , mode_(mode) {
   }
   virtual ~WebViewAsyncRequestHitTestDataCallback() {};
 
-  virtual void Run(tizen_webview::Hit_Test *hit_test, EWebView* web_view) = 0;
+  virtual void Run(_Ewk_Hit_Test *hit_test, EWebView* web_view) = 0;
 
  protected:
   int GetX() const { return x_; }
   int GetY() const { return y_; }
-  tizen_webview::Hit_Test_Mode GetMode() const { return mode_; }
+  Ewk_Hit_Test_Mode GetMode() const { return mode_; }
 
  private:
   int x_;
   int y_;
-  tizen_webview::Hit_Test_Mode mode_;
+  Ewk_Hit_Test_Mode mode_;
 };
 
 class WebViewAsyncRequestHitTestDataUserCallback: public WebViewAsyncRequestHitTestDataCallback
@@ -157,7 +157,7 @@ class WebViewAsyncRequestHitTestDataUserCallback: public WebViewAsyncRequestHitT
  public:
   WebViewAsyncRequestHitTestDataUserCallback(int x,
                                              int y,
-                                             tizen_webview::Hit_Test_Mode mode,
+                                             Ewk_Hit_Test_Mode mode,
                                              tizen_webview::View_Hit_Test_Request_Callback callback,
                                              void* user_data)
       : WebViewAsyncRequestHitTestDataCallback(x, y, mode)
@@ -165,7 +165,7 @@ class WebViewAsyncRequestHitTestDataUserCallback: public WebViewAsyncRequestHitT
       , user_data_(user_data) {
   }
 
-  void Run(tizen_webview::Hit_Test *hit_test, EWebView* web_view) override {
+  void Run(_Ewk_Hit_Test *hit_test, EWebView* web_view) override {
     DCHECK(callback_);
     callback_(web_view->evas_object(), GetX(), GetY(), GetMode(), hit_test, user_data_);
   }
@@ -178,18 +178,18 @@ class WebViewAsyncRequestHitTestDataUserCallback: public WebViewAsyncRequestHitT
 class WebViewAsyncRequestHitTestDataInternalCallback: public WebViewAsyncRequestHitTestDataCallback
 {
  public:
-  typedef void (EWebView::*Callback)(int, int, tizen_webview::Hit_Test_Mode, tizen_webview::Hit_Test*);
+  typedef void (EWebView::*Callback)(int, int, Ewk_Hit_Test_Mode, _Ewk_Hit_Test*);
 
  public:
   WebViewAsyncRequestHitTestDataInternalCallback(int x,
                                                  int y,
-                                                 tizen_webview::Hit_Test_Mode mode,
+                                                 Ewk_Hit_Test_Mode mode,
                                                  Callback cb)
       : WebViewAsyncRequestHitTestDataCallback(x, y, mode)
       , callback_(cb) {
   }
 
-  void Run(tizen_webview::Hit_Test* hit_test, EWebView* web_view) override {
+  void Run(_Ewk_Hit_Test* hit_test, EWebView* web_view) override {
     DCHECK(callback_);
     (web_view->*callback_)(GetX(), GetY(), GetMode(), hit_test);
   }
@@ -201,7 +201,7 @@ class WebViewAsyncRequestHitTestDataInternalCallback: public WebViewAsyncRequest
 class AsyncHitTestRequest
 {
  public:
-  AsyncHitTestRequest(int x, int y, tizen_webview::Hit_Test_Mode mode,
+  AsyncHitTestRequest(int x, int y, Ewk_Hit_Test_Mode mode,
       tizen_webview::View_Hit_Test_Request_Callback callback, void* user_data)
     : x_(x)
     , y_(y)
@@ -210,7 +210,7 @@ class AsyncHitTestRequest
     , user_data_(user_data) {
   }
 
-  void Run(tizen_webview::Hit_Test *hit_test, Evas_Object* web_view) {
+  void Run(_Ewk_Hit_Test *hit_test, Evas_Object* web_view) {
     DCHECK(callback_);
     callback_(web_view, x_, y_, mode_, hit_test, user_data_);
   }
@@ -218,7 +218,7 @@ class AsyncHitTestRequest
  private:
   int x_;
   int y_;
-  tizen_webview::Hit_Test_Mode mode_;
+  Ewk_Hit_Test_Mode mode_;
   tizen_webview::View_Hit_Test_Request_Callback callback_;
   void* user_data_;
 };
@@ -715,40 +715,38 @@ void EWebView::DispatchPostponedGestureEvent(ui::GestureEvent* event) {
       ClearSelection();
 
     if (settings && settings->textSelectionEnabled()) {
-      tizen_webview::Hit_Test* hit_test = RequestHitTestDataAtBlinkCoords(event->x(), event->y(), TW_HIT_TEST_MODE_DEFAULT);
-      _Ewk_Hit_Test* hit_test_data = hit_test->impl;
-      if (hit_test_data && hit_test_data->context & TW_HIT_TEST_RESULT_CONTEXT_EDITABLE) {
+      _Ewk_Hit_Test* hit_test = RequestHitTestDataAtBlinkCoords(event->x(), event->y(), EWK_HIT_TEST_MODE_DEFAULT);
+      if (hit_test && hit_test->GetResultContext() & EWK_HIT_TEST_RESULT_CONTEXT_EDITABLE) {
         selection_controller_->SetSelectionStatus(true);
         selection_controller_->SetCaretSelectionStatus(true);
         selection_controller_->SetSelectionEditable(true);
         selection_controller_->HandleLongPressEvent(rwhv()->ConvertPointInViewPix(gfx::Point(event->x(), event->y())));
-      } else if (hit_test_data
-          && !(hit_test_data->context & TW_HIT_TEST_RESULT_CONTEXT_LINK)
-          && !(hit_test_data->context & TW_HIT_TEST_RESULT_CONTEXT_IMAGE)
-          && !(hit_test_data->context & TW_HIT_TEST_RESULT_CONTEXT_MEDIA)
-          && hit_test_data->context & TW_HIT_TEST_RESULT_CONTEXT_TEXT) {
+      } else if (hit_test
+          && !(hit_test->GetResultContext() & EWK_HIT_TEST_RESULT_CONTEXT_LINK)
+          && !(hit_test->GetResultContext() & EWK_HIT_TEST_RESULT_CONTEXT_IMAGE)
+          && !(hit_test->GetResultContext() & EWK_HIT_TEST_RESULT_CONTEXT_MEDIA)
+          && hit_test->GetResultContext() & EWK_HIT_TEST_RESULT_CONTEXT_TEXT) {
         selection_controller_->SetSelectionStatus(true);
         selection_controller_->HandleLongPressEvent(rwhv()->ConvertPointInViewPix(gfx::Point(event->x(), event->y())));
         LOG(INFO) << __PRETTY_FUNCTION__ << ":: link, !image, !media, text";
-      } else if (hit_test_data && hit_test_data->context & TW_HIT_TEST_RESULT_CONTEXT_DOCUMENT) {
-        LOG(INFO) << __PRETTY_FUNCTION__ << ":: TW_HIT_TEST_RESULT_CONTEXT_DOCUMENT";
-      } else if (hit_test_data && hit_test_data->context & TW_HIT_TEST_RESULT_CONTEXT_IMAGE) {
-        LOG(INFO) << __PRETTY_FUNCTION__ << ":: TW_HIT_TEST_RESULT_CONTEXT_IMAGE";
-      } else if (hit_test_data && hit_test_data->context & TW_HIT_TEST_RESULT_CONTEXT_LINK) {
+      } else if (hit_test && hit_test->GetResultContext() & EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT) {
+        LOG(INFO) << __PRETTY_FUNCTION__ << ":: EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT";
+      } else if (hit_test && hit_test->GetResultContext() & EWK_HIT_TEST_RESULT_CONTEXT_IMAGE) {
+        LOG(INFO) << __PRETTY_FUNCTION__ << ":: EWK_HIT_TEST_RESULT_CONTEXT_IMAGE";
+      } else if (hit_test && hit_test->GetResultContext() & EWK_HIT_TEST_RESULT_CONTEXT_LINK) {
         ClearSelection();
-        LOG(INFO) << __PRETTY_FUNCTION__ << ":: TW_HIT_TEST_RESULT_CONTEXT_LINK";
+        LOG(INFO) << __PRETTY_FUNCTION__ << ":: EWK_HIT_TEST_RESULT_CONTEXT_LINK";
       } else {
-        LOG(INFO) << __PRETTY_FUNCTION__ << ":: hit_test = " << hit_test_data->context;
+        LOG(INFO) << __PRETTY_FUNCTION__ << ":: hit_test = " << hit_test->GetResultContext();
       }
       delete hit_test;
       rwhv()->HandleGesture(event);
     }
   } else if ((event->details().type() == ui::ET_GESTURE_TAP) || (event->details().type() == ui::ET_GESTURE_SHOW_PRESS))  {
-    tizen_webview::Hit_Test* hit_test = RequestHitTestDataAtBlinkCoords(event->x(), event->y(), TW_HIT_TEST_MODE_DEFAULT);
-   _Ewk_Hit_Test* hit_test_data = hit_test->impl;
-    LOG(INFO) << __PRETTY_FUNCTION__ << " hit_test = " << hit_test_data;
-    if (hit_test_data && hit_test_data->context & TW_HIT_TEST_RESULT_CONTEXT_EDITABLE) {
-      LOG(INFO) << "DispatchPostponedGestureEvent :: TW_HIT_TEST_RESULT_CONTEXT_EDITABLE";
+    _Ewk_Hit_Test* hit_test = RequestHitTestDataAtBlinkCoords(event->x(), event->y(), EWK_HIT_TEST_MODE_DEFAULT);
+    LOG(INFO) << __PRETTY_FUNCTION__ << " hit_test = " << hit_test;
+    if (hit_test && hit_test->GetResultContext() & EWK_HIT_TEST_RESULT_CONTEXT_EDITABLE) {
+      LOG(INFO) << "DispatchPostponedGestureEvent :: EWK_HIT_TEST_RESULT_CONTEXT_EDITABLE";
       selection_controller_->SetSelectionStatus(true);
       if (selection_controller_->GetSelectionEditable()) {
         selection_controller_->HideHandle();
@@ -756,9 +754,9 @@ void EWebView::DispatchPostponedGestureEvent(ui::GestureEvent* event) {
       } else
         selection_controller_->SetSelectionEditable(true);
     } else {
-      if (hit_test_data && hit_test_data->context & TW_HIT_TEST_RESULT_CONTEXT_DOCUMENT)
+      if (hit_test && hit_test->GetResultContext() & EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT)
         LOG(INFO) << __PRETTY_FUNCTION__ << " DOCUMENT";
-      if (hit_test_data && hit_test_data->context & TW_HIT_TEST_RESULT_CONTEXT_TEXT)
+      if (hit_test && hit_test->GetResultContext() & EWK_HIT_TEST_RESULT_CONTEXT_TEXT)
         LOG(INFO) << __PRETTY_FUNCTION__ << " TEXT";
 
       selection_controller_->SetSelectionEditable(false);
@@ -778,25 +776,23 @@ void EWebView::DispatchPostponedGestureEvent(ui::GestureEvent* event) {
 */
 
 void EWebView::HandleLongPressGesture(int x, int y,
-                                      tizen_webview::Hit_Test_Mode,
-                                      tizen_webview::Hit_Test* hit_test) {
-  _Ewk_Hit_Test* hit_test_data = hit_test->impl;
-  if (!hit_test_data)
+                                      Ewk_Hit_Test_Mode,
+                                      _Ewk_Hit_Test* hit_test) {
+  if (!hit_test)
     return;
 
   selection_controller_->HandleLongPressEvent(
-      rwhv()->ConvertPointInViewPix(gfx::Point(x, y)), hit_test_data->context);
+      rwhv()->ConvertPointInViewPix(gfx::Point(x, y)), hit_test->GetResultContext());
 }
 
 void EWebView::HandleTapGesture(int x, int y,
-                                tizen_webview::Hit_Test_Mode,
-                                tizen_webview::Hit_Test* hit_test) {
-  _Ewk_Hit_Test* hit_test_data = hit_test->impl;
-  if (!hit_test_data)
+                                Ewk_Hit_Test_Mode,
+                                _Ewk_Hit_Test* hit_test) {
+  if (!hit_test)
     return;
 
   selection_controller_->HandleTapEvent(
-      rwhv()->ConvertPointInViewPix(gfx::Point(x, y)), hit_test_data->context);
+      rwhv()->ConvertPointInViewPix(gfx::Point(x, y)), hit_test->GetResultContext());
 }
 
 content::WebContentsViewEfl* EWebView::GetWebContentsViewEfl() const {
@@ -812,9 +808,9 @@ void EWebView::HandlePostponedGesture(int x, int y, ui::EventType type) {
       if (settings_->textSelectionEnabled()) {
         WebViewAsyncRequestHitTestDataInternalCallback* cb =
             new WebViewAsyncRequestHitTestDataInternalCallback(x,y,
-                TW_HIT_TEST_MODE_DEFAULT, &EWebView::HandleLongPressGesture);
+                EWK_HIT_TEST_MODE_DEFAULT, &EWebView::HandleLongPressGesture);
         // below call takes full ownership of cb.
-        AsyncRequestHitTestDataAtBlinkCords(x, y, TW_HIT_TEST_MODE_DEFAULT, cb);
+        AsyncRequestHitTestDataAtBlinkCords(x, y, EWK_HIT_TEST_MODE_DEFAULT, cb);
       }
       break;
     }
@@ -822,9 +818,9 @@ void EWebView::HandlePostponedGesture(int x, int y, ui::EventType type) {
     case ui::ET_GESTURE_SHOW_PRESS: {
       WebViewAsyncRequestHitTestDataInternalCallback* cb =
           new WebViewAsyncRequestHitTestDataInternalCallback(x, y,
-              TW_HIT_TEST_MODE_DEFAULT, &EWebView::HandleTapGesture);
+              EWK_HIT_TEST_MODE_DEFAULT, &EWebView::HandleTapGesture);
       // below call takes full ownership of cb.
-      AsyncRequestHitTestDataAtBlinkCords(x, y, TW_HIT_TEST_MODE_DEFAULT, cb);
+      AsyncRequestHitTestDataAtBlinkCords(x, y, EWK_HIT_TEST_MODE_DEFAULT, cb);
       break;
       }
     default:
@@ -1465,8 +1461,8 @@ bool EWebView::GetSelectionRange(Eina_Rectangle* left_rect, Eina_Rectangle* righ
   return false;
 }
 
-tizen_webview::Hit_Test* EWebView::RequestHitTestDataAt(int x, int y,
-    tizen_webview::Hit_Test_Mode mode) {
+_Ewk_Hit_Test* EWebView::RequestHitTestDataAt(int x, int y,
+    Ewk_Hit_Test_Mode mode) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
 
   int view_x, view_y;
@@ -1476,7 +1472,7 @@ tizen_webview::Hit_Test* EWebView::RequestHitTestDataAt(int x, int y,
 }
 
 Eina_Bool EWebView::AsyncRequestHitTestDataAt(int x, int y,
-    tizen_webview::Hit_Test_Mode mode,
+    Ewk_Hit_Test_Mode mode,
     tizen_webview::View_Hit_Test_Request_Callback callback,
     void* user_data) {
   int view_x, view_y;
@@ -1489,7 +1485,7 @@ Eina_Bool EWebView::AsyncRequestHitTestDataAt(int x, int y,
 }
 
 Eina_Bool EWebView::AsyncRequestHitTestDataAtBlinkCords(int x, int y,
-    tizen_webview::Hit_Test_Mode mode,
+    Ewk_Hit_Test_Mode mode,
     tizen_webview::View_Hit_Test_Request_Callback callback,
     void* user_data) {
   return AsyncRequestHitTestDataAtBlinkCords(
@@ -1500,7 +1496,7 @@ Eina_Bool EWebView::AsyncRequestHitTestDataAtBlinkCords(int x, int y,
 }
 
 Eina_Bool EWebView::AsyncRequestHitTestDataAtBlinkCords(int x, int y,
-    tizen_webview::Hit_Test_Mode mode,
+    Ewk_Hit_Test_Mode mode,
     WebViewAsyncRequestHitTestDataCallback *cb) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
   DCHECK(cb);
@@ -1536,14 +1532,14 @@ void EWebView::DispatchAsyncHitTestData(const Hit_Test_Params& params, int64_t r
 
   if (it == hit_test_callback_.end())
     return;
-  scoped_ptr<tizen_webview::Hit_Test> hit_test(new tizen_webview::Hit_Test(params));
+  scoped_ptr<_Ewk_Hit_Test> hit_test(new _Ewk_Hit_Test(params));
 
   it->second->Run(hit_test.get(), this);
   delete it->second;
   hit_test_callback_.erase(it);
 }
 
-tizen_webview::Hit_Test* EWebView::RequestHitTestDataAtBlinkCoords(int x, int y, tizen_webview::Hit_Test_Mode mode) {
+_Ewk_Hit_Test* EWebView::RequestHitTestDataAtBlinkCoords(int x, int y, Ewk_Hit_Test_Mode mode) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
 
   RenderViewHost* render_view_host = web_contents_->GetRenderViewHost();
@@ -1556,7 +1552,7 @@ tizen_webview::Hit_Test* EWebView::RequestHitTestDataAtBlinkCoords(int x, int y,
     ScopedAllowWaitForLegacyWebViewApi allow_wait;
     render_view_host->Send(new EwkViewMsg_DoHitTest(render_view_host->GetRoutingID(), x, y, mode));
     hit_test_completion_.Wait();
-    return new tizen_webview::Hit_Test(hit_test_params_);
+    return new _Ewk_Hit_Test(hit_test_params_);
   }
 
   return NULL;
index 959a743..4cba7b0 100644 (file)
@@ -38,6 +38,7 @@
 #include "private/ewk_back_forward_list_private.h"
 #include "private/ewk_settings_private.h"
 #include "private/ewk_web_application_icon_data_private.h"
+#include "public/ewk_hit_test.h"
 #include "public/ewk_view.h"
 #include "eweb_view_callbacks.h"
 #include "scroll_detector.h"
 #include "ui/gfx/geometry/point.h"
 #include "ui/gfx/geometry/size.h"
 #include "browser/inputpicker/InputPicker.h"
-#include "tizen_webview/public/tw_hit_test.h"
 #include "popup_controller_efl.h"
 
 #if defined(OS_TIZEN)
 #include "browser/selectpicker/popup_picker.h"
 #endif
 
-#include "tizen_webview/public/tw_hit_test.h"
 #include "tizen_webview/public/tw_callbacks.h"
 
 namespace content {
@@ -75,7 +74,6 @@ class TouchEvent;
 }
 
 namespace tizen_webview {
-class Hit_Test;
 class WebContext;
 class WebView;
 class WebViewDelegate;
@@ -84,6 +82,7 @@ class WebViewEvasEventHandler;
 
 class ErrorParams;
 class _Ewk_Policy_Decision;
+class _Ewk_Hit_Test;
 
 class WebAppScreenshotCapturedCallback : public base::RefCounted<WebAppScreenshotCapturedCallback> {
  public:
@@ -349,16 +348,15 @@ class EWebView {
       NavigationPolicyParams params, bool* handled);
   void UseSettingsFont();
 
-  tizen_webview::Hit_Test* RequestHitTestDataAt(int x, int y,
-      tizen_webview::Hit_Test_Mode mode);
+  _Ewk_Hit_Test* RequestHitTestDataAt(int x, int y, Ewk_Hit_Test_Mode mode);
   Eina_Bool AsyncRequestHitTestDataAt(int x, int y,
-      tizen_webview::Hit_Test_Mode mode,
+      Ewk_Hit_Test_Mode mode,
       tizen_webview::View_Hit_Test_Request_Callback,
       void* user_data);
-  tizen_webview::Hit_Test* RequestHitTestDataAtBlinkCoords(int x, int y,
-      tizen_webview::Hit_Test_Mode mode);
+  _Ewk_Hit_Test* RequestHitTestDataAtBlinkCoords(int x, int y,
+      Ewk_Hit_Test_Mode mode);
   Eina_Bool AsyncRequestHitTestDataAtBlinkCords(int x, int y,
-      tizen_webview::Hit_Test_Mode mode,
+      Ewk_Hit_Test_Mode mode,
       tizen_webview::View_Hit_Test_Request_Callback,
       void* user_data);
   void DispatchAsyncHitTestData(const Hit_Test_Params& params, int64_t request_id);
@@ -459,12 +457,12 @@ class EWebView {
   void InitializeContent();
   void EvasToBlinkCords(int x, int y, int* view_x, int* view_y);
   Eina_Bool AsyncRequestHitTestDataAtBlinkCords(int x, int y,
-      tizen_webview::Hit_Test_Mode mode,
+      Ewk_Hit_Test_Mode mode,
       WebViewAsyncRequestHitTestDataCallback* cb);
-  void HandleLongPressGesture(int x, int y, tizen_webview::Hit_Test_Mode mode,
-      tizen_webview::Hit_Test*);
-  void HandleTapGesture(int x, int y, tizen_webview::Hit_Test_Mode mode,
-      tizen_webview::Hit_Test*);
+  void HandleLongPressGesture(int x, int y, Ewk_Hit_Test_Mode mode,
+      _Ewk_Hit_Test*);
+  void HandleTapGesture(int x, int y, Ewk_Hit_Test_Mode mode,
+      _Ewk_Hit_Test*);
   content::WebContentsViewEfl* GetWebContentsViewEfl() const;
 
 #if defined(OS_TIZEN_MOBILE) && !defined(EWK_BRINGUP)
@@ -554,7 +552,7 @@ class EWebView {
 
 private:
   Eina_Bool AsyncRequestHitTestPrivate(
-      int x, int y, tizen_webview::Hit_Test_Mode mode,
+      int x, int y, Ewk_Hit_Test_Mode mode,
       AsyncHitTestRequest* asyncHitTestRequest);
 
   gfx::Vector2d previous_scroll_position_;
index 765e3ec..5bf0a85 100644 (file)
@@ -56,50 +56,6 @@ namespace chromium_glue {
 // To access enum values without namespace
 using namespace tizen_webview;
 
-tw::Hit_Test_Result_Context to(Ewk_Hit_Test_Result_Context val)
-{
-  GLUE_SET_FLAG_TO_INIT(res, val, static_cast<Ewk_Hit_Test_Result_Context>(0), static_cast<tw::Hit_Test_Result_Context>(0))
-  GLUE_SET_FLAG_TO(res, val, EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT, TW_HIT_TEST_RESULT_CONTEXT_DOCUMENT)
-  GLUE_SET_FLAG_TO(res, val, EWK_HIT_TEST_RESULT_CONTEXT_LINK, TW_HIT_TEST_RESULT_CONTEXT_LINK)
-  GLUE_SET_FLAG_TO(res, val, EWK_HIT_TEST_RESULT_CONTEXT_IMAGE, TW_HIT_TEST_RESULT_CONTEXT_IMAGE)
-  GLUE_SET_FLAG_TO(res, val, EWK_HIT_TEST_RESULT_CONTEXT_MEDIA, TW_HIT_TEST_RESULT_CONTEXT_MEDIA)
-  GLUE_SET_FLAG_TO(res, val, EWK_HIT_TEST_RESULT_CONTEXT_SELECTION, TW_HIT_TEST_RESULT_CONTEXT_SELECTION)
-  GLUE_SET_FLAG_TO(res, val, EWK_HIT_TEST_RESULT_CONTEXT_EDITABLE, TW_HIT_TEST_RESULT_CONTEXT_EDITABLE)
-  GLUE_SET_FLAG_TO(res, val, EWK_HIT_TEST_RESULT_CONTEXT_TEXT, TW_HIT_TEST_RESULT_CONTEXT_TEXT)
-  return static_cast<tw::Hit_Test_Result_Context>(res);
-}
-
-Ewk_Hit_Test_Result_Context from(tw::Hit_Test_Result_Context val)
-{
-  GLUE_SET_FLAG_FROM_INIT(res, val, static_cast<Ewk_Hit_Test_Result_Context>(0), static_cast<tw::Hit_Test_Result_Context>(0))
-  GLUE_SET_FLAG_FROM(res, val, EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT, TW_HIT_TEST_RESULT_CONTEXT_DOCUMENT)
-  GLUE_SET_FLAG_FROM(res, val, EWK_HIT_TEST_RESULT_CONTEXT_LINK, TW_HIT_TEST_RESULT_CONTEXT_LINK)
-  GLUE_SET_FLAG_FROM(res, val, EWK_HIT_TEST_RESULT_CONTEXT_IMAGE, TW_HIT_TEST_RESULT_CONTEXT_IMAGE)
-  GLUE_SET_FLAG_FROM(res, val, EWK_HIT_TEST_RESULT_CONTEXT_MEDIA, TW_HIT_TEST_RESULT_CONTEXT_MEDIA)
-  GLUE_SET_FLAG_FROM(res, val, EWK_HIT_TEST_RESULT_CONTEXT_SELECTION, TW_HIT_TEST_RESULT_CONTEXT_SELECTION)
-  GLUE_SET_FLAG_FROM(res, val, EWK_HIT_TEST_RESULT_CONTEXT_EDITABLE, TW_HIT_TEST_RESULT_CONTEXT_EDITABLE)
-  GLUE_SET_FLAG_FROM(res, val, EWK_HIT_TEST_RESULT_CONTEXT_TEXT, TW_HIT_TEST_RESULT_CONTEXT_TEXT)
-  return static_cast<Ewk_Hit_Test_Result_Context>(res);
-}
-
-tw::Hit_Test_Mode to(Ewk_Hit_Test_Mode val)
-{
-  GLUE_SET_FLAG_TO_INIT(res, val, static_cast<Ewk_Hit_Test_Mode>(0), static_cast<tw::Hit_Test_Mode>(0))
-  GLUE_SET_FLAG_TO(res, val, EWK_HIT_TEST_MODE_DEFAULT, TW_HIT_TEST_MODE_DEFAULT)
-  GLUE_SET_FLAG_TO(res, val, EWK_HIT_TEST_MODE_NODE_DATA, TW_HIT_TEST_MODE_NODE_DATA)
-  GLUE_SET_FLAG_TO(res, val, EWK_HIT_TEST_MODE_IMAGE_DATA, TW_HIT_TEST_MODE_IMAGE_DATA)
-  return static_cast<tw::Hit_Test_Mode>(res);
-}
-
-Ewk_Hit_Test_Mode from(tw::Hit_Test_Mode val)
-{
-  GLUE_SET_FLAG_FROM_INIT(res, val, static_cast<Ewk_Hit_Test_Mode>(0), static_cast<tw::Hit_Test_Mode>(0))
-  GLUE_SET_FLAG_FROM(res, val, EWK_HIT_TEST_MODE_DEFAULT, TW_HIT_TEST_MODE_DEFAULT)
-  GLUE_SET_FLAG_FROM(res, val, EWK_HIT_TEST_MODE_NODE_DATA, TW_HIT_TEST_MODE_NODE_DATA)
-  GLUE_SET_FLAG_FROM(res, val, EWK_HIT_TEST_MODE_IMAGE_DATA, TW_HIT_TEST_MODE_IMAGE_DATA)
-  return static_cast<Ewk_Hit_Test_Mode>(res);
-}
-
 tw::View_Hit_Test_Request_Callback to(Ewk_View_Hit_Test_Request_Callback callback)
 {
   return reinterpret_cast<tw::View_Hit_Test_Request_Callback>(callback);
index e3581a0..edaa081 100644 (file)
 #include "ewk_view.h"
 
 #include <tizen_webview/public/tw_callbacks.h>
-#include <tizen_webview/public/tw_hit_test.h>
 
 namespace chromium_glue {
 
 namespace tw = tizen_webview;
 
 // --- ewk<->chromium type conversion ---
-tw::Hit_Test_Mode to(Ewk_Hit_Test_Mode);
-Ewk_Hit_Test_Mode from(tw::Hit_Test_Mode);
-
-tw::Hit_Test_Result_Context to(Ewk_Hit_Test_Result_Context);
-Ewk_Hit_Test_Result_Context from(tw::Hit_Test_Result_Context);
-
 tw::View_Hit_Test_Request_Callback to(Ewk_View_Hit_Test_Request_Callback);
 
 } // namespace chromium_glue
index d05dafb..4528339 100644 (file)
@@ -4,25 +4,26 @@
 
 #include "ewk_hit_test_private.h"
 
-using namespace tizen_webview;
-
 static void FreeHitTestAttributeHashData(void* data) {
    eina_stringshare_del(static_cast<Eina_Stringshare*>(data));
  }
 
 _Ewk_Hit_Test::_Ewk_Hit_Test(const Hit_Test_Params& params)
-    : context(static_cast<tizen_webview::Hit_Test_Result_Context>(params.context)),
+    : context(static_cast<Ewk_Hit_Test_Result_Context>(params.context)),
       linkURI(params.linkURI),
       linkTitle(params.linkTitle),
       linkLabel(params.linkLabel),
       imageURI(params.imageURI),
       mediaURI(params.mediaURI),
       isEditable(params.isEditable),
-      mode(static_cast<tizen_webview::Hit_Test_Mode>(params.mode)),
+      mode(static_cast<Ewk_Hit_Test_Mode>(params.mode)),
       nodeData(params.nodeData),
       imageData(params.imageData) {
 }
 
+_Ewk_Hit_Test::~_Ewk_Hit_Test() {
+}
+
 _Ewk_Hit_Test::Hit_Test_Node_Data::Hit_Test_Node_Data(const Hit_Test_Params::Node_Data& data)
     : tagName(data.tagName),
       nodeValue(data.nodeValue),
@@ -47,11 +48,59 @@ _Ewk_Hit_Test::Hit_Test_Image_Buffer::Hit_Test_Image_Buffer(const Hit_Test_Param
   data.imageBitmap.deepCopyTo(&(imageBitmap));
 }
 
-// Use compiler generated constructor and destructor
-// No significant implementation is required.
 
-Ewk_Hit_Test* chromium_glue::from(tizen_webview::Hit_Test* val) {
-  // Down-casting to Ewk_Hit_Test is alright because it is the only class
-  // that inherits tizen_webview::Hit_Test
-  return static_cast<Ewk_Hit_Test*>(val);
+Ewk_Hit_Test_Result_Context _Ewk_Hit_Test::GetResultContext() const {
+  return context;
+}
+
+const char* _Ewk_Hit_Test::GetLinkUri() const {
+  return linkURI.c_str();
+}
+
+const char* _Ewk_Hit_Test::GetLinkTitle() const {
+  return linkTitle.c_str();
+}
+
+const char* _Ewk_Hit_Test::GetLinkLabel() const {
+  return linkLabel.c_str();
+}
+
+const char* _Ewk_Hit_Test::GetImageUri() const {
+  return imageURI.c_str();
+}
+
+const char* _Ewk_Hit_Test::GetImageFilenameExtension() const {
+  return imageData.fileNameExtension.c_str();
+}
+
+int _Ewk_Hit_Test::GetImageWidth() const {
+  return imageData.imageBitmap.width();
+}
+
+int _Ewk_Hit_Test::GetImageHeight() const {
+ return imageData.imageBitmap.height();
+}
+
+void* _Ewk_Hit_Test::GetImageBuffer() const {
+  return imageData.imageBitmap.getPixels();
+}
+
+size_t _Ewk_Hit_Test::GetImageBufferLength() const {
+  return imageData.imageBitmap.getSize();
+}
+
+const char* _Ewk_Hit_Test::GetMediaUri() const {
+  return mediaURI.c_str();
+}
+
+const char* _Ewk_Hit_Test::GetNodeTagName() const {
+  return nodeData.tagName.c_str();
+}
+
+const char* _Ewk_Hit_Test::GetNodeValue() const {
+  return nodeData.nodeValue.c_str();
+}
+
+Eina_Hash* _Ewk_Hit_Test::GetNodeAttributeHash() const {
+  return nodeData.attributeHash;
 }
index 4f13b43..3e4780d 100644 (file)
 #include <Eina.h>
 
 #include "common/hit_test_params.h"
-#include <tizen_webview/public/tw_hit_test.h>
+#include "public/ewk_hit_test.h"
 #include "third_party/skia/include/core/SkBitmap.h"
-#include "tizen_webview/public/tw_hit_test.h"
 
 typedef std::map<std::string, std::string> NodeAttributesMap;
 
-// Structure used to report hit test result
-struct _Ewk_Hit_Test {
+class _Ewk_Hit_Test {
+ public:
   explicit _Ewk_Hit_Test(const Hit_Test_Params& params);
+  ~_Ewk_Hit_Test();
 
-  tizen_webview::Hit_Test_Result_Context context;
-  std::string linkURI;
-  std::string linkTitle; // the title of link
-  std::string linkLabel; // the text of the link
-  std::string imageURI;
-  std::string mediaURI;
-  bool isEditable;
-  tizen_webview::Hit_Test_Mode mode;
+  Ewk_Hit_Test_Result_Context GetResultContext() const;
+
+  const char* GetLinkUri() const;
+  const char* GetLinkTitle() const;
+  const char* GetLinkLabel() const;
+
+  const char* GetImageUri() const;
+  const char* GetImageFilenameExtension() const;
+  int         GetImageWidth() const;
+  int         GetImageHeight() const;
+  void*       GetImageBuffer() const;
+  size_t      GetImageBufferLength() const;
+
+  const char* GetMediaUri() const;
+
+  const char* GetNodeTagName() const;
+  const char* GetNodeValue() const;
+  Eina_Hash*  GetNodeAttributeHash() const;
+
+ private:
+  const Ewk_Hit_Test_Result_Context context;
+  const std::string linkURI;
+  const std::string linkTitle; // the title of link
+  const std::string linkLabel; // the text of the link
+  const std::string imageURI;
+  const std::string mediaURI;
+  const bool isEditable;
+  const Ewk_Hit_Test_Mode mode;
 
   // store node attributes in a map
-  struct Hit_Test_Node_Data {
+  const class Hit_Test_Node_Data {
+   public:
     explicit Hit_Test_Node_Data(const Hit_Test_Params::Node_Data& data);
     ~Hit_Test_Node_Data();
 
-    std::string tagName;      // tag name for hit element
-    std::string nodeValue;    // node value for hit element
+    const std::string tagName;      // tag name for hit element
+    const std::string nodeValue;    // node value for hit element
     Eina_Hash* attributeHash; // attribute data for hit element
+
+   private:
+    DISALLOW_COPY_AND_ASSIGN(Hit_Test_Node_Data);
   } nodeData;
 
   // when hit node is image we need to store image buffer and filename extension
-  struct Hit_Test_Image_Buffer {
+  const class Hit_Test_Image_Buffer {
+   public:
     explicit Hit_Test_Image_Buffer(const Hit_Test_Params::Image_Data& data);
 
-    std::string fileNameExtension; // image filename extension for hit element
+    const std::string fileNameExtension; // image filename extension for hit element
     SkBitmap imageBitmap;          // image pixels data
+
+   private:
+    DISALLOW_COPY_AND_ASSIGN(Hit_Test_Image_Buffer);
   } imageData;
-};
 
-struct Ewk_Hit_Test : public tizen_webview::Hit_Test {
+  DISALLOW_COPY_AND_ASSIGN(_Ewk_Hit_Test);
 };
 
-namespace chromium_glue {
-  Ewk_Hit_Test* from(tizen_webview::Hit_Test*);
-}
 
 #endif // ewk_hit_test_private_h
index 02ddc8a..88c7475 100644 (file)
@@ -9,9 +9,6 @@
 #include "public/ewk_view.h"
 #include "private/chromium_glue.h"
 #include "private/ewk_hit_test_private.h"
-#include "tizen_webview/public/tw_hit_test.h"
-
-using namespace tizen_webview;
 
 void ewk_hit_test_free(Ewk_Hit_Test* hitTest)
 {
@@ -21,7 +18,7 @@ void ewk_hit_test_free(Ewk_Hit_Test* hitTest)
 Ewk_Hit_Test_Result_Context ewk_hit_test_result_context_get(Ewk_Hit_Test* hitTest)
 {
   EINA_SAFETY_ON_NULL_RETURN_VAL(hitTest, EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT);
-  return chromium_glue::from(hitTest->GetResultContext());
+  return hitTest->GetResultContext();
 }
 
 const char* ewk_hit_test_link_uri_get(Ewk_Hit_Test* hitTest)
index c649ba4..224d7e5 100644 (file)
@@ -52,7 +52,7 @@ typedef enum {
 } Ewk_Hit_Test_Result_Context;
 
 /** Creates a type name for _Ewk_Hit_Test */
-typedef struct Ewk_Hit_Test Ewk_Hit_Test;
+typedef struct _Ewk_Hit_Test Ewk_Hit_Test;
 
 /**
  * Frees hit test instance created by ewk_view_hit_test_new().
index b4d3f12..8d28c88 100644 (file)
@@ -631,14 +631,14 @@ Eina_Bool ewk_view_mhtml_data_get(Evas_Object *view, Ewk_View_MHTML_Data_Get_Cal
 Ewk_Hit_Test* ewk_view_hit_test_new(Evas_Object* ewkView, int x, int y, int hit_test_mode)
 {
   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, 0);
-  return chromium_glue::from(impl->RequestHitTestDataAt(x, y,
-      chromium_glue::to(static_cast<Ewk_Hit_Test_Mode>(hit_test_mode))));
+  return impl->RequestHitTestDataAt(x, y,
+      static_cast<Ewk_Hit_Test_Mode>(hit_test_mode));
 }
 
 Eina_Bool ewk_view_hit_test_request(Evas_Object* o, int x, int y, int hit_test_mode, Ewk_View_Hit_Test_Request_Callback callback, void* user_data)
 {
   EWK_VIEW_IMPL_GET_OR_RETURN(o, impl, EINA_FALSE);
-  return impl->AsyncRequestHitTestDataAt(x, y, chromium_glue::to(static_cast<Ewk_Hit_Test_Mode>(hit_test_mode)), chromium_glue::to(callback), user_data);
+  return impl->AsyncRequestHitTestDataAt(x, y, static_cast<Ewk_Hit_Test_Mode>(hit_test_mode), chromium_glue::to(callback), user_data);
 }
 
 Ewk_History* ewk_view_history_get(Evas_Object* ewkView)
index 46aadf8..8410281 100644 (file)
@@ -97,29 +97,29 @@ void PopulateEwkHitTestData(const blink::WebHitTestResult& web_hit_test, Hit_Tes
   params->linkTitle = web_hit_test.titleDisplayString().utf8();
   params->isEditable = web_hit_test.isContentEditable();
 
-  int context = TW_HIT_TEST_RESULT_CONTEXT_DOCUMENT;
+  int context = EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT;
   if (!web_hit_test.absoluteLinkURL().isEmpty())
-    context |= TW_HIT_TEST_RESULT_CONTEXT_LINK;
+    context |= EWK_HIT_TEST_RESULT_CONTEXT_LINK;
   if (!web_hit_test.absoluteImageURL().isEmpty())
-    context |= TW_HIT_TEST_RESULT_CONTEXT_IMAGE;
+    context |= EWK_HIT_TEST_RESULT_CONTEXT_IMAGE;
   if (!web_hit_test.absoluteMediaURL().isEmpty())
-    context |= TW_HIT_TEST_RESULT_CONTEXT_MEDIA;;
+    context |= EWK_HIT_TEST_RESULT_CONTEXT_MEDIA;;
   if (web_hit_test.isSelected())
-    context |= TW_HIT_TEST_RESULT_CONTEXT_SELECTION;
+    context |= EWK_HIT_TEST_RESULT_CONTEXT_SELECTION;
   if (web_hit_test.isContentEditable())
-    context |= TW_HIT_TEST_RESULT_CONTEXT_EDITABLE;
+    context |= EWK_HIT_TEST_RESULT_CONTEXT_EDITABLE;
   if (web_hit_test.node().isTextNode())
-    context |= TW_HIT_TEST_RESULT_CONTEXT_TEXT;
+    context |= EWK_HIT_TEST_RESULT_CONTEXT_TEXT;
 
-  params->context = static_cast<tizen_webview::Hit_Test_Result_Context>(context);
+  params->context = static_cast<Ewk_Hit_Test_Result_Context>(context);
 
-  if (params->mode & TW_HIT_TEST_MODE_NODE_DATA) {
+  if (params->mode & EWK_HIT_TEST_MODE_NODE_DATA) {
     params->nodeData.tagName = web_hit_test.node().nodeName().utf8();
     params->nodeData.nodeValue = web_hit_test.node().nodeValue().utf8();
   }
 
-  if ((params->mode & TW_HIT_TEST_MODE_IMAGE_DATA) &&
-      (params->context & TW_HIT_TEST_RESULT_CONTEXT_IMAGE)) {
+  if ((params->mode & EWK_HIT_TEST_MODE_IMAGE_DATA) &&
+      (params->context & EWK_HIT_TEST_RESULT_CONTEXT_IMAGE)) {
     blink::WebElement hit_element = web_hit_test.node().toConst<blink::WebElement>();
 
     params->imageData.imageBitmap = hit_element.imageContents().getSkBitmap();
@@ -283,7 +283,7 @@ void RenderViewObserverEfl::OnGetSelectionStyle()
   Send(new EwkViewMsg_SelectionTextStyleState(render_view()->GetRoutingID(), params));
 }
 
-void RenderViewObserverEfl::OnDoHitTest(int view_x, int view_y, tizen_webview::Hit_Test_Mode mode)
+void RenderViewObserverEfl::OnDoHitTest(int view_x, int view_y, Ewk_Hit_Test_Mode mode)
 {
   Hit_Test_Params params;
 
@@ -292,7 +292,7 @@ void RenderViewObserverEfl::OnDoHitTest(int view_x, int view_y, tizen_webview::H
   }
 }
 
-void RenderViewObserverEfl::OnDoHitTestAsync(int view_x, int view_y, tizen_webview::Hit_Test_Mode mode, int64_t request_id)
+void RenderViewObserverEfl::OnDoHitTestAsync(int view_x, int view_y, Ewk_Hit_Test_Mode mode, int64_t request_id)
 {
   Hit_Test_Params params;
 
@@ -301,7 +301,7 @@ void RenderViewObserverEfl::OnDoHitTestAsync(int view_x, int view_y, tizen_webvi
   }
 }
 
-bool RenderViewObserverEfl::DoHitTest(int view_x, int view_y, tizen_webview::Hit_Test_Mode mode, Hit_Test_Params* params)
+bool RenderViewObserverEfl::DoHitTest(int view_x, int view_y, Ewk_Hit_Test_Mode mode, Hit_Test_Params* params)
 {
   DCHECK(params);
 
@@ -318,7 +318,7 @@ bool RenderViewObserverEfl::DoHitTest(int view_x, int view_y, tizen_webview::Hit
   params->mode = mode;
 
   PopulateEwkHitTestData(web_hit_test_result, params);
-  if (params->mode & TW_HIT_TEST_MODE_NODE_DATA)
+  if (params->mode & EWK_HIT_TEST_MODE_NODE_DATA)
     PopulateNodeAttributesMapFromHitTest(web_hit_test_result, params);
 
   return true;
index 8db0c43..53a0a8f 100644 (file)
 #include "renderer/print_web_view_helper_efl.h"
 #include "content/public/renderer/render_view_observer.h"
 #include "private/ewk_hit_test_private.h"
+#include "public/ewk_hit_test.h"
 #include "public/ewk_view.h"
 #include "third_party/WebKit/public/platform/WebSize.h"
 #include "third_party/WebKit/public/web/WebViewModeEnums.h"
-#include "tizen_webview/public/tw_hit_test.h"
 
 namespace base {
 class FilePath;
@@ -73,9 +73,9 @@ class RenderViewObserverEfl: public content::RenderViewObserver {
   void OnUseSettingsFont();
   void OnPlainTextGet(int plain_text_get_callback_id);
   void OnGetSelectionStyle();
-  void OnDoHitTest(int x, int y, tizen_webview::Hit_Test_Mode mode);
-  void OnDoHitTestAsync(int view_x, int view_y, tizen_webview::Hit_Test_Mode mode, int64_t request_id);
-  bool DoHitTest(int view_x, int view_y, tizen_webview::Hit_Test_Mode mode, Hit_Test_Params* params);
+  void OnDoHitTest(int x, int y, Ewk_Hit_Test_Mode mode);
+  void OnDoHitTestAsync(int view_x, int view_y, Ewk_Hit_Test_Mode mode, int64_t request_id);
+  bool DoHitTest(int view_x, int view_y, Ewk_Hit_Test_Mode mode, Hit_Test_Params* params);
   void OnPrintToPdf(int width, int height, const base::FilePath& filename);
   void OnGetMHTMLData(int callback_id);
   void OnSetDrawsTransparentBackground(bool enabled);
index 75638b1..289e99a 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "content/browser/renderer_host/render_widget_host_view_efl.h"
 #include "eweb_view.h"
-#include "tizen_webview/public/tw_hit_test.h"
+#include "public/ewk_hit_test.h"
 
 using namespace tizen_webview;
 
@@ -180,7 +180,7 @@ private:
 } // namespace
 
 void SelectionControllerEfl::ShowHandleAndContextMenuIfRequiredCallback(
-    Evas_Object* o, int x, int y, int mode, tizen_webview::Hit_Test* hit_test,
+    Evas_Object* o, int x, int y, int mode, _Ewk_Hit_Test* hit_test,
     void* data) {
   HitTestContext* context = static_cast<HitTestContext*>(data);
   DCHECK(context);
@@ -192,7 +192,7 @@ void SelectionControllerEfl::ShowHandleAndContextMenuIfRequiredCallback(
 
 void SelectionControllerEfl::ShowHandleAndContextMenuIfRequired(
     Evas_Object* o, int x, int y, int /* mode*/,
-    tizen_webview::Hit_Test* hit_test, bool anchor_first) {
+    _Ewk_Hit_Test* hit_test, bool anchor_first) {
   if (scrolling_)
     return;
 
@@ -213,7 +213,7 @@ void SelectionControllerEfl::ShowHandleAndContextMenuIfRequired(
   if (selection_data_->IsInEditField() && left == right) {
 
     if (hit_test &&
-        !(hit_test->GetResultContext() & tizen_webview::TW_HIT_TEST_RESULT_CONTEXT_EDITABLE)) {
+        !(hit_test->GetResultContext() & EWK_HIT_TEST_RESULT_CONTEXT_EDITABLE)) {
       postponed_ = true;
       return;
     }
@@ -302,7 +302,7 @@ void SelectionControllerEfl::ShowHandleAndContextMenuIfRequired(
   parent_view_->AsyncRequestHitTestDataAt(
       hitX,
       hitY,
-      tizen_webview::TW_HIT_TEST_MODE_DEFAULT,
+      EWK_HIT_TEST_MODE_DEFAULT,
       ShowHandleAndContextMenuIfRequiredCallback,
       ctx);
 }
@@ -436,25 +436,25 @@ void SelectionControllerEfl::GetSelectionBounds(gfx::Rect* left,
 }
 
 void SelectionControllerEfl::HandleLongPressEvent(
-    const gfx::Point& touch_point, tizen_webview::Hit_Test_Result_Context context) {
-  if (context & TW_HIT_TEST_RESULT_CONTEXT_EDITABLE) {
+    const gfx::Point& touch_point, Ewk_Hit_Test_Result_Context context) {
+  if (context & EWK_HIT_TEST_RESULT_CONTEXT_EDITABLE) {
     SetSelectionStatus(true);
     SetSelectionEditable(true);
     HandleLongPressEventPrivate(touch_point);
-  } else if (!(context & TW_HIT_TEST_RESULT_CONTEXT_LINK)
-      && !(context & TW_HIT_TEST_RESULT_CONTEXT_IMAGE)
-      && !(context & TW_HIT_TEST_RESULT_CONTEXT_MEDIA)
-      && context & TW_HIT_TEST_RESULT_CONTEXT_TEXT) {
+  } else if (!(context & EWK_HIT_TEST_RESULT_CONTEXT_LINK)
+      && !(context & EWK_HIT_TEST_RESULT_CONTEXT_IMAGE)
+      && !(context & EWK_HIT_TEST_RESULT_CONTEXT_MEDIA)
+      && context & EWK_HIT_TEST_RESULT_CONTEXT_TEXT) {
     SetSelectionStatus(true);
     HandleLongPressEventPrivate(touch_point);
     LOG(INFO) << __PRETTY_FUNCTION__ << ":: link, !image, !media, text";
-  } else if (context & TW_HIT_TEST_RESULT_CONTEXT_DOCUMENT) {
-    LOG(INFO) << __PRETTY_FUNCTION__ << ":: TW_HIT_TEST_RESULT_CONTEXT_DOCUMENT";
-  } else if (context & TW_HIT_TEST_RESULT_CONTEXT_IMAGE) {
-    LOG(INFO) << __PRETTY_FUNCTION__ << ":: TW_HIT_TEST_RESULT_CONTEXT_IMAGE";
-  } else if (context & TW_HIT_TEST_RESULT_CONTEXT_LINK) {
+  } else if (context & EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT) {
+    LOG(INFO) << __PRETTY_FUNCTION__ << ":: EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT";
+  } else if (context & EWK_HIT_TEST_RESULT_CONTEXT_IMAGE) {
+    LOG(INFO) << __PRETTY_FUNCTION__ << ":: EWK_HIT_TEST_RESULT_CONTEXT_IMAGE";
+  } else if (context & EWK_HIT_TEST_RESULT_CONTEXT_LINK) {
     ClearSelectionViaEWebView();
-    LOG(INFO) << __PRETTY_FUNCTION__ << ":: TW_HIT_TEST_RESULT_CONTEXT_LINK";
+    LOG(INFO) << __PRETTY_FUNCTION__ << ":: EWK_HIT_TEST_RESULT_CONTEXT_LINK";
   } else {
     LOG(INFO) << __PRETTY_FUNCTION__ << ":: hit_test = " << context;
   }
@@ -501,9 +501,9 @@ void SelectionControllerEfl::HandleLongPressEndEvent() {
 }
 
 void SelectionControllerEfl::HandleTapEvent(
-    const gfx::Point& touch_point, tizen_webview::Hit_Test_Result_Context context) {
-  if (context & TW_HIT_TEST_RESULT_CONTEXT_EDITABLE) {
-    LOG(INFO) << "DispatchPostponedGestureEvent :: TW_HIT_TEST_RESULT_CONTEXT_EDITABLE";
+    const gfx::Point& touch_point, Ewk_Hit_Test_Result_Context context) {
+  if (context & EWK_HIT_TEST_RESULT_CONTEXT_EDITABLE) {
+    LOG(INFO) << "DispatchPostponedGestureEvent :: EWK_HIT_TEST_RESULT_CONTEXT_EDITABLE";
     SetSelectionStatus(true);
     if (GetSelectionEditable()){
       SetCaretSelectionStatus(true);
@@ -513,9 +513,9 @@ void SelectionControllerEfl::HandleTapEvent(
       SetSelectionEditable(true);
     }
   } else {
-    if (context & TW_HIT_TEST_RESULT_CONTEXT_DOCUMENT)
+    if (context & EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT)
       LOG(INFO) << __PRETTY_FUNCTION__ << " DOCUMENT";
-    if (context & TW_HIT_TEST_RESULT_CONTEXT_TEXT)
+    if (context & EWK_HIT_TEST_RESULT_CONTEXT_TEXT)
       LOG(INFO) << __PRETTY_FUNCTION__ << " TEXT";
 
     SetSelectionEditable(false);
index b1a692e..065a6bb 100644 (file)
@@ -7,13 +7,13 @@
 
 #include "base/memory/scoped_ptr.h"
 #include "base/strings/string16.h"
+#include "public/ewk_hit_test.h"
 #include "selection_box_efl.h"
 #include "selection_handle_efl.h"
 #include "selection_magnifier_efl.h"
 #include "ui/gfx/range/range.h"
 #include "ui/gfx/geometry/rect.h"
 #include "tizen_webview/public/tw_selection_controller.h"
-#include "tizen_webview/public/tw_hit_test.h"
 
 #if defined(OS_TIZEN)
 #include "vconf/vconf.h"
@@ -47,11 +47,11 @@ class SelectionControllerEfl : public tizen_webview::SelectionController {
   explicit SelectionControllerEfl(EWebView* parent_view, WebContents& web_contents);
 
   // Functions that handle long press, long press move and release
-  void HandleLongPressEvent(const gfx::Point& touch_point, tizen_webview::Hit_Test_Result_Context);
+  void HandleLongPressEvent(const gfx::Point& touch_point, Ewk_Hit_Test_Result_Context);
   void HandleLongPressMoveEvent(const gfx::Point& touch_point);
   void HandleLongPressEndEvent();
 
-  void HandleTapEvent(const gfx::Point& touch_point, tizen_webview::Hit_Test_Result_Context);
+  void HandleTapEvent(const gfx::Point& touch_point, Ewk_Hit_Test_Result_Context);
 
   // Set if selection is valid
   void SetSelectionStatus(bool enable);
@@ -116,9 +116,9 @@ class SelectionControllerEfl : public tizen_webview::SelectionController {
   // updates the selection handles and context menu as a registered callback.
   void ShowHandleAndContextMenuIfRequired(bool anchor_first = true);
   void ShowHandleAndContextMenuIfRequired(Evas_Object*,
-      int x, int y, int mode, tizen_webview::Hit_Test*, bool anchor_first);
+      int x, int y, int mode, _Ewk_Hit_Test*, bool anchor_first);
   static void ShowHandleAndContextMenuIfRequiredCallback(Evas_Object*,
-      int x, int y, int mode, tizen_webview::Hit_Test*, void* data);
+      int x, int y, int mode, _Ewk_Hit_Test*, void* data);
 
   void Clear(bool show_after_scroll = false);
   bool IsSelectionValid(const gfx::Rect& left_rect, const gfx::Rect& right_rect);
index 2611b95..6d84c2e 100644 (file)
@@ -9,9 +9,9 @@
 #include <Evas.h>
 
 class Ewk_Notification_Permission_Request;
+class _Ewk_Hit_Test;
 
 namespace tizen_webview {
-class Hit_Test;
 
 // from ewk_context.h
 typedef void (*Local_File_System_Origins_Get_Callback)(Eina_List *origins, void *user_data);
@@ -112,7 +112,7 @@ typedef Eina_Bool (*View_JavaScript_Prompt_Callback)(Evas_Object* o, const char*
 //typedef Eina_Bool (*View_Exceeded_Database_Quota_Callback)(Evas_Object* o, Ewk_Security_Origin* origin, const char* database_name, unsigned long long expectedQuota, void* user_data);
 //typedef Eina_Bool (*View_Exceeded_Local_File_System_Quota_Callback)(Evas_Object* o, Ewk_Security_Origin* origin, long long currentQuota, void* user_data);
 typedef Eina_Bool (*Orientation_Lock_Cb)(Evas_Object* o, Eina_Bool need_lock, int orientation, void* user_data);
-typedef void (*View_Hit_Test_Request_Callback)(Evas_Object* o, int x, int y, int hit_test_mode, Hit_Test* hit_test, void* user_data);
+typedef void (*View_Hit_Test_Request_Callback)(Evas_Object* o, int x, int y, int hit_test_mode, _Ewk_Hit_Test* hit_test, void* user_data);
 typedef Eina_Bool (*View_Geolocation_Permission_Callback)(Evas_Object* view, void* geolocation_permission_context, void* user_data);
 
 // Enum values used to specify focus direction options.
diff --git a/tizen_src/ewk/efl_integration/tizen_webview/public/tw_hit_test.cc b/tizen_src/ewk/efl_integration/tizen_webview/public/tw_hit_test.cc
deleted file mode 100644 (file)
index 55e6ad7..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (c) 2014 The Chromium Authors. All rights reserved.
-// Copyright 2014 Samsung Electronics. 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_hit_test.h"
-
-#include <algorithm>
-
-#include "private/ewk_hit_test_private.h"
-
-namespace tizen_webview {
-
-Hit_Test::Hit_Test(const Hit_Test_Params& params)
-    : impl (new _Ewk_Hit_Test(params)) {
-}
-
-Hit_Test::~Hit_Test() {
-  delete impl;
-}
-
-tizen_webview::Hit_Test_Result_Context Hit_Test::GetResultContext() const {
-  return impl->context;
-}
-
-const char* Hit_Test::GetLinkUri() const {
-  return impl->linkURI.c_str();
-}
-
-const char* Hit_Test::GetLinkTitle() const {
-  return impl->linkTitle.c_str();
-}
-
-const char* Hit_Test::GetLinkLabel() const {
-  return impl->linkLabel.c_str();
-}
-
-const char* Hit_Test::GetImageUri() const {
-  return impl->imageURI.c_str();
-}
-
-const char* Hit_Test::GetImageFilenameExtension() const {
-  return impl->imageData.fileNameExtension.c_str();
-}
-
-int Hit_Test::GetImageWidth() const {
-  return impl->imageData.imageBitmap.width();
-}
-
-int Hit_Test::GetImageHeight() const {
- return  impl->imageData.imageBitmap.height();
-}
-
-void* Hit_Test::GetImageBuffer() const {
-  return impl->imageData.imageBitmap.getPixels();
-}
-
-size_t Hit_Test::GetImageBufferLength() const {
-  return impl->imageData.imageBitmap.getSize();
-}
-
-const char* Hit_Test::GetMediaUri() const {
-  return impl->mediaURI.c_str();
-}
-
-const char* Hit_Test::GetNodeTagName() const {
-  return impl->nodeData.tagName.c_str();
-}
-
-const char* Hit_Test::GetNodeValue() const {
-  return impl->nodeData.nodeValue.c_str();
-}
-
-Eina_Hash* Hit_Test::GetNodeAttributeHash() const {
-  return impl->nodeData.attributeHash;
-}
-
-} // namespace tizen_webview
diff --git a/tizen_src/ewk/efl_integration/tizen_webview/public/tw_hit_test.h b/tizen_src/ewk/efl_integration/tizen_webview/public/tw_hit_test.h
deleted file mode 100644 (file)
index 603be74..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright (c) 2014 The Chromium Authors. All rights reserved.
-// Copyright 2014 Samsung Electronics. 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_HIT_TEST_MODE_H_
-#define TIZEN_WEBVIEW_PUBLIC_TW_HIT_TEST_MODE_H_
-
-#include <eina_hash.h>
-#include <cstddef>   // Provides size_t
-
-#include "common/hit_test_params.h"
-
-struct _Ewk_Hit_Test;
-class EWebView;
-
-namespace tizen_webview {
-
-/**
- * Hit_Test_Mode:
- * @TW_HIT_TEST_MODE_DEFAULT: link data.
- * @TW_HIT_TEST_MODE_NODE_DATA: extra node data(tag name, node value, attribute information, etc).
- * @TW_HIT_TEST_MODE_IMAGE_DATA: extra image data(image data, image data length, image file name extension, etc).
- * @TW_HIT_TEST_MODE_ALL: all data.
- *
- * Enum values with flags representing the hit test mode.
- */
-enum Hit_Test_Mode {
-  TW_HIT_TEST_MODE_DEFAULT = 1 << 1,
-  TW_HIT_TEST_MODE_NODE_DATA = 1 << 2,
-  TW_HIT_TEST_MODE_IMAGE_DATA = 1 << 3,
-  TW_HIT_TEST_MODE_ALL = TW_HIT_TEST_MODE_DEFAULT | TW_HIT_TEST_MODE_NODE_DATA | TW_HIT_TEST_MODE_IMAGE_DATA
-};
-
-/**
- * Hit_Test_Result_Context:
- * @TW_HIT_TEST_RESULT_CONTEXT_DOCUMENT: anywhere in the document.
- * @TW_HIT_TEST_RESULT_CONTEXT_LINK: a hyperlink element.
- * @TW_HIT_TEST_RESULT_CONTEXT_IMAGE: an image element.
- * @TW_HIT_TEST_RESULT_CONTEXT_MEDIA: a video or audio element.
- * @TW_HIT_TEST_RESULT_CONTEXT_SELECTION: the area is selected by the user.
- * @TW_HIT_TEST_RESULT_CONTEXT_EDITABLE: the area is editable by the user.
- * @TW_HIT_TEST_RESULT_CONTEXT_TEXT: the area is text.
- *
- * Enum values with flags representing the context of a #Ewk_Hit_Test.
- */
-enum Hit_Test_Result_Context {
-  TW_HIT_TEST_RESULT_CONTEXT_DOCUMENT = 1 << 1,
-  TW_HIT_TEST_RESULT_CONTEXT_LINK = 1 << 2,
-  TW_HIT_TEST_RESULT_CONTEXT_IMAGE = 1 << 3,
-  TW_HIT_TEST_RESULT_CONTEXT_MEDIA = 1 << 4,
-  TW_HIT_TEST_RESULT_CONTEXT_SELECTION = 1 << 5,
-  TW_HIT_TEST_RESULT_CONTEXT_EDITABLE = 1 << 6,
-  TW_HIT_TEST_RESULT_CONTEXT_TEXT = 1 << 7
-};
-
-
-class Hit_Test {
- public:
-  explicit Hit_Test(const Hit_Test_Params& params);
-  ~Hit_Test();
-
-  Hit_Test_Result_Context GetResultContext() const;
-
-  const char* GetLinkUri() const;
-  const char* GetLinkTitle() const;
-  const char* GetLinkLabel() const;
-
-  const char* GetImageUri() const;
-  const char* GetImageFilenameExtension() const;
-  int         GetImageWidth() const;
-  int         GetImageHeight() const;
-  void*       GetImageBuffer() const;
-  size_t      GetImageBufferLength() const;
-
-  const char* GetMediaUri() const;
-
-  const char* GetNodeTagName() const;
-  const char* GetNodeValue() const;
-  Eina_Hash*  GetNodeAttributeHash() const;
-
- private:
-  typedef _Ewk_Hit_Test Hit_Test_Impl;
-  Hit_Test_Impl* impl;
-
-  friend class ::EWebView;
-};
-
-} // namespace tizen_webview
-
-#endif  // TIZEN_WEBVIEW_PUBLIC_TW_HIT_TEST_MODE_H_
index 6203478..6551799 100644 (file)
@@ -345,18 +345,14 @@ void WebView::HandleTouchEvents(Ewk_Touch_Event_Type type, const Eina_List *poin
   return impl_->HandleTouchEvents(type, point, modifiers);
 }
 
-Hit_Test* WebView::RequestHitTestDataAt(int x, int y, Hit_Test_Mode mode) {
+_Ewk_Hit_Test* WebView::RequestHitTestDataAt(int x, int y, Ewk_Hit_Test_Mode mode) {
   return impl_->RequestHitTestDataAt(x, y, mode);
 }
 
-Eina_Bool WebView::AsyncRequestHitTestDataAt(int x, int y, tizen_webview::Hit_Test_Mode mode, tizen_webview::View_Hit_Test_Request_Callback callback, void* user_data)
+Eina_Bool WebView::AsyncRequestHitTestDataAt(int x, int y, Ewk_Hit_Test_Mode mode, tizen_webview::View_Hit_Test_Request_Callback callback, void* user_data)
 {
   return impl_->AsyncRequestHitTestDataAt(x, y, mode, callback, user_data);
 }
-//
-//void WebView::UpdateHitTestData(const Hit_Test& hit_test_data, const NodeAttributesMap& node_attributes) {
-//  return impl_->UpdateHitTestData(hit_test_data, node_attributes);
-//}
 
 void WebView::QuerySelectionStyle() {
   return impl_->QuerySelectionStyle();
index 60f367d..6389702 100644 (file)
@@ -13,8 +13,8 @@
 #include "base/macros.h"
 #include "content/public/browser/navigation_controller.h"
 #include "tizen_webview/public/tw_callbacks.h"
-#include "tizen_webview/public/tw_hit_test.h"
 #include "ewk_touch.h"
+#include "public/ewk_hit_test.h"
 #include "public/ewk_view.h"
 #include "third_party/WebKit/public/web/WebViewModeEnums.h"
 
@@ -149,8 +149,8 @@ class WebView {
   bool TouchEventsEnabled() const;
   void SetTouchEventsEnabled(bool enabled);
   void HandleTouchEvents(Ewk_Touch_Event_Type type, const Eina_List *point, const Evas_Modifier *modifiers);
-  Hit_Test* RequestHitTestDataAt(int x, int y, Hit_Test_Mode mode);
-  Eina_Bool AsyncRequestHitTestDataAt(int x, int y, tizen_webview::Hit_Test_Mode mode, tizen_webview::View_Hit_Test_Request_Callback, void* user_data);
+  _Ewk_Hit_Test* RequestHitTestDataAt(int x, int y, Ewk_Hit_Test_Mode mode);
+  Eina_Bool AsyncRequestHitTestDataAt(int x, int y, Ewk_Hit_Test_Mode mode, tizen_webview::View_Hit_Test_Request_Callback, void* user_data);
 
   // ---- Selection
   void QuerySelectionStyle();