Fixed when user tap on linkable contents, somtimes focus ring is not shown.
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / efl / WebPageProxyEfl.cpp
1 /*
2  * Copyright (C) 2011 Samsung Electronics
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #include "config.h"
27 #include "WebPageProxy.h"
28
29 #include "EwkViewImpl.h"
30 #include "NativeWebKeyboardEvent.h"
31 #include "NotImplemented.h"
32 #include "PageClientImpl.h"
33 #include "WebPageMessages.h"
34 #include "WebProcessProxy.h"
35
36 #include <sys/utsname.h>
37
38 #if OS(TIZEN)
39 #include "DrawingAreaMessages.h"
40
41 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION_ON_UI_SIDE)
42 #include "LayerTreeCoordinatorProxy.h"
43 #endif
44 #include "NativeWebKeyboardEvent.h"
45 #include "WebImage.h"
46 #include "WebPageMessages.h"
47 #include "WebProcessProxy.h"
48 #include <WebCore/IntSize.h>
49 #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
50 #include "WebContextMenuProxy.h"
51 #include "ewk_view_private.h"
52 #endif
53
54 #define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, m_process->connection())
55
56 #if ENABLE(TIZEN_LINK_MAGNIFIER)
57 #include "LinkMagnifierProxy.h"
58 #endif
59
60 #if ENABLE(TIZEN_SCREEN_READER)
61 #include "ScreenReaderProxy.h"
62 #include "ewk_view_private.h"
63 #endif
64
65 #if ENABLE(TIZEN_CSP)
66 #include <WebCore/ContentSecurityPolicy.h>
67 #endif
68
69 using namespace WebCore;
70 #endif
71
72 namespace WebKit {
73
74 Evas_Object* WebPageProxy::viewWidget()
75 {
76     return static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->view();
77 }
78
79 String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent)
80 {
81 #if OS(TIZEN)
82     return String::fromUTF8("Mozilla/5.0 (Linux; Tizen 2.2; sdk) AppleWebKit/537.3 (KHTML, like Gecko) Version/2.2 Mobile Safari/537.3");
83 #endif
84
85     WTF::String platform;
86     WTF::String version;
87     WTF::String osVersion;
88
89 #if PLATFORM(X11)
90     platform = "X11";
91 #else
92     platform = "Unknown";
93 #endif
94     version = makeString(String::number(WEBKIT_USER_AGENT_MAJOR_VERSION), '.',
95                          String::number(WEBKIT_USER_AGENT_MINOR_VERSION), '+');
96     struct utsname name;
97     if (uname(&name) != -1)
98         osVersion = WTF::String(name.sysname) + " " + WTF::String(name.machine);
99     else
100         osVersion = "Unknown";
101
102     if (applicationNameForUserAgent.isEmpty())
103         return makeString("Mozilla/5.0 (", platform, "; ", osVersion, ") AppleWebKit/", version,
104                " (KHTML, like Gecko) Version/5.0 Safari/", version);
105
106     return makeString("Mozilla/5.0 (", platform, "; ", osVersion, ") AppleWebKit/", version,
107            " (KHTML, like Gecko) Version/5.0 Safari/", version, applicationNameForUserAgent);
108 }
109
110 void WebPageProxy::getEditorCommandsForKeyEvent(Vector<WTF::String>& commandsList)
111 {
112     notImplemented();
113 }
114
115 void WebPageProxy::saveRecentSearches(const String&, const Vector<String>&)
116 {
117     notImplemented();
118 }
119
120 void WebPageProxy::loadRecentSearches(const String&, Vector<String>&)
121 {
122     notImplemented();
123 }
124
125 void WebPageProxy::setThemePath(const String& themePath)
126 {
127     process()->send(Messages::WebPage::SetThemePath(themePath), m_pageID, 0);
128 }
129
130 #if ENABLE(TIZEN_CUSTOM_HEADERS)
131 void WebPageProxy::addCustomHeader(const String& name, const String& value)
132 {
133     if (name.isEmpty())
134         return;
135
136     if (value.isEmpty())
137         return;
138
139     if (!isValid())
140         return;
141
142     process()->send(Messages::WebPage::AddCustomHeader(name, value), m_pageID);
143 }
144
145 void WebPageProxy::removeCustomHeader(const String& name)
146 {
147     if (name.isEmpty())
148         return;
149
150     if (!isValid())
151         return;
152
153     process()->send(Messages::WebPage::RemoveCustomHeader(name), m_pageID);
154 }
155
156 void WebPageProxy::clearCustomHeaders()
157 {
158     if (!isValid())
159         return;
160
161     process()->send(Messages::WebPage::ClearCustomHeaders(), m_pageID);
162 }
163 #endif
164
165 #if OS(TIZEN)
166 bool WebPageProxy::scrollMainFrameBy(const IntSize& scrollOffset)
167 {
168 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
169     return static_cast<PageClientImpl*>(m_pageClient)->scrollBy(scrollOffset);
170 #else
171     if (!isValid())
172         return false;
173
174     process()->send(Messages::WebPage::ScrollMainFrameBy(scrollOffset), m_pageID);
175     return true;
176 #endif
177 }
178
179 void WebPageProxy::scrollMainFrameTo(const IntPoint& scrollPosition)
180 {
181 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
182     static_cast<PageClientImpl*>(m_pageClient)->scrollTo(scrollPosition);
183 #else
184     if (!isValid())
185         return;
186
187     process()->send(Messages::WebPage::ScrollMainFrameTo(scrollPosition), m_pageID);
188 #endif
189 }
190
191 void WebPageProxy::didChangeScrollPositionForMainFrame(const IntPoint& scrollPosition)
192 {
193 #if !ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
194     m_scrollPosition = scrollPosition;
195 #endif
196 }
197
198 void WebPageProxy::didChangeContentsSize(const IntSize& size)
199 {
200     if (m_contentsSize == size)
201         return;
202
203     m_contentsSize = size;
204     m_pageClient->didChangeContentsSize(size);
205 }
206
207 PassRefPtr<WebImage> WebPageProxy::createSnapshot(const IntRect& rect, float scaleFactor)
208 {
209     if (!isValid())
210         return 0;
211
212     ShareableBitmap::Handle snapshotHandle;
213     // Do not wait for more than a second (arbitrary) for the WebProcess to get the snapshot so
214     // that the UI Process is not permanently stuck waiting on a potentially crashing Web Process.
215     static const double createSnapshotSyncMessageTimeout = 1.0;
216 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
217     float baseScaleFactor = static_cast<PageClientImpl*>(m_pageClient)->scaleFactor();
218     scaleFactor = scaleFactor * baseScaleFactor;
219
220     IntRect visibleContentRect = static_cast<PageClientImpl*>(m_pageClient)->visibleContentRect();
221     IntRect scaledRect = rect;
222     scaledRect.move(visibleContentRect.x(), visibleContentRect.y());
223     scaledRect.scale(1/baseScaleFactor);
224     process()->sendSync(Messages::WebPage::CreateSnapshot(scaledRect, scaleFactor), Messages::WebPage::CreateSnapshot::Reply(snapshotHandle), m_pageID, createSnapshotSyncMessageTimeout);
225 #else
226     process()->sendSync(Messages::WebPage::CreateSnapshot(rect, scaleFactor), Messages::WebPage::CreateSnapshot::Reply(snapshotHandle), m_pageID, createSnapshotSyncMessageTimeout);
227 #endif
228     if (snapshotHandle.isNull())
229         return 0;
230     return WebImage::create(ShareableBitmap::create(snapshotHandle));
231 }
232
233 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
234 void WebPageProxy::textChangeInTextField(const String& name, const String& value)
235 {
236     static_cast<PageClientImpl*>(m_pageClient)->textChangeInTextField(name, value);
237 }
238 #endif
239
240 #if ENABLE(TIZEN_ISF_PORT)
241 void WebPageProxy::prepareKeyDownEvent()
242 {
243     if (!isValid())
244         return;
245
246     process()->send(Messages::WebPage::PrepareKeyDownEvent(), m_pageID);
247 }
248
249 int WebPageProxy::getCursorOffset()
250 {
251     if (!isValid())
252         return 0;
253
254     int offset = 0;
255     process()->sendSync(Messages::WebPage::GetCursorOffset(), Messages::WebPage::GetCursorOffset::Reply(offset), m_pageID);
256     return offset;
257 }
258
259 void WebPageProxy::getSurroundingTextAndCursorOffset(String& text, int& offset)
260 {
261     if (!isValid())
262         return;
263
264     process()->sendSync(Messages::WebPage::GetSurroundingTextAndCursorOffset(), Messages::WebPage::GetSurroundingTextAndCursorOffset::Reply(text, offset), m_pageID);
265 }
266
267 IntRect WebPageProxy::getSelectionRect(bool isOnlyEditable)
268 {
269     IntRect rect;
270     process()->sendSync(Messages::WebPage::GetSelectionRect(isOnlyEditable), Messages::WebPage::GetSelectionRect::Reply(rect), m_pageID);
271     return rect;
272 }
273
274 void WebPageProxy::deleteSurroundingText(int offset, int count)
275 {
276     if (!isValid())
277         return;
278
279     process()->send(Messages::WebPage::DeleteSurroundingText(offset, count), m_pageID);
280 }
281
282 void WebPageProxy::didCancelComposition()
283 {
284     m_didCancelCompositionFromWebProcess = true;
285     InputMethodContextEfl* inputMethodContext = static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->inputMethodContext();
286     if (inputMethodContext)
287         inputMethodContext->resetIMFContext();
288     m_didCancelCompositionFromWebProcess = false;
289 }
290
291 void WebPageProxy::removeInputMethodContext(uintptr_t id)
292 {
293     InputMethodContextEfl* inputMethodContext = static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->inputMethodContext();
294     if (!inputMethodContext)
295         return;
296
297     inputMethodContext->removeIMFContext(id);
298 }
299 #endif // #if ENABLE(TIZEN_ISF_PORT)
300
301 void WebPageProxy::requestUpdateFormNavigation()
302 {
303     if (!isValid())
304         return;
305
306     process()->send(Messages::WebPage::RequestUpdateFormNavigation(), m_pageID);
307 }
308
309 void WebPageProxy::moveFocus(int newIndex)
310 {
311     if (!isValid())
312         return;
313
314     process()->send(Messages::WebPage::MoveFocus(newIndex), m_pageID);
315 }
316
317 void WebPageProxy::updateFormNavigation(int length, int offset)
318 {
319     static_cast<PageClientImpl*>(m_pageClient)->updateFormNavigation(length, offset);
320 }
321
322 #if ENABLE(TIZEN_REDUCE_KEY_LAGGING)
323 Eina_Bool WebPageProxy::pageContentResumeTimerFired(void* data)
324 {
325     static_cast<WebPageProxy*>(data)->resumeActiveDOMObjectsAndAnimations();
326     static_cast<WebPageProxy*>(data)->m_pageContentResumeTimer = 0;
327     return ECORE_CALLBACK_CANCEL;
328 }
329 #endif
330
331 #if ENABLE(TIZEN_TEXT_CARET_HANDLING_WK2)
332 void WebPageProxy::setCaretPosition(const WebCore::IntPoint& pos)
333 {
334     if (!isValid())
335         return;
336
337     process()->send(Messages::WebPage::SetCaretPosition(pos), m_pageID);
338 }
339
340 void WebPageProxy::getCaretPosition(WebCore::IntRect& rect)
341 {
342     if (!isValid())
343         return;
344
345     process()->sendSync(Messages::WebPage::GetCaretPosition(), Messages::WebPage::GetCaretPosition::Reply(rect), m_pageID);
346 }
347 #endif
348
349 #if ENABLE(TIZEN_PLUGIN_CUSTOM_REQUEST)
350 void WebPageProxy::processPluginCustomRequest(const String& request, const String& msg)
351 {
352     if (String("requestKeyboard,plugin") == request) {
353         bool active = false;
354         if (String("show") == msg)
355             active = true;
356 #if ENABLE(TIZEN_ISF_PORT)
357         m_editorState = EditorState();
358         m_editorState.isContentEditable = active;
359         m_pageClient->updateTextInputState();
360 #endif
361     }
362 #if ENABLE(TIZEN_JSBRIDGE_PLUGIN)
363     else if (String("requestToNative,json") == request)
364         m_tizenClient.processJSBridgePlugin(this, request, msg);
365 #endif
366 }
367 #endif
368
369
370 #if ENABLE(TIZEN_INPUT_TAG_EXTENSION) || ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
371 void WebPageProxy::setFocusedInputElementValue(const String& inputValue)
372 {
373     if (!isValid())
374         return;
375
376     process()->send(Messages::WebPage::SetFocusedInputElementValue(inputValue), m_pageID);
377 }
378
379 String WebPageProxy::getFocusedInputElementValue()
380 {
381     if (!isValid())
382         return String();
383
384     String inputValue;
385     process()->sendSync(Messages::WebPage::GetFocusedInputElementValue(), Messages::WebPage::GetFocusedInputElementValue::Reply(inputValue), m_pageID);
386     return inputValue;
387 }
388 #endif
389
390 #if ENABLE(TIZEN_DATALIST_ELEMENT)
391 Vector<String> WebPageProxy::getFocusedInputElementDataList()
392 {
393     if (!isValid())
394         return Vector<String>();
395
396     Vector<String> optionList;
397     process()->sendSync(Messages::WebPage::GetFocusedInputElementDataList(), Messages::WebPage::GetFocusedInputElementDataList::Reply(optionList), m_pageID);
398     return optionList;
399 }
400 #endif
401
402 void WebPageProxy::focusedNodeChanged(const IntRect& focusedNodeRect)
403 {
404     static_cast<PageClientImpl*>(m_pageClient)->setFocusedNodeRect(focusedNodeRect);
405 }
406
407 void WebPageProxy::initializeTizenClient(const WKPageTizenClient* client)
408 {
409     m_tizenClient.initialize(client);
410 }
411
412 #if ENABLE(TIZEN_WEBKIT2_HIT_TEST)
413 #if ENABLE(TOUCH_ADJUSTMENT)
414 WebHitTestResult::Data WebPageProxy::hitTestResultAtPoint(const IntPoint& point, int hitTestMode, const IntSize& area)
415 #else
416 WebHitTestResult::Data WebPageProxy::hitTestResultAtPoint(const IntPoint& point, int hitTestMode)
417 #endif
418 {
419     WebHitTestResult::Data hitTestResultData;
420     if (!isValid())
421         return hitTestResultData;
422
423 #if ENABLE(TOUCH_ADJUSTMENT)
424     process()->sendSync(Messages::WebPage::HitTestResultAtPoint(point, hitTestMode, area),
425                         Messages::WebPage::HitTestResultAtPoint::Reply(hitTestResultData), m_pageID);
426 #else
427     process()->sendSync(Messages::WebPage::HitTestResultAtPoint(point, hitTestMode),
428                         Messages::WebPage::HitTestResultAtPoint::Reply(hitTestResultData), m_pageID);
429 #endif
430
431     return hitTestResultData;
432 }
433 #endif
434
435 #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
436 void WebPageProxy::hideContextMenu()
437 {
438     if (m_activeContextMenu)
439         m_activeContextMenu->hideContextMenu();
440 }
441
442 String WebPageProxy::contextMenuAbsoluteLinkURLString()
443 {
444     if (!m_activeContextMenu)
445         return String();
446
447     return m_activeContextMenuHitTestResultData.absoluteLinkURL;
448 }
449
450 String WebPageProxy::contextMenuAbsoluteImageURLString()
451 {
452     if (!m_activeContextMenu)
453         return String();
454
455     return m_activeContextMenuHitTestResultData.absoluteImageURL;
456 }
457 #endif
458
459 #if ENABLE(TIZEN_WEBKIT2_CLIPBOARD_HELPER)
460 void WebPageProxy::pasteContextMenuSelected()
461 {
462     static_cast<PageClientImpl*>(m_pageClient)->pasteContextMenuSelected();
463 }
464
465 void WebPageProxy::didSelectPasteMenuFromContextMenu(const String& data, const String& type)
466 {
467     if (!isValid())
468         return;
469
470 #if ENABLE(TIZEN_CLIPBOARD) || ENABLE(TIZEN_PASTEBOARD)
471     process()->send(Messages::WebPage::SetClipboardDataForPaste(data, type), m_pageID);
472 #endif
473     WebContextMenuItemData item(ActionType, ContextMenuItemTagPaste, String("Paste"), true, false);
474     process()->send(Messages::WebPage::DidSelectItemFromActiveContextMenu(item), m_pageID);
475 }
476 #endif
477
478 #if ENABLE(TIZEN_CLIPBOARD) || ENABLE(TIZEN_PASTEBOARD)
479 void WebPageProxy::setClipboardData(const String& data, const String& type)
480 {
481     static_cast<PageClientImpl*>(m_pageClient)->setClipboardData(data, type);
482 }
483
484 void WebPageProxy::clearClipboardData()
485 {
486     static_cast<PageClientImpl*>(m_pageClient)->clearClipboardData();
487 }
488 #endif
489
490 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
491 void WebPageProxy::executePasteFromClipboardItem(const String& data, const String& type)
492 {
493     if (!isValid())
494         return;
495
496 #if ENABLE(TIZEN_CLIPBOARD) || ENABLE(TIZEN_PASTEBOARD)
497     process()->send(Messages::WebPage::SetClipboardDataForPaste(data, type), m_pageID);
498 #endif
499     process()->send(Messages::WebPage::ExecuteEditCommandWithArgument("Paste", data), m_pageID);
500 }
501
502 void WebPageProxy::clipboardContextMenuSelected()
503 {
504     static_cast<PageClientImpl*>(m_pageClient)->clipboardContextMenuSelected();
505 }
506 #endif
507
508 #if ENABLE(TIZEN_REMOTE_WEB_INSPECTOR)
509 uint32_t WebPageProxy::startInspectorServer(uint32_t port)
510 {
511     if (!isValid())
512         return 0;
513
514     uint32_t assignedPort = 0;
515     process()->sendSync(Messages::WebPage::StartInspectorServer(port), Messages::WebPage::StartInspectorServer::Reply(assignedPort), m_pageID);
516     return assignedPort;
517 }
518
519 bool WebPageProxy::stopInspectorServer()
520 {
521     if (!isValid())
522         return false;
523
524     bool result = false;
525     process()->sendSync(Messages::WebPage::StopInspectorServer(), Messages::WebPage::StopInspectorServer::Reply(result), m_pageID);
526     return result;
527 }
528 #endif
529
530 #if ENABLE(TIZEN_MOBILE_WEB_PRINT)
531 void WebPageProxy::createPagesToPDF(const IntSize& surfaceSize, const IntSize& contentsSize, const String& fileName)
532 {
533     process()->send(Messages::WebPage::CreatePagesToPDF(surfaceSize, contentsSize, fileName), m_pageID);
534 }
535 #endif
536
537 #if ENABLE(TIZEN_WEB_STORAGE)
538 #if ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
539 void WebPageProxy::getWebStorageQuotaBytes(PassRefPtr<WebStorageQuotaCallback> prpCallback)
540 {
541     RefPtr<WebStorageQuotaCallback> callback = prpCallback;
542     if (!isValid()) {
543         callback->invalidate();
544         return;
545     }
546
547     uint64_t callbackID = callback->callbackID();
548     m_quotaCallbacks.set(callbackID, callback.get());
549     process()->send(Messages::WebPage::GetStorageQuotaBytes(callbackID), m_pageID);
550 }
551
552 void WebPageProxy::didGetWebStorageQuotaBytes(const uint32_t quota, uint64_t callbackID)
553 {
554     RefPtr<WebStorageQuotaCallback> callback = m_quotaCallbacks.take(callbackID);
555     if (!callback) {
556         // FIXME: Log error or assert.
557         // this can validly happen if a load invalidated the callback, though
558         return;
559     }
560
561     m_quotaCallbacks.remove(callbackID);
562
563     RefPtr<WebUInt32> uint32Object = WebUInt32::create(quota);
564     callback->performCallbackWithReturnValue(uint32Object.release().leakRef());
565 }
566 #endif
567
568 void WebPageProxy::setWebStorageQuotaBytes(uint32_t quota)
569 {
570     if (!isValid())
571         return;
572
573     process()->send(Messages::WebPage::SetStorageQuotaBytes(quota), m_pageID, 0);
574 }
575 #endif
576
577 void WebPageProxy::scale(double scaleFactor, const IntPoint& origin)
578 {
579 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
580     static_cast<PageClientImpl*>(m_pageClient)->scaleContents(scaleFactor, origin);
581 #else
582     scalePage(scaleFactor, origin);
583 #endif
584 }
585
586 void WebPageProxy::scaleImage(double scaleFactor, const IntPoint& origin)
587 {
588 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
589     static_cast<PageClientImpl*>(m_pageClient)->scaleImage(scaleFactor, origin);
590 #else
591     scalePage(scaleFactor, origin);
592 #endif
593 }
594
595 double WebPageProxy::scaleFactor()
596 {
597 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
598     return static_cast<PageClientImpl*>(m_pageClient)->scaleFactor();
599 #else
600     return pageScaleFactor();
601 #endif
602 }
603
604 #if ENABLE(TIZEN_ORIENTATION_EVENTS)
605 void WebPageProxy::sendOrientationChangeEvent(int orientation)
606 {
607     process()->send(Messages::WebPage::SendOrientationChangeEvent(orientation), m_pageID, 0);
608 }
609 #endif
610
611 void WebPageProxy::suspendPainting()
612 {
613     if (!isValid())
614         return;
615
616     process()->send(Messages::DrawingArea::SuspendPainting(), m_pageID);
617 }
618
619 void WebPageProxy::resumePainting()
620 {
621     if (!isValid())
622         return;
623
624     process()->send(Messages::DrawingArea::ResumePainting(), m_pageID);
625 }
626
627 void WebPageProxy::suspendJavaScriptAndResource()
628 {
629     if (!isValid())
630         return;
631
632     process()->send(Messages::WebPage::SuspendJavaScriptAndResources(), m_pageID);
633 }
634
635 void WebPageProxy::resumeJavaScriptAndResource()
636 {
637     if (!isValid())
638         return;
639
640     process()->send(Messages::WebPage::ResumeJavaScriptAndResources(), m_pageID);
641 }
642
643 void WebPageProxy::suspendAnimations()
644 {
645     if (!isValid())
646         return;
647
648     process()->send(Messages::WebPage::SuspendAnimations(), m_pageID);
649 }
650
651 void WebPageProxy::resumeAnimations()
652 {
653     if (!isValid())
654         return;
655
656     process()->send(Messages::WebPage::ResumeAnimations(), m_pageID);
657 }
658
659 #if ENABLE(TIZEN_PLUGIN_SUSPEND_RESUME)
660 void WebPageProxy::suspendPlugin()
661 {
662     if (!isValid())
663         return;
664
665     process()->send(Messages::WebPage::SuspendPlugin(), m_pageID);
666 }
667
668 void WebPageProxy::resumePlugin()
669 {
670     if (!isValid())
671         return;
672
673     process()->send(Messages::WebPage::ResumePlugin(), m_pageID);
674 }
675 #endif
676
677 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
678 void WebPageProxy::purgeBackingStoresOfInactiveView()
679 {
680     if (!isValid() || isViewVisible())
681         return;
682
683     process()->send(Messages::LayerTreeCoordinator::PurgeBackingStores(), m_pageID);
684 }
685 #endif
686
687 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
688 bool WebPageProxy::scrollOverflow(const FloatPoint& offset)
689 {
690     if (!isValid())
691         return false;
692
693 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION_ON_UI_SIDE)
694     if (static_cast<PageClientImpl*>(m_pageClient)->isScrollableLayerFocused())
695         return drawingArea()->layerTreeCoordinatorProxy()->setOffsetForFocusedScrollingContentsLayer(offset);
696 #endif
697     if (static_cast<PageClientImpl*>(m_pageClient)->isScrollableNodeFocused()) {
698         bool scrolled = false;
699         process()->sendSync(Messages::WebPage::ScrollOverflow(offset), Messages::WebPage::ScrollOverflow::Reply(scrolled), m_pageID);
700         return scrolled;
701     }
702
703     return false;
704 }
705
706 bool WebPageProxy::setPressedNodeAtPoint(const IntPoint& point, bool checkOverflowLayer, WebLayerID& webLayerID)
707 {
708     if (!isValid())
709         return false;
710
711     bool pressed = false;
712     process()->sendSync(Messages::WebPage::SetPressedNodeAtPoint(point, checkOverflowLayer), Messages::WebPage::SetPressedNodeAtPoint::Reply(pressed, webLayerID), m_pageID);
713
714     return pressed;
715 }
716
717 void WebPageProxy::setOverflowResult(bool pressed, uint32_t webLayerID)
718 {
719     static_cast<PageClientImpl*>(m_pageClient)->setOverflowResult(pressed, webLayerID);
720 }
721 #endif
722
723 void WebPageProxy::executeEditCommandWithArgument(const String& commandName, const String& argument)
724 {
725     if (!isValid())
726         return;
727
728     DEFINE_STATIC_LOCAL(String, ignoreSpellingCommandName, ("ignoreSpelling"));
729     if (commandName == ignoreSpellingCommandName)
730         ++m_pendingLearnOrIgnoreWordMessageCount;
731
732     process()->send(Messages::WebPage::ExecuteEditCommandWithArgument(commandName, argument), m_pageID);
733 }
734
735 void WebPageProxy::replyJavaScriptAlert()
736 {
737     if (!m_alertReply)
738         return;
739
740     m_alertReply->send();
741     m_alertReply = nullptr;
742 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
743     m_uiClient.notifyPopupReplyWaitingState(this, false);
744 #endif
745 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
746     process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(false);
747 #endif
748 }
749
750 void WebPageProxy::replyJavaScriptConfirm(bool result)
751 {
752     if (!m_confirmReply)
753         return;
754
755     m_confirmReply->send(result);
756     m_confirmReply = nullptr;
757 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
758     m_uiClient.notifyPopupReplyWaitingState(this, false);
759 #endif
760 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
761     process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(false);
762 #endif
763 }
764
765 void WebPageProxy::replyJavaScriptPrompt(const String& result)
766 {
767     if (!m_promptReply)
768         return;
769
770     m_promptReply->send(result);
771     m_promptReply = nullptr;
772 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
773     m_uiClient.notifyPopupReplyWaitingState(this, false);
774 #endif
775 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
776     process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(false);
777 #endif
778 }
779
780 #if ENABLE(TIZEN_SUPPORT_BEFORE_UNLOAD_CONFIRM_PANEL)
781 void WebPageProxy::replyBeforeUnloadConfirmPanel(bool result)
782 {
783     if (!m_beforeUnloadConfirmPanelReply)
784         return;
785
786     m_beforeUnloadConfirmPanelReply->send(result);
787     m_beforeUnloadConfirmPanelReply = nullptr;
788 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
789     process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(false);
790 #endif
791 }
792 #endif
793
794 #if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
795 void WebPageProxy::replyReceiveAuthenticationChallengeInFrame(bool result)
796 {
797     if (!m_AuthReply)
798         return;
799
800     m_AuthReply->send(result);
801     m_AuthReply = nullptr;
802 }
803 #endif
804
805 #if ENABLE(TIZEN_CERTIFICATE_HANDLING)
806 void WebPageProxy::replyPolicyForCertificateError(bool result)
807 {
808     if (!m_allowedReply)
809         return;
810
811     m_allowedReply->send(result);
812     m_allowedReply = nullptr;
813 }
814 #endif
815
816 #if PLUGIN_ARCHITECTURE(X11)
817 void WebPageProxy::createPluginContainer(uint64_t& windowID)
818 {
819     notImplemented();
820 }
821
822 void WebPageProxy::windowedPluginGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect, uint64_t windowID)
823 {
824     notImplemented();
825 }
826 #endif
827
828 void WebPageProxy::didRenderFrame()
829 {
830     static_cast<PageClientImpl*>(m_pageClient)->didRenderFrame();
831 }
832
833 void WebPageProxy::setBackgroundColor(double red, double green, double blue, double alpha)
834 {
835     static_cast<PageClientImpl*>(m_pageClient)->setBackgroundColor(red, green, blue, alpha);
836 }
837
838 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
839 bool WebPageProxy::makeContextCurrent()
840 {
841     return static_cast<PageClientImpl*>(m_pageClient)->makeContextCurrent();
842 }
843 #endif
844
845 #if ENABLE(TIZEN_ICON_DATABASE)
846 void WebPageProxy::didReceiveIcon()
847 {
848     static_cast<PageClientImpl*>(m_pageClient)->didReceiveIcon();
849 }
850 #endif
851
852 #if ENABLE(TIZEN_MULTIPLE_SELECT)
853 void WebPageProxy::valueChangedForPopupMenuMultiple(WebPopupMenuProxy*, Vector<int32_t> newSelectedIndex)
854 {
855     process()->send(Messages::WebPage::DidChangeSelectedIndexForActivePopupMenuMultiple(newSelectedIndex), m_pageID);
856 }
857 #endif
858
859 #if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
860 void WebPageProxy::pageDidRequestRestoreVisibleContentRect(const IntPoint& point, float scale)
861 {
862     m_pageClient->pageDidRequestRestoreVisibleContentRect(point, scale);
863 }
864 #endif
865
866 #if ENABLE(TIZEN_OFFLINE_PAGE_SAVE)
867 void WebPageProxy::saveSerializedHTMLDataForMainPage(const String& serializedData, const String& fileName)
868 {
869     static_cast<PageClientImpl*>(m_pageClient)->saveSerializedHTMLDataForMainPage(serializedData, fileName);
870 }
871
872 void WebPageProxy::saveSubresourcesData(Vector<WebSubresourceTizen> subresourceData)
873 {
874     static_cast<PageClientImpl*>(m_pageClient)->saveSubresourcesData(subresourceData);
875 }
876
877 void WebPageProxy::startOfflinePageSave(String subresourceFolderName)
878 {
879     if (!isValid())
880         return;
881
882     process()->send(Messages::WebPage::StartOfflinePageSave(subresourceFolderName), m_pageID);
883 }
884 #endif
885
886 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
887 bool WebPageProxy::selectClosestWord(const IntPoint& point)
888 {
889     if (!isValid())
890         return false;
891
892     bool result = false;
893     process()->sendSync(Messages::WebPage::SelectClosestWord(point), Messages::WebPage::SelectClosestWord::Reply(result), m_pageID);
894     return result;
895 }
896
897 int WebPageProxy::setLeftSelection(const IntPoint& point, const int direction)
898 {
899     if (!isValid())
900         return 0;
901
902     int result = 0;
903     process()->sendSync(Messages::WebPage::SetLeftSelection(point, direction), Messages::WebPage::SetLeftSelection::Reply(result), m_pageID);
904     return result;
905 }
906
907 int WebPageProxy::setRightSelection(const IntPoint& point, const int direction)
908 {
909     if (!isValid())
910         return 0;
911
912     int result = 0;
913     process()->sendSync(Messages::WebPage::SetRightSelection(point, direction), Messages::WebPage::SetRightSelection::Reply(result), m_pageID);
914     return result;
915 }
916
917 bool WebPageProxy::getSelectionHandlers(IntRect& leftRect, IntRect& rightRect)
918 {
919     if (!isValid())
920         return false;
921
922     bool result = false;
923     process()->sendSync(Messages::WebPage::GetSelectionHandlers(), Messages::WebPage::GetSelectionHandlers::Reply(leftRect, rightRect), m_pageID);
924     if (!leftRect.size().isZero() || !rightRect.size().isZero())
925         result = true;
926
927     return result;
928 }
929
930 String WebPageProxy::getSelectionText()
931 {
932     String ret;
933     if (!isValid())
934         return ret;
935
936     process()->sendSync(Messages::WebPage::GetSelectionText(), Messages::WebPage::GetSelectionText::Reply(ret), m_pageID);
937     return ret;
938 }
939
940 bool WebPageProxy::selectionRangeClear()
941 {
942     if (!isValid())
943         return false;
944
945     bool result = false;
946     process()->sendSync(Messages::WebPage::SelectionRangeClear(), Messages::WebPage::SelectionRangeClear::Reply(result), m_pageID);
947     return result;
948 }
949
950 bool WebPageProxy::scrollContentByCharacter(const IntPoint& point, SelectionDirection direction)
951 {
952     if (!isValid())
953         return false;
954
955     bool result = false;
956     process()->sendSync(Messages::WebPage::ScrollContentByCharacter(point, direction), Messages::WebPage::ScrollContentByCharacter::Reply(result), m_pageID);
957     return result;
958 }
959
960 bool WebPageProxy::scrollContentByLine(const IntPoint& point, SelectionDirection direction)
961 {
962     if (!isValid())
963         return false;
964
965     bool result = false;
966     process()->sendSync(Messages::WebPage::ScrollContentByLine(point, direction), Messages::WebPage::ScrollContentByLine::Reply(result), m_pageID);
967     return result;
968 }
969 #endif
970
971 #if ENABLE(TIZEN_LINK_MAGNIFIER)
972 void WebPageProxy::getLinkMagnifierRect(const WebCore::IntPoint& position, const WebCore::IntSize& size)
973 {
974     process()->send(Messages::WebPage::GetLinkMagnifierRect(position, size), m_pageID);
975 }
976
977 void WebPageProxy::didGetLinkMagnifierRect(const IntPoint& position, const IntRect& rect)
978 {
979     if (!rect.isEmpty())
980         LinkMagnifierProxy::linkMagnifier().show(EwkViewImpl::fromEvasObject(viewWidget()), position, rect);
981     else
982         openLink(position);
983 }
984
985 void WebPageProxy::openLink(const IntPoint& position)
986 {
987 #if ENABLE(GESTURE_EVENTS)
988     IntPoint globalPosition(static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->transformToScreen().mapPoint(position));
989     WebGestureEvent gesture(WebEvent::GestureSingleTap, position, globalPosition, WebEvent::Modifiers(0), ecore_time_get());
990     handleGestureEvent(gesture);
991 #endif
992 }
993 #endif
994
995 #if ENABLE(TIZEN_SCREEN_READER)
996 bool WebPageProxy::moveScreenReaderFocus(bool forward)
997 {
998     bool result;
999     process()->sendSync(Messages::WebPage::MoveScreenReaderFocus(forward), Messages::WebPage::MoveScreenReaderFocus::Reply(result), m_pageID);
1000     return result;
1001 }
1002
1003 void WebPageProxy::moveScreenReaderFocusByPoint(const IntPoint& point)
1004 {
1005     process()->send(Messages::WebPage::MoveScreenReaderFocusByPoint(point), m_pageID);
1006 }
1007
1008 void WebPageProxy::clearScreenReaderFocus()
1009 {
1010     process()->send(Messages::WebPage::ClearScreenReaderFocus(), m_pageID);
1011 }
1012
1013 bool WebPageProxy::raiseTapEvent(const IntPoint& position)
1014 {
1015     IntPoint globalPosition = static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->transformToScreen().mapPoint(position);
1016     bool result;
1017     process()->sendSync(Messages::WebPage::RaiseTapEvent(position, globalPosition), Messages::WebPage::RaiseTapEvent::Reply(result), m_pageID);
1018
1019     return result;
1020 }
1021
1022 void WebPageProxy::adjustScreenReaderFocusedObjectValue(bool up)
1023 {
1024     process()->send(Messages::WebPage::AdjustScreenReaderFocusedObjectValue(up), m_pageID);
1025 }
1026
1027 void WebPageProxy::recalcScreenReaderFocusRect()
1028 {
1029     if (!ScreenReaderProxy::screenReader().isActive(static_cast<PageClientImpl*>(m_pageClient)->viewImpl()))
1030         return;
1031
1032     process()->send(Messages::WebPage::RecalcScreenReaderFocusRect(), m_pageID);
1033 }
1034
1035 void WebPageProxy::clearScreenReader()
1036 {
1037     process()->send(Messages::WebPage::ClearScreenReader(), m_pageID);
1038 }
1039
1040 void WebPageProxy::didScreenReaderFocusRectChanged(const IntRect& rect)
1041 {
1042 #if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
1043     FocusRing* focusRing = ewkViewGetFocusRing(viewWidget());
1044     if (!focusRing)
1045         return;
1046
1047     if (!rect.isEmpty())
1048         focusRing->show(rect);
1049     else
1050         focusRing->hide(false);
1051 #else
1052     UNUSED_PARAM(rect);
1053 #endif
1054 }
1055
1056 void WebPageProxy::didScreenReaderTextChanged(const String& text)
1057 {
1058     ScreenReaderProxy::screenReader().setText(text);
1059 }
1060 #endif
1061
1062 #if ENABLE(TIZEN_CSP)
1063 void WebPageProxy::setContentSecurityPolicy(const String& policy, WebCore::ContentSecurityPolicy::HeaderType type)
1064 {
1065     process()->send(Messages::WebPage::SetContentSecurityPolicy(policy, type), m_pageID);
1066 }
1067 #endif
1068
1069 #if ENABLE(TIZEN_APPLICATION_CACHE)
1070 void WebPageProxy::requestApplicationCachePermission(uint64_t frameID, const String& originIdentifier, PassRefPtr<Messages::WebPageProxy::RequestApplicationCachePermission::DelayedReply> allow)
1071 {
1072     WebFrameProxy* frame = process()->webFrame(frameID);
1073     MESSAGE_CHECK(frame);
1074
1075     // Since requestApplicationCachePermission() can spin a nested run loop we need to turn off the responsiveness timer.
1076     process()->responsivenessTimer()->stop();
1077
1078     m_applicationCacheReply = allow;
1079 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1080     process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
1081 #endif
1082     RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
1083
1084     if (!m_tizenClient.decidePolicyForApplicationCachePermissionRequest(this, origin.get(), frame))
1085         replyApplicationCachePermission(true);
1086 }
1087
1088 void WebPageProxy::replyApplicationCachePermission(bool allow)
1089 {
1090     if (!m_applicationCacheReply)
1091         return;
1092
1093     m_applicationCacheReply->send(allow);
1094     m_applicationCacheReply = nullptr;
1095 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1096     process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(false);
1097 #endif
1098 }
1099 #endif
1100
1101 #if ENABLE(TIZEN_INDEXED_DATABASE)
1102 void WebPageProxy::exceededIndexedDatabaseQuota(uint64_t frameID, const String& originIdentifier, int64_t currentUsage, PassRefPtr<Messages::WebPageProxy::ExceededIndexedDatabaseQuota::DelayedReply> reply)
1103 {
1104     WebFrameProxy* frame = process()->webFrame(frameID);
1105     MESSAGE_CHECK(frame);
1106
1107     // Since exceededIndexedDatabaseQuota() can spin a nested run loop we need to turn off the responsiveness timer.
1108     process()->responsivenessTimer()->stop();
1109
1110     m_exceededIndexedDatabaseQuotaReply = reply;
1111 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1112     process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
1113 #endif
1114
1115     RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
1116
1117     if (!m_tizenClient.exceededIndexedDatabaseQuota(this, origin.get(), currentUsage, frame))
1118         replyExceededIndexedDatabaseQuota(false);
1119 }
1120
1121 void WebPageProxy::replyExceededIndexedDatabaseQuota(bool allow)
1122 {
1123     if (!m_exceededIndexedDatabaseQuotaReply)
1124         return;
1125
1126     m_exceededIndexedDatabaseQuotaReply->send(allow);
1127     m_exceededIndexedDatabaseQuotaReply = nullptr;
1128 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1129     process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(false);
1130 #endif
1131 }
1132 #endif
1133
1134 #if ENABLE(TIZEN_SQL_DATABASE)
1135 void WebPageProxy::replyExceededDatabaseQuota(bool allow)
1136 {
1137     if (!m_exceededDatabaseQuotaReply) {
1138         TIZEN_LOGE("m_exceededDatabaseQuotaReply does not exist");
1139         return;
1140     }
1141
1142     m_exceededDatabaseQuotaReply->send(allow);
1143     m_exceededDatabaseQuotaReply = nullptr;
1144 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1145     process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(false);
1146 #endif
1147 }
1148 #endif
1149
1150 #if ENABLE(TIZEN_FILE_SYSTEM)
1151 void WebPageProxy::exceededLocalFileSystemQuota(uint64_t frameID, const String& originIdentifier, int64_t currentUsage, PassRefPtr<Messages::WebPageProxy::ExceededLocalFileSystemQuota::DelayedReply> reply)
1152 {
1153     WebFrameProxy* frame = process()->webFrame(frameID);
1154     MESSAGE_CHECK(frame);
1155
1156     // Since exceededLocalFileSystemQuota() can spin a nested run loop we need to turn off the responsiveness timer.
1157     process()->responsivenessTimer()->stop();
1158     m_exceededLocalFileSystemQuotaReply = reply;
1159 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1160     process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
1161 #endif
1162
1163     RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
1164
1165     if (!m_tizenClient.exceededLocalFileSystemQuota(this, origin.get(), currentUsage, frame))
1166         replyExceededLocalFileSystemQuota(false);
1167 }
1168
1169 void WebPageProxy::replyExceededLocalFileSystemQuota(bool allow)
1170 {
1171     if (!m_exceededLocalFileSystemQuotaReply)
1172         return;
1173
1174     m_exceededLocalFileSystemQuotaReply->send(allow);
1175     m_exceededLocalFileSystemQuotaReply = nullptr;
1176 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1177     process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(false);
1178 #endif
1179 }
1180 #endif
1181
1182 #endif // #if OS(TIZEN)
1183
1184 void WebPageProxy::handleInputMethodKeydown(bool& handled)
1185 {
1186 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1187     handled = m_keyEventQueue.first().forwardedEvent.isFiltered();
1188 #else
1189     handled = m_keyEventQueue.first().isFiltered();
1190 #endif
1191 }
1192
1193 void WebPageProxy::confirmComposition(const String& compositionString)
1194 {
1195     if (!isValid())
1196         return;
1197
1198 #if ENABLE(TIZEN_ISF_PORT)
1199     if (m_didCancelCompositionFromWebProcess)
1200         return;
1201 #endif
1202
1203     process()->send(Messages::WebPage::ConfirmComposition(compositionString), m_pageID, 0);
1204 }
1205
1206 void WebPageProxy::setComposition(const String& compositionString, Vector<WebCore::CompositionUnderline>& underlines, int cursorPosition)
1207 {
1208     if (!isValid())
1209         return;
1210
1211 #if ENABLE(TIZEN_REDUCE_KEY_LAGGING)
1212     // Suspend layout&paint at the key input, and resume layout&paint after 150 ms.
1213     suspendActiveDOMObjectsAndAnimations();
1214     if (m_pageContentResumeTimer)
1215         ecore_timer_del(m_pageContentResumeTimer);
1216     m_pageContentResumeTimer = ecore_timer_add(150.0/1000.0, pageContentResumeTimerFired, this);
1217 #endif
1218
1219     process()->send(Messages::WebPage::SetComposition(compositionString, underlines, cursorPosition), m_pageID, 0);
1220 }
1221
1222 void WebPageProxy::cancelComposition()
1223 {
1224     if (!isValid())
1225         return;
1226
1227     process()->send(Messages::WebPage::CancelComposition(), m_pageID, 0);
1228 }
1229
1230 #if ENABLE(TIZEN_USE_SETTINGS_FONT)
1231 void WebPageProxy::useSettingsFont()
1232 {
1233     process()->send(Messages::WebPage::UseSettingsFont(), m_pageID, 0);
1234 }
1235 #endif
1236
1237 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
1238 void WebPageProxy::setContentSuspendedByInspector(bool isSuspended)
1239 {
1240     m_contentSuspendedByInspector = isSuspended;
1241 }
1242 #endif
1243
1244 } // namespace WebKit