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