[M67 Dev][EWK] Classify EWK APIs by public, internal, or product
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / efl_integration / public / ewk_view.cc
index 849367c..3b95f8e 100644 (file)
  *
  */
 
-#include "ewk_view.h"
+#include "ewk_view_product.h"
 
 #include <Evas.h>
 
-#if !defined(EWK_BRINGUP)
+#if !defined(EWK_BRINGUP)  // FIXME: m67 bringup
 #include "webkit/common/webpreferences.h"
 #else
 #include "content/public/common/web_preferences.h"
@@ -36,7 +36,7 @@
 #include "notification_permission_popup.h"
 #include "public/ewk_back_forward_list.h"
 #include "public/ewk_context.h"
-#include "public/ewk_enums.h"
+#include "public/ewk_enums_internal.h"
 #include "public/ewk_settings.h"
 #include "private/ewk_context_private.h"
 #include "private/ewk_frame_private.h"
 #include "private/ewk_back_forward_list_private.h"
 #include "private/ewk_history_private.h"
 #include "private/ewk_view_private.h"
-#include "third_party/WebKit/public/web/WebViewModeEnums.h"
+// FIXME: removed on m63
+//#include "third_party/blink/public/web/WebViewModeEnums.h"
 #include "ui/events/gesture_detection/gesture_configuration.h"
+#include "url/gurl.h"
 #include "usermedia_permission_popup.h"
 #include "web_contents_delegate_efl.h"
 
@@ -129,10 +131,11 @@ Ewk_Context *ewk_view_context_get(const Evas_Object *view)
   return static_cast<Ewk_Context*>(impl->context());
 }
 
-Eina_Bool ewk_view_url_set(Evas_Object* view, const char* url)
+Eina_Bool ewk_view_url_set(Evas_Object* view, const char* url_string)
 {
   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false);
-  EINA_SAFETY_ON_NULL_RETURN_VAL(url, false);
+  EINA_SAFETY_ON_NULL_RETURN_VAL(url_string, false);
+  GURL url(url_string);
   impl->SetURL(url);
   return true;
 }
@@ -140,7 +143,7 @@ Eina_Bool ewk_view_url_set(Evas_Object* view, const char* url)
 const char* ewk_view_url_get(const Evas_Object* view)
 {
   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, 0);
-  return impl->GetURL();
+  return impl->GetURL().possibly_invalid_spec().c_str();
 }
 
 
@@ -155,7 +158,7 @@ Eina_Bool ewk_view_reload(Evas_Object *view)
 Eina_Bool ewk_view_reload_bypass_cache(Evas_Object *view)
 {
   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false);
-  impl->ReloadIgnoringCache();
+  impl->ReloadBypassingCache();
   return true;
 }
 
@@ -313,7 +316,7 @@ Eina_Bool ewk_view_url_request_set(Evas_Object* ewkView, const char* url, Ewk_Ht
     loadtype = content::NavigationController::LOAD_TYPE_DEFAULT;
     break;
   case EWK_HTTP_METHOD_POST:
-    loadtype = content::NavigationController::LOAD_TYPE_BROWSER_INITIATED_HTTP_POST;
+    loadtype = content::NavigationController::LOAD_TYPE_HTTP_POST;
     break;
   default:
     LOG(ERROR) << "Not supported HTTP Method.";
@@ -347,18 +350,23 @@ Eina_Bool ewk_view_html_contents_set(Evas_Object* view, const char* html, const
 
 Eina_Bool ewk_view_page_visibility_state_set(Evas_Object* ewkView, Ewk_Page_Visibility_State page_visibility_state, Eina_Bool initial_state)
 {
-  EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl,false);
+  // TODO: Should we send initial_state to |Page::setVisibilityState()|?.
+  // isInitialState parameter seems be true only in the constructor of WebViewImpl.
+  EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false);
+
+  // TODO: We should able to set 'prerender' or 'unloaded' as visibility state.
+  // http://www.w3.org/TR/page-visibility/#dom-document-visibilitystate
   switch (page_visibility_state) {
-    case EWK_PAGE_VISIBILITY_STATE_VISIBLE :
+    case EWK_PAGE_VISIBILITY_STATE_VISIBLE:
       impl->Show();
       break;
-    case EWK_PAGE_VISIBILITY_STATE_HIDDEN :
+    case EWK_PAGE_VISIBILITY_STATE_HIDDEN:
       impl->Hide();
       break;
     default:
-      break;
+      return EINA_FALSE;
   }
-  return true;
+  return EINA_TRUE;
 }
 
 Eina_Bool ewk_view_user_agent_set(Evas_Object* ewkView, const char* user_agent)
@@ -1045,10 +1053,14 @@ Eina_Bool ewk_view_mode_set(Evas_Object* ewkView, Ewk_View_Mode view_mode)
   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, EINA_FALSE);
 
   if (view_mode == EWK_VIEW_MODE_WINDOWED) {
+#if !defined(EWK_BRINGUP)  // FIXME: m67 bringup
     impl->SetViewMode(blink::WebViewModeWindowed);
+#endif
     return EINA_TRUE;
   } else if (view_mode == EWK_VIEW_MODE_FULLSCREEN) {
+#if !defined(EWK_BRINGUP)  // FIXME: m67 bringup
     impl->SetViewMode(blink::WebViewModeFullscreen);
+#endif
     return EINA_TRUE;
   } else {
     return EINA_FALSE;
@@ -1103,12 +1115,7 @@ static Eina_Bool _ewk_view_default_notification_permission(
 
 void ewk_view_draw_focus_ring_enable_set(Evas_Object* ewkView, Eina_Bool enable)
 {
-#if defined(OS_TIZEN_TV) && !defined(EWK_BRINGUP)
-  EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl);
-  impl->setDrawFocusRing(enable);
-#else
-   LOG_EWK_API_MOCKUP("Only for Tizen TV Browser");
-#endif
+  LOG_EWK_API_MOCKUP("This API is deprecated");
 }
 
 double ewk_view_page_zoom_get(const Evas_Object* ewkView)