268b7b940711f97a70923fd6e9799d37371d047c
[framework/web/webkit-efl.git] / Source / WebKit / efl / WebCoreSupport / ChromeClientEfl.cpp
1 /*
2  * Copyright (C) 2006 Zack Rusin <zack@kde.org>
3  * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
4  * Copyright (C) 2008 Kenneth Rohde Christiansen
5  * Copyright (C) 2008 Diego Gonzalez
6  * Copyright (C) 2009-2010 ProFUSION embedded systems
7  * Copyright (C) 2009-2010 Samsung Electronics
8  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
9  *
10  * All rights reserved.
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  *    notice, this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright
18  *    notice, this list of conditions and the following disclaimer in the
19  *    documentation and/or other materials provided with the distribution.
20  *
21  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
22  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
25  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
29  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33
34 #include "config.h"
35 #include "ChromeClientEfl.h"
36
37 #if ENABLE(SQL_DATABASE)
38
39 #include "DatabaseDetails.h"
40 #include "DatabaseTracker.h"
41 #endif
42 #include "EWebKit.h"
43 #include "FileChooser.h"
44 #include "FileIconLoader.h"
45 #include "FloatRect.h"
46 #include "FrameLoader.h"
47 #include "FrameLoaderClientEfl.h"
48 #include "HitTestResult.h"
49 #include "IntRect.h"
50 #include "KURL.h"
51 #include "NavigationAction.h"
52 #if ENABLE(NOTIFICATIONS)
53 #include "NotificationPresenterClientEfl.h"
54 #endif
55 #include "NotImplemented.h"
56 #include "PlatformString.h"
57 #include "PopupMenuEfl.h"
58 #include "SearchPopupMenuEfl.h"
59 #include "SecurityOrigin.h"
60 #include "ViewportArguments.h"
61 #include "WindowFeatures.h"
62 #include "ewk_private.h"
63 #include <Ecore_Evas.h>
64 #include <Evas.h>
65 #include <wtf/text/CString.h>
66
67 #if ENABLE(TIZEN_MEDIA_QUERY)
68 #include <Ecore_X.h>
69 #endif
70
71 #if ENABLE(TIZEN_GEOLOCATION)
72 #include "Geolocation.h"
73
74 ewk_geolocation_permission_dialog_show_callback g_geolocation_permission_dialog_show_callback = 0;
75 #endif
76
77 using namespace WebCore;
78
79 static inline Evas_Object* kit(Frame* frame)
80 {
81     if (!frame)
82         return 0;
83
84     FrameLoaderClientEfl* client = static_cast<FrameLoaderClientEfl*>(frame->loader()->client());
85     return client ? client->webFrame() : 0;
86 }
87
88 namespace WebCore {
89
90 ChromeClientEfl::ChromeClientEfl(Evas_Object* view)
91     : m_view(view)
92 {
93     ASSERT(m_view);
94 }
95
96 ChromeClientEfl::~ChromeClientEfl()
97 {
98 }
99
100 void ChromeClientEfl::chromeDestroyed()
101 {
102     delete this;
103 }
104
105 void ChromeClientEfl::focusedNodeChanged(Node*)
106 {
107     notImplemented();
108 }
109
110 void ChromeClientEfl::focusedFrameChanged(Frame*)
111 {
112 }
113
114 FloatRect ChromeClientEfl::windowRect()
115 {
116     Ecore_Evas* ee = 0;
117     int x, y, w, h;
118
119     ee = ecore_evas_ecore_evas_get(evas_object_evas_get(m_view));
120     ecore_evas_geometry_get(ee, &x, &y, &w, &h);
121     return FloatRect(x, y, w, h);
122 }
123
124 void ChromeClientEfl::setWindowRect(const FloatRect& rect)
125 {
126     if (!ewk_view_setting_enable_auto_resize_window_get(m_view))
127         return;
128
129     Ecore_Evas* ee = 0;
130     IntRect intrect = IntRect(rect);
131
132     ee = ecore_evas_ecore_evas_get(evas_object_evas_get(m_view));
133     ecore_evas_move(ee, intrect.x(), intrect.y());
134     ecore_evas_resize(ee, intrect.width(), intrect.height());
135 }
136
137 FloatRect ChromeClientEfl::pageRect()
138 {
139     return ewk_view_page_rect_get(m_view);
140 }
141
142 #if ENABLE(TIZEN_INNER_SCREEN_RECT)
143 FloatRect ChromeClientEfl::innerScreenRect()
144 {
145     int x, y, w, h;
146     evas_object_geometry_get(m_view, &x, &y, &w, &h);
147     return FloatRect(x, y, w, h);
148 }
149 #endif
150
151 #if ENABLE(TIZEN_MEDIA_QUERY)
152 int ChromeClientEfl::getDPI()
153 {
154     return ecore_x_dpi_get();
155 }
156 #endif
157
158 void ChromeClientEfl::focus()
159 {
160     evas_object_focus_set(m_view, EINA_TRUE);
161 }
162
163 void ChromeClientEfl::unfocus()
164 {
165     evas_object_focus_set(m_view, EINA_FALSE);
166 }
167
168 #if ENABLE(TIZEN_FORM_SUBMIT_SUPPORT)
169 Page* ChromeClientEfl::createWindow(Frame* frame, const FrameLoadRequest& frameLoadRequest, const WindowFeatures& features, const NavigationAction& action)
170 #else
171 Page* ChromeClientEfl::createWindow(Frame*, const FrameLoadRequest& frameLoadRequest, const WindowFeatures& features, const NavigationAction&)
172 #endif
173 {
174 #if ENABLE(TIZEN_FORM_SUBMIT_SUPPORT)
175     Evas_Object* newView = ewk_view_window_create(m_view, frame, EINA_TRUE, EINA_FALSE, &features, action, frameLoadRequest.frameName());
176 #else
177     Evas_Object* newView = ewk_view_window_create(m_view, frame, EINA_TRUE, &features);
178 #endif
179     if (!newView)
180         return 0;
181
182     return ewk_view_core_page_get(newView);
183 }
184
185 void ChromeClientEfl::show()
186 {
187     ewk_view_ready(m_view);
188 }
189
190 bool ChromeClientEfl::canRunModal()
191 {
192     notImplemented();
193     return false;
194 }
195
196 void ChromeClientEfl::runModal()
197 {
198     notImplemented();
199 }
200
201 void ChromeClientEfl::setToolbarsVisible(bool visible)
202 {
203     ewk_view_toolbars_visible_set(m_view, visible);
204 }
205
206 bool ChromeClientEfl::toolbarsVisible()
207 {
208     Eina_Bool visible;
209
210     ewk_view_toolbars_visible_get(m_view, &visible);
211     return visible;
212 }
213
214 void ChromeClientEfl::setStatusbarVisible(bool visible)
215 {
216     ewk_view_statusbar_visible_set(m_view, visible);
217 }
218
219 bool ChromeClientEfl::statusbarVisible()
220 {
221     Eina_Bool visible;
222
223     ewk_view_statusbar_visible_get(m_view, &visible);
224     return visible;
225 }
226
227 void ChromeClientEfl::setScrollbarsVisible(bool visible)
228 {
229     ewk_view_scrollbars_visible_set(m_view, visible);
230 }
231
232 bool ChromeClientEfl::scrollbarsVisible()
233 {
234     Eina_Bool visible;
235
236     ewk_view_scrollbars_visible_get(m_view, &visible);
237     return visible;
238 }
239
240 void ChromeClientEfl::setMenubarVisible(bool visible)
241 {
242     ewk_view_menubar_visible_set(m_view, visible);
243 }
244
245 bool ChromeClientEfl::menubarVisible()
246 {
247     Eina_Bool visible;
248
249     ewk_view_menubar_visible_get(m_view, &visible);
250     return visible;
251 }
252
253 void ChromeClientEfl::createSelectPopup(PopupMenuClient* client, int selected, const IntRect& rect)
254 {
255     ewk_view_popup_new(m_view, client, selected, rect);
256 }
257
258 bool ChromeClientEfl::destroySelectPopup()
259 {
260     return ewk_view_popup_destroy(m_view);
261 }
262
263 void ChromeClientEfl::setResizable(bool)
264 {
265     notImplemented();
266 }
267
268 void ChromeClientEfl::closeWindowSoon()
269 {
270     ewk_view_window_close(m_view);
271 }
272
273 bool ChromeClientEfl::canTakeFocus(FocusDirection coreDirection)
274 {
275     // This is called when cycling through links/focusable objects and we
276     // reach the last focusable object.
277     ASSERT(coreDirection == FocusDirectionForward || coreDirection == FocusDirectionBackward);
278
279     Ewk_Focus_Direction direction = static_cast<Ewk_Focus_Direction>(coreDirection);
280
281     return !ewk_view_focus_can_cycle(m_view, direction);
282 }
283
284 void ChromeClientEfl::takeFocus(FocusDirection)
285 {
286     unfocus();
287 }
288
289 bool ChromeClientEfl::canRunBeforeUnloadConfirmPanel()
290 {
291     return true;
292 }
293
294 bool ChromeClientEfl::runBeforeUnloadConfirmPanel(const String& message, Frame* frame)
295 {
296     return runJavaScriptConfirm(frame, message);
297 }
298
299 void ChromeClientEfl::addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message,
300                                           unsigned int lineNumber, const String& sourceID)
301 {
302     ewk_view_add_console_message(m_view, message.utf8().data(), lineNumber, sourceID.utf8().data());
303 }
304
305 void ChromeClientEfl::runJavaScriptAlert(Frame* frame, const String& message)
306 {
307     ewk_view_run_javascript_alert(m_view, kit(frame), message.utf8().data());
308 }
309
310 bool ChromeClientEfl::runJavaScriptConfirm(Frame* frame, const String& message)
311 {
312     return ewk_view_run_javascript_confirm(m_view, kit(frame), message.utf8().data());
313 }
314
315 bool ChromeClientEfl::runJavaScriptPrompt(Frame* frame, const String& message, const String& defaultValue, String& result)
316 {
317     char* value = 0;
318     ewk_view_run_javascript_prompt(m_view, kit(frame), message.utf8().data(), defaultValue.utf8().data(), &value);
319     if (value) {
320         result = String::fromUTF8(value);
321         free(value);
322         return true;
323     }
324     return false;
325 }
326
327 void ChromeClientEfl::setStatusbarText(const String& string)
328 {
329     ewk_view_statusbar_text_set(m_view, string.utf8().data());
330 }
331
332 bool ChromeClientEfl::shouldInterruptJavaScript()
333 {
334     return ewk_view_should_interrupt_javascript(m_view);
335 }
336
337 KeyboardUIMode ChromeClientEfl::keyboardUIMode()
338 {
339     return KeyboardAccessTabsToLinks;
340 }
341
342 IntRect ChromeClientEfl::windowResizerRect() const
343 {
344     notImplemented();
345     // Implementing this function will make repaint being
346     // called during resize, but as this will be done with
347     // a minor delay it adds a weird "filling" effect due
348     // to us using an evas image for showing the cairo
349     // context. So instead of implementing this function
350     // we call paint directly during resize with
351     // the new object size as its argument.
352     return IntRect();
353 }
354
355 void ChromeClientEfl::contentsSizeChanged(Frame* frame, const IntSize& size) const
356 {
357     ewk_frame_contents_size_changed(kit(frame), size.width(), size.height());
358     if (ewk_view_frame_main_get(m_view) == kit(frame))
359         ewk_view_contents_size_changed(m_view, size.width(), size.height());
360 }
361
362 IntRect ChromeClientEfl::windowToScreen(const IntRect& rect) const
363 {
364 #if ENABLE(TIZEN_SUPPORT_PLUGINS) && ENABLE(TIZEN_CAIRO_SCALE_PATCH)
365     // mariusz.g@samsung.com
366     IntRect result(rect);
367     float zoomRatio = ewk_view_zoom_get(m_view);
368     result.setX((int)(zoomRatio * rect.x()));
369     result.setY((int)(zoomRatio * rect.y()));
370     result.setWidth((int)(zoomRatio * rect.width()));
371     result.setHeight((int)(zoomRatio * rect.height()));
372     return result;
373 #else
374     notImplemented();
375     return rect;
376 #endif
377 }
378
379 IntPoint ChromeClientEfl::screenToWindow(const IntPoint& point) const
380 {
381     notImplemented();
382     return point;
383 }
384
385 PlatformPageClient ChromeClientEfl::platformPageClient() const
386 {
387     return m_view;
388 }
389
390 void ChromeClientEfl::scrollbarsModeDidChange() const
391 {
392 }
393
394 void ChromeClientEfl::mouseDidMoveOverElement(const HitTestResult& hit, unsigned modifierFlags)
395 {
396     // FIXME, compare with old link, look at Qt impl.
397     bool isLink = hit.isLiveLink();
398     if (isLink) {
399         KURL url = hit.absoluteLinkURL();
400         if (!url.isEmpty() && url != m_hoveredLinkURL) {
401             const char* link[2];
402             TextDirection dir;
403             CString urlStr = url.string().utf8();
404             CString titleStr = hit.title(dir).utf8();
405             link[0] = urlStr.data();
406             link[1] = titleStr.data();
407             ewk_view_mouse_link_hover_in(m_view, link);
408             m_hoveredLinkURL = url;
409         }
410     } else if (!isLink && !m_hoveredLinkURL.isEmpty()) {
411         ewk_view_mouse_link_hover_out(m_view);
412         m_hoveredLinkURL = KURL();
413     }
414 }
415
416 void ChromeClientEfl::setToolTip(const String& toolTip, TextDirection)
417 {
418     ewk_view_tooltip_text_set(m_view, toolTip.utf8().data());
419 }
420
421 void ChromeClientEfl::print(Frame* frame)
422 {
423     notImplemented();
424 }
425
426 void ChromeClientEfl::reachedMaxAppCacheSize(int64_t spaceNeeded)
427 {
428     // FIXME: Free some space.
429     notImplemented();
430 }
431
432 void ChromeClientEfl::reachedApplicationCacheOriginQuota(SecurityOrigin*, int64_t)
433 {
434     notImplemented();
435 }
436
437 #if ENABLE(TOUCH_EVENTS)
438 void ChromeClientEfl::needTouchEvents(bool needed)
439 {
440     ewk_view_need_touch_events_set(m_view, needed);
441 }
442 #endif
443
444 #if ENABLE(TIZEN_EVAS_OBJECT_PLUGIN)
445 void ChromeClientEfl::getPluginStorage(PluginStorage* pluginStorage)
446 {
447     ewk_view_get_plugin_storage(m_view , pluginStorage);
448 }
449 #if ENABLE(TIZEN_SUPPORT_PLUGINS) && ENABLE(TIZEN_DONT_PAN_OVER_SOME_PLUGINS)
450 void ChromeClientEfl::repeatEventsToPlugin(bool enabled)
451 {
452     ewk_view_events_repeat_to_plugin(m_view, enabled);
453 }
454
455 void ChromeClientEfl::eventsHandledByPluginChanged(bool newState)
456 {
457     ewk_view_events_handled_by_plugin_changed(m_view, newState);
458 }
459 #endif
460 #endif
461
462 #if ENABLE(SQL_DATABASE)
463 void ChromeClientEfl::exceededDatabaseQuota(Frame* frame, const String& databaseName)
464 {
465     uint64_t quota;
466     SecurityOrigin* origin = frame->document()->securityOrigin();
467
468     DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(databaseName, origin);
469     quota = ewk_view_exceeded_database_quota(m_view,
470                                              kit(frame), databaseName.utf8().data(),
471                                              details.currentUsage(), details.expectedUsage());
472
473     /* if client did not set quota, and database is being created now, the
474      * default quota is applied
475      */
476     if (!quota && !DatabaseTracker::tracker().hasEntryForOrigin(origin))
477         quota = ewk_settings_web_database_default_quota_get();
478
479     DatabaseTracker::tracker().setQuota(origin, quota);
480 }
481 #endif
482
483 #if ENABLE(NOTIFICATIONS)
484 NotificationPresenter* ChromeClientEfl::notificationPresenter() const
485 {
486     notImplemented();
487     return 0;
488 }
489 #endif
490
491 void ChromeClientEfl::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> prpFileChooser)
492 {
493     RefPtr<FileChooser> chooser = prpFileChooser;
494     Eina_List* selectedFilenames = 0;
495     void* filename;
496     Vector<String> filenames;
497
498     const FileChooserSettings& settings = chooser->settings();
499     bool confirm = ewk_view_run_open_panel(m_view, kit(frame), settings.allowsMultipleFiles, settings.acceptMIMETypes, &selectedFilenames);
500
501     if (!confirm)
502         return;
503
504     EINA_LIST_FREE(selectedFilenames, filename) {
505         filenames.append((char*)filename);
506         free(filename);
507     }
508
509     if (chooser->settings().allowsMultipleFiles)
510         chooser->chooseFiles(filenames);
511     else
512         chooser->chooseFile(filenames[0]);
513 }
514
515 void ChromeClientEfl::formStateDidChange(const Node*)
516 {
517     notImplemented();
518 }
519
520 void ChromeClientEfl::setCursor(const Cursor&)
521 {
522     notImplemented();
523 }
524
525 void ChromeClientEfl::setCursorHiddenUntilMouseMoves(bool)
526 {
527     notImplemented();
528 }
529
530 #if ENABLE(TIZEN_GEOLOCATION)
531 void ChromeClientEfl::requestGeolocationPermissionForFrame(Frame* frame, Geolocation* geolocation)
532 {
533     // See the comment in WebCore/page/ChromeClient.h
534     if (g_geolocation_permission_dialog_show_callback) {
535        g_geolocation_permission_dialog_show_callback(
536           geolocation,
537           frame->document()->url().host().latin1().data()
538        );
539     }
540
541     evas_object_smart_callback_call(m_view, "geolocation,request", kit(frame));
542 }
543 #else
544 void ChromeClientEfl::requestGeolocationPermissionForFrame(Frame*, Geolocation*)
545 {
546     // See the comment in WebCore/page/ChromeClient.h
547     notImplemented();
548 }
549 #endif
550
551 #if ENABLE(TIZEN_GEOLOCATION)
552 void ChromeClientEfl::cancelGeolocationPermissionRequestForFrame(Frame* frame, Geolocation*)
553 #else
554 void ChromeClientEfl::cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*)
555 #endif
556 {
557 #if ENABLE(TIZEN_GEOLOCATION)
558     evas_object_smart_callback_call(m_view, "geolocation,request,cancel", kit(frame));
559 #else
560     notImplemented();
561 #endif
562 }
563
564 void ChromeClientEfl::cancelGeolocationPermissionForFrame(Frame*, Geolocation*)
565 {
566     notImplemented();
567 }
568
569 void ChromeClientEfl::invalidateContents(const IntRect& updateRect, bool immediate)
570 {
571     notImplemented();
572 }
573
574 void ChromeClientEfl::invalidateWindow(const IntRect& updateRect, bool immediate)
575 {
576     notImplemented();
577 }
578
579 void ChromeClientEfl::invalidateContentsAndWindow(const IntRect& updateRect, bool immediate)
580 {
581     if (updateRect.isEmpty())
582         return;
583
584     Evas_Coord x, y, w, h;
585
586     x = updateRect.x();
587     y = updateRect.y();
588     w = updateRect.width();
589     h = updateRect.height();
590
591     ewk_view_repaint(m_view, x, y, w, h);
592 }
593
594 void ChromeClientEfl::invalidateContentsForSlowScroll(const IntRect& updateRect, bool immediate)
595 {
596 #if ENABLE(TIZEN_OFFSET_UPDATE)
597     ewk_view_tiled_offset_update(m_view);
598 #endif
599     invalidateContentsAndWindow(updateRect, immediate);
600 }
601
602 void ChromeClientEfl::scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
603 {
604     ewk_view_scroll(m_view, scrollDelta.width(), scrollDelta.height(), rectToScroll.x(), rectToScroll.y(), rectToScroll.width(), rectToScroll.height(), clipRect.x(), clipRect.y(), clipRect.width(), clipRect.height(), EINA_TRUE);
605 }
606
607 void ChromeClientEfl::cancelGeolocationPermissionRequestForFrame(Frame*)
608 {
609     notImplemented();
610 }
611
612 void ChromeClientEfl::iconForFiles(const Vector<String, 0u>&, PassRefPtr<FileChooser>)
613 {
614     notImplemented();
615 }
616
617 void ChromeClientEfl::loadIconForFiles(const Vector<String>&, FileIconLoader*)
618 {
619     notImplemented();
620 }
621
622 void ChromeClientEfl::dispatchViewportDataDidChange(const ViewportArguments& arguments) const
623 {
624     ewk_view_viewport_attributes_set(m_view, arguments);
625 }
626
627 bool ChromeClientEfl::selectItemWritingDirectionIsNatural()
628 {
629     return true;
630 }
631
632 bool ChromeClientEfl::selectItemAlignmentFollowsMenuWritingDirection()
633 {
634     return false;
635 }
636
637 PassRefPtr<PopupMenu> ChromeClientEfl::createPopupMenu(PopupMenuClient* client) const
638 {
639     return adoptRef(new PopupMenuEfl(client));
640 }
641
642 PassRefPtr<SearchPopupMenu> ChromeClientEfl::createSearchPopupMenu(PopupMenuClient* client) const
643 {
644     return adoptRef(new SearchPopupMenuEfl(client));
645 }
646
647 #if USE(ACCELERATED_COMPOSITING)
648 void ChromeClientEfl::attachRootGraphicsLayer(Frame* frame, GraphicsLayer* graphicsLayer)
649 {
650 #if ENABLE(TIZEN_ACCELERATED_COMPOSITING)
651     if (m_view)
652         ewk_view_root_graphics_layer_set(m_view, graphicsLayer);
653 #endif // ENABLE(TIZEN_ACCELERATED_COMPOSITING)
654 }
655
656 void ChromeClientEfl::setNeedsOneShotDrawingSynchronization()
657 {
658 #if ENABLE(TIZEN_ACCELERATED_COMPOSITING)
659     // Do nothing
660 #endif
661 }
662
663 void ChromeClientEfl::scheduleCompositingLayerSync()
664 {
665 #if ENABLE(TIZEN_ACCELERATED_COMPOSITING)
666     if (m_view)
667         ewk_view_mark_for_sync(m_view, false);
668 #endif // ENABLE(TIZEN_ACCELERATED_COMPOSITING)
669 }
670
671 bool ChromeClientEfl::allowsAcceleratedCompositing() const
672 {
673 #if ENABLE(TIZEN_ACCELERATED_COMPOSITING)
674     Settings* settings = ewk_view_core_page_get(m_view)->settings();
675     return settings->acceleratedCompositingEnabled();
676 #endif
677 }
678
679 ChromeClient::CompositingTriggerFlags ChromeClientEfl::allowedCompositingTriggers() const
680 {
681 #if ENABLE(TIZEN_ACCELERATED_COMPOSITING)
682     CompositingTriggerFlags flags = 0;
683     Settings* settings = ewk_view_core_page_get(m_view)->settings();
684
685     if (settings->acceleratedCompositingFor3DTransformsEnabled())
686         flags |= ThreeDTransformTrigger;
687
688     if (settings->acceleratedCompositingForVideoEnabled())
689         flags |= VideoTrigger;
690
691     if (settings->acceleratedCompositingForPluginsEnabled())
692         flags |= PluginTrigger;
693
694     if (settings->acceleratedCompositingForAnimationEnabled())
695         flags |= AnimationTrigger;
696
697     if (settings->acceleratedCompositingForCanvasEnabled())
698         flags |= CanvasTrigger;
699
700     return flags;
701 #endif
702 }
703
704 #if ENABLE(CANVAS_CAIRO_GLES_RENDERING)
705 void* ChromeClientEfl::sharedCairoDevice()
706 {
707     return (void*)ewk_view_get_shared_cairo_device(m_view);
708 }
709 #endif
710 #endif
711
712 #if ENABLE(TIZEN_SHOULD_ALLOW_OPEN_URL)
713 bool ChromeClientEfl::shouldAllowOpenUrl(const char* url)
714 {
715     return static_cast<bool>(ewk_should_allow_open_uri( m_view, url ));
716 }
717 #endif
718
719 #if ENABLE(FULLSCREEN_API)
720 bool ChromeClientEfl::supportsFullScreenForElement(const WebCore::Element* element, bool withKeyboard)
721 {
722     if (withKeyboard)
723         return false;
724
725     return true;
726 }
727
728 void ChromeClientEfl::enterFullScreenForElement(WebCore::Element* element)
729 {
730     element->document()->webkitWillEnterFullScreenForElement(element);
731     element->document()->webkitDidEnterFullScreenForElement(element);
732 }
733
734 void ChromeClientEfl::exitFullScreenForElement(WebCore::Element* element)
735 {
736     element->document()->webkitWillExitFullScreenForElement(element);
737     element->document()->webkitDidExitFullScreenForElement(element);
738 }
739 #endif
740 }