Implement orientation_lock and orientation_unlock API
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / efl_integration / public / ewk_view.cc
1 /*
2  * Copyright (C) 2009-2010 ProFUSION embedded systems
3  * Copyright (C) 2009-2014 Samsung Electronics. All rights reserved.
4  * Copyright (C) 2012 Intel Corporation
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19  * Boston, MA  02110-1301, USA.
20  *
21  */
22
23 #include "ewk_view.h"
24
25 #include <Evas.h>
26
27 #if !defined(EWK_BRINGUP)
28 #include "webkit/common/webpreferences.h"
29 #else
30 #include "content/public/common/web_preferences.h"
31 #endif
32 #include "content/public/browser/navigation_controller.h"
33 #include "cookie_manager.h"
34 #include "eweb_view.h"
35 #include "geolocation_permission_popup.h"
36 #include "notification_permission_popup.h"
37 #include "public/ewk_back_forward_list.h"
38 #include "public/ewk_context.h"
39 #include "public/ewk_enums.h"
40 #include "public/ewk_settings.h"
41 #include "private/ewk_context_private.h"
42 #include "private/ewk_frame_private.h"
43 #include "private/ewk_hit_test_private.h"
44 #include "private/ewk_notification_private.h"
45 #include "private/ewk_private.h"
46 #include "private/ewk_quota_permission_request_private.h"
47 #include "private/ewk_back_forward_list_private.h"
48 #include "private/ewk_history_private.h"
49 #include "private/ewk_view_private.h"
50 #include "third_party/WebKit/public/web/WebViewModeEnums.h"
51 #include "ui/events/gesture_detection/gesture_configuration.h"
52 #include "usermedia_permission_popup.h"
53 #include "web_contents_delegate_efl.h"
54
55 static Eina_Bool _ewk_view_default_user_media_permission(
56     Evas_Object*, Ewk_User_Media_Permission_Request*, void*);
57
58 static Eina_Bool _ewk_view_default_geolocation_permission(
59     Evas_Object*, Ewk_Geolocation_Permission_Request*, void*);
60
61 static Eina_Bool _ewk_view_default_notification_permission(
62     Evas_Object*, Ewk_Notification_Permission_Request*, void*);
63
64 Eina_Bool ewk_view_smart_class_set(Ewk_View_Smart_Class* api)
65 {
66   EINA_SAFETY_ON_NULL_RETURN_VAL(api, false);
67   return InitSmartClassInterface(*api);
68 }
69
70 // TODO: Evas_Object *ewk_view_smart_add(Evas *e, Evas_Smart *smart, Ewk_Context *context, Ewk_Page_Group *pageGroup)
71
72 Evas_Object* ewk_view_add_with_session_data(Evas* canvas, const char* data, unsigned length)
73 {
74   EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, NULL);
75
76   Evas_Object* ret = ewk_view_add(canvas);
77
78   EWebView *webView = GetWebViewFromEvasObject(ret);
79
80   if (!webView || !data || !length)
81     return ret;
82
83   if (webView->RestoreFromSessionData(data, length))
84     return ret;
85
86   evas_object_del(ret);
87
88   return NULL;
89 }
90
91 Evas_Object* ewk_view_add_with_context(Evas* e, Ewk_Context* context)
92 {
93   EINA_SAFETY_ON_NULL_RETURN_VAL(context, 0);
94   Evas_Object* ewk_view = CreateWebViewAsEvasObject(context, e);
95
96   if (ewk_view) {
97     ewk_view_user_media_permission_callback_set(ewk_view,
98         _ewk_view_default_user_media_permission, 0);
99     ewk_view_geolocation_permission_callback_set(ewk_view,
100         _ewk_view_default_geolocation_permission, 0);
101     ewk_view_notification_permission_callback_set(ewk_view,
102         _ewk_view_default_notification_permission, 0);
103   }
104
105   return ewk_view;
106 }
107
108 Evas_Object* ewk_view_add(Evas* e)
109 {
110   EINA_SAFETY_ON_NULL_RETURN_VAL(e, NULL);
111   // TODO: shouldn't this function create new EWebContext for each new EWebView?
112   // when using default context like that it makes unclear who should release
113   // default web context. It won't be released by destroyed eweb_view because
114   // ewk_context_default_get does AddRef
115   Ewk_Context* context = ewk_context_default_get();
116   return ewk_view_add_with_context(e, context);
117 }
118
119 Evas_Object* ewk_view_add_in_incognito_mode(Evas* e)
120 {
121   Ewk_Context* context = Ewk_Context::Create(true);
122   EINA_SAFETY_ON_NULL_RETURN_VAL(context, NULL);
123   return ewk_view_add_with_context(e, context);
124 }
125
126 Ewk_Context *ewk_view_context_get(const Evas_Object *view)
127 {
128   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, 0);
129   return static_cast<Ewk_Context*>(impl->context());
130 }
131
132 Eina_Bool ewk_view_url_set(Evas_Object* view, const char* url)
133 {
134   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false);
135   EINA_SAFETY_ON_NULL_RETURN_VAL(url, false);
136   impl->SetURL(url);
137   return true;
138 }
139
140 const char* ewk_view_url_get(const Evas_Object* view)
141 {
142   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, 0);
143   return impl->GetURL();
144 }
145
146
147 Eina_Bool ewk_view_reload(Evas_Object *view)
148 {
149   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false);
150   impl->Reload();
151   return true;
152 }
153
154
155 Eina_Bool ewk_view_reload_bypass_cache(Evas_Object *view)
156 {
157   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false);
158   impl->ReloadIgnoringCache();
159   return true;
160 }
161
162 Eina_Bool ewk_view_stop(Evas_Object* view)
163 {
164   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false);
165   impl->Stop();
166   return true;
167 }
168
169
170 Ewk_Settings *ewk_view_settings_get(const Evas_Object *ewkView)
171 {
172   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl,0);
173   return impl->GetSettings();
174 }
175
176 const char* ewk_view_title_get(const Evas_Object* view)
177 {
178   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, 0);
179   return impl->GetTitle();
180 }
181
182 double ewk_view_load_progress_get(const Evas_Object* view)
183 {
184   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, -1);
185   return impl->GetProgressValue();
186 }
187
188 Eina_Bool ewk_view_scale_set(const Evas_Object* view, double scale_factor, int x, int y)
189 {
190   // TODO: We should implement AC in order to work this API normally.
191   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE);
192   impl->SetScale(scale_factor, x, y);
193   return EINA_TRUE;
194 }
195
196 double ewk_view_scale_get(const Evas_Object *view)
197 {
198   // TODO: We should implement AC in order to work this API normally.
199   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, -1);
200   return impl->GetScale();
201 }
202
203 Eina_Bool ewk_view_back(Evas_Object *view)
204 {
205   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false);
206   return impl->GoBack();
207 }
208
209 Eina_Bool ewk_view_forward(Evas_Object *view)
210 {
211   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false);
212   return impl->GoForward();
213 }
214
215 Eina_Bool ewk_view_back_possible(Evas_Object *view)
216 {
217   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false);
218   return impl->CanGoBack();
219 }
220
221 Eina_Bool ewk_view_forward_possible(Evas_Object *view)
222 {
223   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false);
224   return impl->CanGoForward();
225 }
226
227 Eina_Bool ewk_view_web_login_request(Evas_Object* ewkView)
228 {
229   LOG_EWK_API_MOCKUP();
230   return false;
231 }
232
233 Eina_Bool ewk_view_html_string_load(Evas_Object* view, const char* html, const char* base_uri, const char* unreachable_uri)
234 {
235   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE);
236   EINA_SAFETY_ON_NULL_RETURN_VAL(html, EINA_FALSE);
237   impl->LoadHTMLString(html, base_uri, unreachable_uri);
238   return EINA_TRUE;
239 }
240
241 Eina_Bool ewk_view_mouse_events_enabled_set(Evas_Object *view, Eina_Bool enabled)
242 {
243   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false);
244
245   impl->SetMouseEventsEnabled(!!enabled);
246
247   return true;
248 }
249
250 Eina_Bool ewk_view_mouse_events_enabled_get(const Evas_Object *view)
251 {
252   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false);
253
254   return impl->MouseEventsEnabled();
255 }
256
257 Eina_Bool ewk_view_color_picker_color_set(Evas_Object* ewkView, int r, int g, int b, int a)
258 {
259   LOG_EWK_API_MOCKUP();
260   return false;
261 }
262
263 double ewk_view_text_zoom_get(const Evas_Object* view)
264 {
265   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, -1.0);
266   return impl->GetTextZoomFactor();
267 }
268
269 Eina_Bool ewk_view_text_zoom_set(Evas_Object* view, double text_zoom_level)
270 {
271   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false);
272   if (ewk_settings_text_zoom_enabled_get(ewk_view_settings_get(view))) {
273    impl->SetTextZoomFactor(text_zoom_level);
274    return true;
275   }
276   return false;
277 }
278
279 void ewk_view_not_found_error_page_load(Evas_Object* ewkView, const char* errorUrl)
280 {
281   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl);
282   impl->LoadNotFoundErrorPage(std::string(errorUrl));
283 }
284
285 void ewk_view_scale_range_get(Evas_Object* view, double* min_scale, double* max_scale)
286 {
287   if (!min_scale && !max_scale)
288     return;
289
290   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl);
291   impl->GetPageScaleRange(min_scale, max_scale);
292 }
293
294 void ewk_view_suspend(Evas_Object* ewkView)
295 {
296   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl);
297   impl->Suspend();
298 }
299
300 void ewk_view_resume(Evas_Object* ewkView)
301 {
302   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl);
303   impl->Resume();
304 }
305
306 Eina_Bool ewk_view_url_request_set(Evas_Object* ewkView, const char* url, Ewk_Http_Method method, Eina_Hash* headers, const char* body)
307 {
308   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, EINA_FALSE);
309   EINA_SAFETY_ON_NULL_RETURN_VAL(url, EINA_FALSE);
310   content::NavigationController::LoadURLType loadtype;
311   switch (method) {
312   case EWK_HTTP_METHOD_GET:
313     loadtype = content::NavigationController::LOAD_TYPE_DEFAULT;
314     break;
315   case EWK_HTTP_METHOD_POST:
316     loadtype = content::NavigationController::LOAD_TYPE_BROWSER_INITIATED_HTTP_POST;
317     break;
318   default:
319     LOG(ERROR) << "Not supported HTTP Method.";
320     return EINA_FALSE;
321   }
322
323   impl->UrlRequestSet(url, loadtype, headers, body);
324   return EINA_TRUE;
325 }
326
327 Eina_Bool ewk_view_plain_text_set(Evas_Object* view, const char* plain_text)
328 {
329   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE);
330   EINA_SAFETY_ON_NULL_RETURN_VAL(plain_text, EINA_FALSE);
331   impl->LoadPlainTextString(plain_text);
332   return EINA_TRUE;
333 }
334
335 Eina_Bool ewk_view_contents_set(Evas_Object* view, const char* contents, size_t contents_size, char* mime_type, char* encoding, char* base_uri)
336 {
337   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE);
338   EINA_SAFETY_ON_NULL_RETURN_VAL(contents, EINA_FALSE);
339   impl->LoadData(contents, contents_size, mime_type, encoding, base_uri);
340   return EINA_TRUE;
341 }
342
343 Eina_Bool ewk_view_html_contents_set(Evas_Object* view, const char* html, const char* base_uri)
344 {
345   return ewk_view_html_string_load(view, html, base_uri, NULL);
346 }
347
348 Eina_Bool ewk_view_page_visibility_state_set(Evas_Object* ewkView, Ewk_Page_Visibility_State page_visibility_state, Eina_Bool initial_state)
349 {
350   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl,false);
351   switch (page_visibility_state) {
352     case EWK_PAGE_VISIBILITY_STATE_VISIBLE :
353       impl->Show();
354       break;
355     case EWK_PAGE_VISIBILITY_STATE_HIDDEN :
356       impl->Hide();
357       break;
358     default:
359       break;
360   }
361   return true;
362 }
363
364 Eina_Bool ewk_view_user_agent_set(Evas_Object* ewkView, const char* user_agent)
365 {
366   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false);
367
368   return impl->SetUserAgent(user_agent);
369 }
370
371 const char* ewk_view_user_agent_get(const Evas_Object* ewkView)
372 {
373   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, 0);
374   return impl->GetUserAgent();
375 }
376
377 Eina_Bool ewk_view_application_name_for_user_agent_set(Evas_Object* ewkView, const char* application_name)
378 {
379   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false);
380   return impl->SetUserAgentAppName(application_name);
381 }
382
383 const char* ewk_view_application_name_for_user_agent_get(const Evas_Object* ewkView)
384 {
385   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, 0);
386   return eina_stringshare_add(impl->GetUserAgentAppName());
387 }
388
389 Eina_Bool ewk_view_custom_header_add(const Evas_Object* ewkView, const char* name, const char* value)
390 {
391   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, EINA_FALSE);
392   EINA_SAFETY_ON_NULL_RETURN_VAL(name, EINA_FALSE);
393   EINA_SAFETY_ON_NULL_RETURN_VAL(value, EINA_FALSE);
394   EINA_SAFETY_ON_NULL_RETURN_VAL(impl->context(),EINA_FALSE);
395   return impl->context()->HTTPCustomHeaderAdd(name, value);
396 }
397
398 Eina_Bool ewk_view_custom_header_remove(const Evas_Object* ewkView, const char* name)
399 {
400   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, EINA_FALSE);
401   EINA_SAFETY_ON_NULL_RETURN_VAL(name, EINA_FALSE);
402   EINA_SAFETY_ON_NULL_RETURN_VAL(impl->context(),EINA_FALSE);
403   return impl->context()->HTTPCustomHeaderRemove(name);
404
405 }
406
407 Eina_Bool ewk_view_custom_header_clear(const Evas_Object* ewkView)
408 {
409   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, EINA_FALSE);
410   EINA_SAFETY_ON_NULL_RETURN_VAL(impl->context(),EINA_FALSE);
411   impl->context()->HTTPCustomHeaderClear();
412   return EINA_TRUE;
413 }
414
415
416 Eina_Bool ewk_view_visibility_set(const Evas_Object* view, Eina_Bool enable)
417 {
418   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE);
419
420   if (enable)
421     impl->Show();
422   else
423     impl->Hide();
424
425   return EINA_TRUE;
426 }
427
428 Evas_Object* ewk_view_screenshot_contents_get(const Evas_Object* view, Eina_Rectangle view_area, float scale_factor, Evas* canvas)
429 {
430   EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, NULL);
431   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, NULL);
432   // Zoom level equality (<=0.001) is sufficient compared to high precision std::numeric_value::epsilon.
433   if (!content::ZoomValuesEqual(scale_factor, 1.0)) {
434     LOG(ERROR) << "We only support scale factor of 1.0."
435                << "Scaling option will be supported after hardware acceleration is enabled.";
436     return NULL;
437   }
438   return impl->GetSnapshot(view_area);
439 }
440
441 Eina_Bool ewk_view_screenshot_contents_get_async(const Evas_Object* view, Eina_Rectangle view_area,
442         float scale_factor, Evas* canvas, Ewk_Web_App_Screenshot_Captured_Callback callback, void* user_data)
443 {
444   EINA_SAFETY_ON_NULL_RETURN_VAL(callback, EINA_FALSE);
445   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE);
446   // Zoom level equality (<=0.001) is sufficient compared to high precision std::numeric_value::epsilon.
447   if (!content::ZoomValuesEqual(scale_factor, 1.0)) {
448     LOG(ERROR) << "We only support scale factor of 1.0."
449                << "Scaling option will be supported after hardware acceleration is enabled.";
450     return EINA_FALSE;
451   }
452   return impl->GetSnapshotAsync(view_area, callback, user_data) ? EINA_TRUE : EINA_FALSE;
453 }
454
455 unsigned int ewk_view_inspector_server_start(Evas_Object* ewkView, unsigned int port)
456 {
457   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false);
458   return impl->StartInspectorServer(port);
459 }
460
461 Eina_Bool ewk_view_inspector_server_stop(Evas_Object* ewkView)
462 {
463   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false);
464   return impl->StopInspectorServer();
465 }
466
467 Evas_Object* ewk_view_cache_image_get(const Evas_Object* ewkView, const char* imageUrl, Evas* canvas)
468 {
469   LOG_EWK_API_MOCKUP();
470         return NULL;
471 }
472
473 void ewk_view_scroll_by(Evas_Object* ewkView, int deltaX, int deltaY)
474 {
475   int x, y;
476
477   if (EINA_TRUE == ewk_view_scroll_pos_get(ewkView, &x, &y)) {
478     ewk_view_scroll_set(ewkView, x + deltaX, y + deltaY);
479   }
480 }
481
482 Eina_Bool ewk_view_scroll_pos_get(Evas_Object* ewkView, int* x, int* y)
483 {
484   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false);
485   EINA_SAFETY_ON_NULL_RETURN_VAL(x, EINA_FALSE);
486   EINA_SAFETY_ON_NULL_RETURN_VAL(y, EINA_FALSE);
487   return impl->GetScrollPosition(x, y);
488 }
489
490 Eina_Bool ewk_view_scroll_set(Evas_Object* view, int x, int y)
491 {
492   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE);
493   impl->SetScroll(x, y);
494
495   return EINA_TRUE;
496 }
497
498 Eina_Bool ewk_view_scroll_size_get(const Evas_Object* view, int* width, int* height)
499 {
500   if (width)
501     *width = 0;
502   if (height)
503     *height = 0;
504   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE);
505   impl->GetScrollSize(width,height);
506   return EINA_TRUE;
507 }
508
509 void ewk_view_password_confirm_popup_callback_set(Evas_Object* view, Ewk_View_Password_Confirm_Popup_Callback callback, void* user_data)
510 {
511   LOG_EWK_API_MOCKUP();
512 }
513
514 void ewk_view_password_confirm_popup_reply(Evas_Object* ewkView, Ewk_Password_Popup_Option result)
515 {
516   LOG_EWK_API_MOCKUP();
517 }
518
519 void ewk_view_javascript_alert_callback_set(Evas_Object* view, Ewk_View_JavaScript_Alert_Callback callback, void* user_data)
520 {
521   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl);
522   if (callback)
523     impl->SetJavaScriptAlertCallback(callback, user_data);
524 }
525
526 void ewk_view_javascript_alert_reply(Evas_Object* view)
527 {
528   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl);
529   impl->JavaScriptAlertReply();
530 }
531
532 void ewk_view_javascript_confirm_callback_set(Evas_Object* view, Ewk_View_JavaScript_Confirm_Callback callback, void* user_data)
533 {
534   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl);
535   if (callback)
536     impl->SetJavaScriptConfirmCallback(callback, user_data);
537 }
538
539 void ewk_view_javascript_confirm_reply(Evas_Object* view, Eina_Bool result)
540 {
541   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl);
542   impl->JavaScriptConfirmReply(result);
543 }
544
545 void ewk_view_javascript_prompt_callback_set(Evas_Object* view, Ewk_View_JavaScript_Prompt_Callback callback, void* user_data)
546 {
547   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl);
548   if (callback)
549     impl->SetJavaScriptPromptCallback(callback, user_data);
550 }
551
552 void ewk_view_javascript_prompt_reply(Evas_Object* view, const char* result)
553 {
554   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl);
555   impl->JavaScriptPromptReply(result);
556 }
557
558 void ewk_view_before_unload_confirm_panel_callback_set(Evas_Object* ewkView, Ewk_View_Before_Unload_Confirm_Panel_Callback callback, void* userData)
559 {
560   LOG_EWK_API_MOCKUP();
561 }
562
563 void ewk_view_before_unload_confirm_panel_reply(Evas_Object* ewkView, Eina_Bool result)
564 {
565   LOG_EWK_API_MOCKUP();
566 }
567
568 Eina_Bool ewk_view_web_application_capable_get(Evas_Object* ewkView, Ewk_Web_App_Capable_Get_Callback callback, void* userData)
569 {
570   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, EINA_FALSE);
571   EINA_SAFETY_ON_NULL_RETURN_VAL(callback, EINA_FALSE);
572   return impl->WebAppCapableGet(callback, userData) ? EINA_TRUE : EINA_FALSE;
573 }
574
575 Eina_Bool ewk_view_web_application_icon_url_get(Evas_Object* ewkView, Ewk_Web_App_Icon_URL_Get_Callback callback, void* userData)
576 {
577   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, EINA_FALSE);
578   EINA_SAFETY_ON_NULL_RETURN_VAL(callback, EINA_FALSE);
579   return impl->WebAppIconUrlGet(callback, userData) ? EINA_TRUE : EINA_FALSE;
580 }
581
582 Eina_Bool ewk_view_web_application_icon_urls_get(Evas_Object* ewkView, Ewk_Web_App_Icon_URLs_Get_Callback callback, void* userData)
583 {
584   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, EINA_FALSE);
585   EINA_SAFETY_ON_NULL_RETURN_VAL(callback, EINA_FALSE);
586   return impl->WebAppIconUrlsGet(callback, userData) ? EINA_TRUE : EINA_FALSE;
587 }
588
589 Eina_Bool ewk_view_command_execute(Evas_Object* view, const char* command, const char* value)
590 {
591   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false);
592   EINA_SAFETY_ON_NULL_RETURN_VAL(command, false);
593   impl->ExecuteEditCommand(command, value);
594   return true;
595 }
596
597 Eina_Bool ewk_view_contents_size_get(Evas_Object* view, Evas_Coord* width, Evas_Coord* height)
598 {
599   if (width)
600     *width = 0;
601   if (height)
602     *height = 0;
603
604   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE);
605   Eina_Rectangle contents_size = impl->GetContentsSize();
606
607   if (width)
608     *width = contents_size.w;
609   if (height)
610     *height = contents_size.h;
611
612   return EINA_TRUE;
613 }
614
615 Eina_Bool ewk_view_contents_pdf_get(Evas_Object* view, int width, int height, const char* fileName)
616 {
617   EINA_SAFETY_ON_NULL_RETURN_VAL(fileName, EINA_FALSE);
618   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE);
619   return impl->SaveAsPdf(width, height, fileName);
620 }
621
622 Eina_Bool ewk_view_script_execute(Evas_Object* ewkView, const char* script, Ewk_View_Script_Execute_Callback callback, void* user_data)
623 {
624   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false);
625   EINA_SAFETY_ON_NULL_RETURN_VAL(script, false);
626   // callback can be null, so do not test it for null
627   if (0 != strcmp(script, "")) //check for empty string
628     return impl->ExecuteJavaScript(script, callback, user_data);
629   return false;
630 }
631
632
633 Eina_Bool ewk_view_plain_text_get(Evas_Object* view, Ewk_View_Plain_Text_Get_Callback callback, void* user_data)
634 {
635   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE);
636   EINA_SAFETY_ON_NULL_RETURN_VAL(callback, EINA_FALSE);
637   return (impl->PlainTextGet(callback, user_data));
638 }
639
640 Eina_Bool ewk_view_mhtml_data_get(Evas_Object *view, Ewk_View_MHTML_Data_Get_Callback callback, void *user_data)
641 {
642   EINA_SAFETY_ON_NULL_RETURN_VAL(callback, EINA_FALSE);
643   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE);
644   return impl->GetMHTMLData(callback, user_data);
645 }
646
647 Ewk_Hit_Test* ewk_view_hit_test_new(Evas_Object* ewkView, int x, int y, int hit_test_mode)
648 {
649   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, 0);
650   return impl->RequestHitTestDataAt(x, y,
651       static_cast<Ewk_Hit_Test_Mode>(hit_test_mode));
652 }
653
654 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)
655 {
656   EWK_VIEW_IMPL_GET_OR_RETURN(o, impl, EINA_FALSE);
657   return impl->AsyncRequestHitTestDataAt(x, y, static_cast<Ewk_Hit_Test_Mode>(hit_test_mode), callback, user_data);
658 }
659
660 Ewk_History* ewk_view_history_get(Evas_Object* ewkView)
661 {
662   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, NULL);
663   return impl->GetBackForwardHistory();
664 }
665
666 Eina_Bool ewk_view_notification_closed(Evas_Object* ewkView, Eina_List* notification_list)
667 {
668   return EINA_FALSE;
669 }
670
671 Eina_Bool ewk_view_popup_menu_select(Evas_Object* ewkView, unsigned int selectedIndex)
672 {
673   LOG_EWK_API_MOCKUP();
674   return false;
675 }
676
677 Eina_Bool ewk_view_popup_menu_multiple_select(Evas_Object* ewkView, Eina_Inarray* changeList)
678 {
679   LOG_EWK_API_MOCKUP();
680   return false;
681 }
682
683 /*
684  * Sends the new orientation of the device.
685  *
686  * If orientation value is changed, orientationchanged event will occur.
687  *
688  * @param view object to receive orientation event.
689  * @param orientation the new orientation of the device. (degree)
690  *
691  * orientation will be 0 degrees when the device is oriented to natural position,
692  *                     90 degrees when it's left side is at the top,
693  *                    -90 degrees when it's right side is at the top,
694  *                     180 degrees when it is upside down.
695  */
696 void ewk_view_orientation_send(Evas_Object* ewkView, int orientation)
697 {
698   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl);
699   impl->SetOrientation(orientation);
700 }
701
702 void ewk_view_encoding_custom_set(Evas_Object* ewkView, const char* encoding)
703 {
704   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl);
705   impl->SetOverrideEncoding(std::string(encoding));
706 }
707
708 Eina_Bool ewk_view_text_selection_range_get(const Evas_Object* view, Eina_Rectangle* left_rect, Eina_Rectangle* right_rect)
709 {
710   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE);
711   if (left_rect && right_rect && impl->GetSelectionRange(left_rect, right_rect)) {
712     Evas_Coord x, y;
713     evas_object_geometry_get(view, &x, &y, 0, 0);
714     left_rect->x += x;
715     left_rect->y += y;
716     right_rect->x += x;
717     right_rect->y += y;
718     return true;
719   }
720   return false;
721 }
722
723 Eina_Bool ewk_view_text_selection_clear(Evas_Object *view)
724 {
725   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE);
726   return impl->GetSelectionController()->ClearSelectionViaEWebView() ? EINA_TRUE : EINA_FALSE;
727 }
728
729 const char* ewk_view_text_selection_text_get(Evas_Object* view)
730 {
731   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, NULL);
732   return impl->GetSelectedText();
733 }
734
735 void ewk_view_focused_input_element_value_set(Evas_Object* ewkView, const char* value)
736 {
737   LOG_EWK_API_MOCKUP();
738 }
739
740 const char* ewk_view_focused_input_element_value_get(Evas_Object* ewkView)
741 {
742   LOG_EWK_API_MOCKUP();
743   return NULL;
744 }
745
746 Eina_Bool ewk_view_vertical_panning_hold_get(Evas_Object* ewkView)
747 {
748   LOG_EWK_API_MOCKUP();
749   return false;
750 }
751
752 void ewk_view_vertical_panning_hold_set(Evas_Object* view, Eina_Bool hold)
753 {
754   LOG_EWK_API_MOCKUP();
755   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl);
756   // FIX ME: Currently the pan support is not present.
757   // In WK2 panning was implemented with evas directly, here its with chorme gesture reconignation
758   // So paning is not present yet
759 }
760
761 void ewk_view_orientation_lock_callback_set(Evas_Object* ewkView, Ewk_Orientation_Lock_Cb func, void* data)
762 {
763   LOG_EWK_API_MOCKUP("This API is deprecated, to use orientation lock/unlock "
764       "API please use functions lock_orientation/unlock_orientation provided "
765       "by Ewk_View_Smart_Class.");
766 }
767
768
769 void ewk_view_back_forward_list_clear(const Evas_Object *view)
770 {
771   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl);
772   impl->BackForwardListClear();
773 }
774
775 Eina_Bool ewk_view_feed_touch_event(Evas_Object *view, Ewk_Touch_Event_Type type, const Eina_List *points, const Evas_Modifier *modifiers)
776 {
777   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false);
778
779   impl->HandleTouchEvents(type, points, modifiers);
780
781   return true;
782 }
783
784 Eina_Bool ewk_view_touch_events_enabled_set(Evas_Object *view, Eina_Bool enabled)
785 {
786   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false);
787
788   impl->SetTouchEventsEnabled(!!enabled);
789
790   return true;
791 }
792
793 Eina_Bool ewk_view_touch_events_enabled_get(const Evas_Object *view)
794 {
795   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false);
796
797   return impl->TouchEventsEnabled();
798 }
799
800 Ewk_Frame_Ref ewk_view_main_frame_get(Evas_Object* o)
801 {
802   EWK_VIEW_IMPL_GET_OR_RETURN(o, impl, NULL);
803   return static_cast<Ewk_Frame_Ref>(impl->GetMainFrame());
804 }
805
806 Eina_Bool ewk_view_main_frame_scrollbar_visible_set(Evas_Object* ewkView, Eina_Bool visible)
807 {
808   LOG_EWK_API_MOCKUP();
809   return false;
810 }
811
812 void ewk_view_content_security_policy_set(Evas_Object* ewkView, const char* policy, Ewk_CSP_Header_Type type)
813 {
814   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl);
815   EINA_SAFETY_ON_NULL_RETURN(policy);
816   impl->SetContentSecurityPolicy(policy, type);
817 }
818
819 void ewk_view_application_cache_permission_callback_set(Evas_Object* ewkView, Ewk_View_Applicacion_Cache_Permission_Callback callback, void* userData)
820 {
821   // Chromium does not support this feature hence the comment
822   LOG_EWK_API_MOCKUP("Not Supported by chromium");
823 }
824
825 void ewk_view_application_cache_permission_reply(Evas_Object* ewkView, Eina_Bool allow)
826 {
827   // Chromium does not support this feature hence the comment
828   LOG_EWK_API_MOCKUP("Not Supported by chromium");
829 }
830
831 void ewk_view_exceeded_indexed_database_quota_callback_set(Evas_Object* ewkView, Ewk_View_Exceeded_Indexed_Database_Quota_Callback callback, void* userData)
832 {
833   // Chromium does not support quota for Indexed DB only.
834   // IndexedDB uses temporary storage that is shared
835   // between other features.
836   LOG_EWK_API_MOCKUP("Not Supported by chromium");
837 }
838
839 void ewk_view_exceeded_indexed_database_quota_reply(Evas_Object* ewkView, Eina_Bool allow)
840 {
841   // Chromium does not support quota for Indexed DB only.
842   // IndexedDB uses temporary storage that is shared
843   // between other features.
844   LOG_EWK_API_MOCKUP("Not Supported by chromium");
845 }
846
847 Eina_Bool ewk_view_text_find(Evas_Object *view, const char *text, Ewk_Find_Options options, unsigned int max_match_count)
848 {
849   // FIXME: We need to implement next options in Ewk_Find_Options struct. (refer to ewk_view.h)
850   //         - EWK_FIND_OPTIONS_AT_WORD_STARTS
851   //         - EWK_FIND_OPTIONS_TREAT_MEDIAL_CAPITAL_AS_WORD_START
852   //         - EWK_FIND_OPTIONS_WRAP_AROUND
853   //         - EWK_FIND_OPTIONS_SHOW_OVERLAY
854   //         - EWK_FIND_OPTIONS_SHOW_FIND_INDICATOR
855   //         - EWK_FIND_OPTIONS_SHOW_HIGHLIGHT (Currently there is no way to control this option. so it is always set)
856
857   // FIXME: Updating of max_match_count is not implemented.
858
859   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE);
860   EINA_SAFETY_ON_NULL_RETURN_VAL(text, EINA_FALSE);
861   impl->Find(text, options);
862   return EINA_TRUE;
863 }
864
865 Eina_Bool ewk_view_text_find_highlight_clear(Evas_Object *view)
866 {
867   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE);
868   impl->StopFinding();
869   return EINA_TRUE;
870 }
871
872 void ewk_view_exceeded_database_quota_callback_set(Evas_Object* ewkView, Ewk_View_Exceeded_Database_Quota_Callback callback, void* userData)
873 {
874   // According to chromium source code:
875   // src/third_party/WebKit/Source/modules/webdatabase/SQLTransactionClient.cpp line 67
876   // Chromium does not allow users to manually change the quota for an origin (for now, at least).
877   // This API is impossible to implement right now
878   LOG_EWK_API_MOCKUP("Not Supported by chromium");
879 }
880
881 void ewk_view_exceeded_database_quota_reply(Evas_Object* ewkView, Eina_Bool allow)
882 {
883   // According to chromium source code:
884   // src/third_party/WebKit/Source/modules/webdatabase/SQLTransactionClient.cpp line 67
885   // Chromium does not allow users to manually change the quota for an origin (for now, at least).
886   // This API is impossible to implement right now
887   LOG_EWK_API_MOCKUP("Not Supported by chromium");
888 }
889
890 void ewk_view_exceeded_local_file_system_quota_callback_set(Evas_Object* ewkView, Ewk_View_Exceeded_Indexed_Database_Quota_Callback callback, void* userData)
891 {
892   LOG_EWK_API_MOCKUP();
893 }
894
895 void ewk_view_exceeded_local_file_system_quota_reply(Evas_Object* ewkView, Eina_Bool allow)
896 {
897   LOG_EWK_API_MOCKUP();
898 }
899
900 void ewk_view_intercept_request_callback_set (Evas_Object* ewkView, Ewk_View_Intercept_Request_Callback callback, void* user_data)
901 {
902   LOG_EWK_API_MOCKUP();
903 }
904
905 void ewk_view_unfocus_allow_callback_set(Evas_Object* ewkView, Ewk_View_Unfocus_Allow_Callback callback, void* user_data)
906 {
907   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl);
908   impl->SetViewUnfocusAllowCallback(callback, user_data);
909 }
910
911 void ewk_view_geolocation_permission_callback_set(Evas_Object* ewk_view, Ewk_View_Geolocation_Permission_Callback callback, void* user_data)
912 {
913   EWK_VIEW_IMPL_GET_OR_RETURN(ewk_view, impl);
914   impl->SetViewGeolocationPermissionCallback(callback, user_data);
915 }
916
917 static Eina_Bool _ewk_view_default_geolocation_permission(
918     Evas_Object* ewk_view,
919     Ewk_Geolocation_Permission_Request* request,
920     void* user_data)
921 {
922   EWK_VIEW_IMPL_GET_OR_RETURN(ewk_view, impl, EINA_FALSE);
923
924   std::string value = std::string(ewk_security_origin_host_get(
925       ewk_geolocation_permission_request_origin_get(request)));
926   std::string message = std::string(
927       "Web Page (%s) is requesting permission to access your location.");
928   std::string replace_str = std::string("(%s)");
929
930   size_t pos = message.find(replace_str.c_str());
931   if (pos != std::string::npos)
932     message.replace(pos, replace_str.length(), value.c_str());
933
934   // add for suspending
935   ewk_geolocation_permission_request_suspend(request);
936
937   GeolocationPermissionPopup* popup = new GeolocationPermissionPopup(request,
938       ewk_geolocation_permission_request_origin_get(request), message);
939
940   impl->GetPermissionPopupManager()->AddPermissionRequest(popup);
941
942   return EINA_TRUE;
943 }
944
945 void ewk_view_user_media_permission_callback_set(Evas_Object* ewk_view,
946     Ewk_View_User_Media_Permission_Callback callback,
947     void* user_data)
948 {
949   EWK_VIEW_IMPL_GET_OR_RETURN(ewk_view, impl);
950   impl->SetViewUserMediaPermissionCallback(callback, user_data);
951 }
952
953 static Eina_Bool _ewk_view_default_user_media_permission(
954     Evas_Object* ewk_view,
955     Ewk_User_Media_Permission_Request* user_media_permission_request,
956     void* user_data)
957 {
958   EWK_VIEW_IMPL_GET_OR_RETURN(ewk_view, impl, EINA_FALSE);
959
960   std::string value = std::string(ewk_security_origin_host_get(
961       ewk_user_media_permission_request_origin_get(
962           user_media_permission_request)));
963
964   std::string message = std::string(dgettext(
965       "WebKit",
966       "IDS_WEBVIEW_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"));
967
968   std::string replace_str = std::string("%1$s");
969   size_t pos = message.find(replace_str.c_str());
970   if (pos != std::string::npos)
971     message.replace(pos, replace_str.length(), value.c_str());
972
973   replace_str = std::string("(%2$s)");
974   pos = message.find(replace_str.c_str());
975   if (pos != std::string::npos)
976     message.replace(pos, replace_str.length(), "");
977
978   // add for suspending
979   ewk_user_media_permission_request_suspend(user_media_permission_request);
980
981   UserMediaPermissionPopup* popup = new UserMediaPermissionPopup(
982       user_media_permission_request,
983       ewk_user_media_permission_request_origin_get(
984           user_media_permission_request), message);
985
986   impl->GetPermissionPopupManager()->AddPermissionRequest(popup);
987
988   return EINA_TRUE;
989 }
990
991 void ewk_view_use_settings_font(Evas_Object* ewkView)
992 {
993   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl);
994   impl->UseSettingsFont();
995 }
996
997 char* ewk_view_get_cookies_for_url(Evas_Object* view, const char* url)
998 {
999   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, 0);
1000   EINA_SAFETY_ON_NULL_RETURN_VAL(url, 0);
1001   std::string cookiesForURL;
1002   cookiesForURL = impl->context()->cookieManager()->GetCookiesForURL(std::string(url));
1003   if (cookiesForURL.empty())
1004     return NULL;
1005   return strndup(cookiesForURL.c_str(), cookiesForURL.length());
1006 }
1007
1008 Eina_Bool ewk_view_fullscreen_exit(Evas_Object* view)
1009 {
1010   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE);
1011   impl->ExitFullscreen();
1012   return EINA_TRUE;
1013 }
1014
1015 Eina_Bool ewk_view_draws_transparent_background_set(Evas_Object *view, Eina_Bool enabled)
1016 {
1017   EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE);
1018   impl->SetDrawsTransparentBackground(enabled);
1019   return EINA_TRUE;
1020 }
1021
1022 void ewk_view_browser_font_set(Evas_Object* ewkView)
1023 {
1024   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl);
1025   impl->SetBrowserFont();
1026 }
1027
1028 void ewk_view_session_data_get(Evas_Object* ewkView, const char** data, unsigned* length)
1029 {
1030   EINA_SAFETY_ON_NULL_RETURN(data);
1031   EINA_SAFETY_ON_NULL_RETURN(length);
1032
1033   EWebView* impl = GetWebViewFromEvasObject(ewkView);
1034   if (!impl) {
1035     *data = NULL;
1036     *length = 0;
1037     return;
1038   }
1039
1040   impl->GetSessionData(data, length);
1041 }
1042
1043 Eina_Bool ewk_view_mode_set(Evas_Object* ewkView, Ewk_View_Mode view_mode)
1044 {
1045   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, EINA_FALSE);
1046
1047   if (view_mode == EWK_VIEW_MODE_WINDOWED) {
1048     impl->SetViewMode(blink::WebViewModeWindowed);
1049     return EINA_TRUE;
1050   } else if (view_mode == EWK_VIEW_MODE_FULLSCREEN) {
1051     impl->SetViewMode(blink::WebViewModeFullscreen);
1052     return EINA_TRUE;
1053   } else {
1054     return EINA_FALSE;
1055   }
1056 }
1057
1058 Eina_Bool ewk_view_split_scroll_overflow_enabled_set(Evas_Object* ewkView, const Eina_Bool enabled)
1059 {
1060   LOG_EWK_API_MOCKUP("for browser");
1061   return false;
1062 }
1063
1064 Ewk_Back_Forward_List* ewk_view_back_forward_list_get(const Evas_Object* ewkView)
1065 {
1066   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, NULL);
1067   return impl->GetBackForwardList();
1068 }
1069
1070 void ewk_view_notification_permission_callback_set(Evas_Object *o, Ewk_View_Notification_Permission_Callback callback, void *user_data)
1071 {
1072   EWK_VIEW_IMPL_GET_OR_RETURN(o, impl);
1073   impl->SetNotificationPermissionCallback(callback, user_data);
1074 }
1075
1076 static Eina_Bool _ewk_view_default_notification_permission(
1077     Evas_Object* ewk_view,
1078     Ewk_Notification_Permission_Request* request,
1079     void* user_data)
1080 {
1081   EWK_VIEW_IMPL_GET_OR_RETURN(ewk_view, impl, EINA_FALSE);
1082
1083   std::string value = std::string(ewk_security_origin_host_get(
1084       ewk_notification_permission_request_origin_get(request)));
1085   std::string message = std::string(
1086       "Web Page (%s) is requesting permission to show notifications.");
1087   std::string replace_str = std::string("(%s)");
1088
1089   size_t pos = message.find(replace_str.c_str());
1090   if (pos != std::string::npos)
1091     message.replace(pos, replace_str.length(), value.c_str());
1092
1093   // add for suspending
1094   ewk_notification_permission_request_suspend(request);
1095
1096   NotificationPermissionPopup* popup = new NotificationPermissionPopup(request,
1097       ewk_notification_permission_request_origin_get(request), message);
1098
1099   impl->GetPermissionPopupManager()->AddPermissionRequest(popup);
1100
1101   return EINA_TRUE;
1102 }
1103
1104 void ewk_view_draw_focus_ring_enable_set(Evas_Object* ewkView, Eina_Bool enable)
1105 {
1106 #if defined(OS_TIZEN_TV) && !defined(EWK_BRINGUP)
1107   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl);
1108   impl->setDrawFocusRing(enable);
1109 #else
1110    LOG_EWK_API_MOCKUP("Only for Tizen TV Browser");
1111 #endif
1112 }
1113
1114 double ewk_view_page_zoom_get(const Evas_Object* ewkView)
1115 {
1116   LOG_EWK_API_MOCKUP("for Tizen TV Browser");
1117   return 0;
1118 }
1119
1120 Eina_Bool ewk_view_page_zoom_set(Evas_Object* ewkView, double zoomFactor)
1121 {
1122   LOG_EWK_API_MOCKUP("for Tizen TV Browser");
1123   return false;
1124 }
1125
1126 Evas_Object* ewk_view_smart_add(Evas* canvas, Evas_Smart* smart, Ewk_Context* context, Ewk_Page_Group* pageGroup)
1127 {
1128   EINA_SAFETY_ON_NULL_RETURN_VAL(context, 0);
1129   return CreateWebViewAsEvasObject(context, canvas, smart);
1130 }
1131
1132 void ewk_view_quota_permission_request_callback_set(Evas_Object* ewkView, Ewk_Quota_Permission_Request_Callback callback, void* user_data)
1133 {
1134   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl);
1135   impl->SetQuotaPermissionRequestCallback(callback, user_data);
1136 }
1137
1138 void ewk_view_quota_permission_request_reply(const Ewk_Quota_Permission_Request* request, const Eina_Bool allow)
1139 {
1140   EINA_SAFETY_ON_NULL_RETURN(request);
1141   Evas_Object* ewkView = request->getView();
1142   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl);
1143   impl->QuotaRequestReply(request, allow == EINA_TRUE);
1144 }
1145
1146 void ewk_view_quota_permission_request_cancel(const Ewk_Quota_Permission_Request* request)
1147 {
1148   EINA_SAFETY_ON_NULL_RETURN(request);
1149   Evas_Object* ewkView = request->getView();
1150   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl);
1151   impl->QuotaRequestCancel(request);
1152 }