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