Cancel composition when focused node was changed
[framework/web/webkit-efl.git] / Source / WebKit2 / WebProcess / WebCoreSupport / WebChromeClient.cpp
1 /*
2  * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved.
3  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
15  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
18  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
24  * THE POSSIBILITY OF SUCH DAMAGE.
25  */
26
27 #include "config.h"
28 #include "WebChromeClient.h"
29
30 #include "DrawingArea.h"
31 #include "InjectedBundleNavigationAction.h"
32 #include "InjectedBundleUserMessageCoders.h"
33 #include "LayerTreeHost.h"
34 #include "WebColorChooser.h"
35 #include "WebCoreArgumentCoders.h"
36 #include "WebFrame.h"
37 #include "WebFrameLoaderClient.h"
38 #include "WebFullScreenManager.h"
39 #include "WebOpenPanelParameters.h"
40 #include "WebOpenPanelResultListener.h"
41 #include "WebPage.h"
42 #include "WebPageCreationParameters.h"
43 #include "WebPageProxyMessages.h"
44 #include "WebPopupMenu.h"
45 #include "WebPreferencesStore.h"
46 #include "WebProcess.h"
47 #include "WebSearchPopupMenu.h"
48 #include <WebCore/AXObjectCache.h>
49 #include <WebCore/ColorChooser.h>
50 #include <WebCore/DatabaseTracker.h>
51 #include <WebCore/FileChooser.h>
52 #include <WebCore/FileIconLoader.h>
53 #include <WebCore/Frame.h>
54 #include <WebCore/FrameLoadRequest.h>
55 #include <WebCore/FrameLoader.h>
56 #include <WebCore/FrameView.h>
57 #include <WebCore/HTMLNames.h>
58 #include <WebCore/HTMLPlugInImageElement.h>
59 #include <WebCore/Icon.h>
60 #include <WebCore/NotImplemented.h>
61 #include <WebCore/Page.h>
62 #include <WebCore/SecurityOrigin.h>
63 #include <WebCore/Settings.h>
64
65 using namespace WebCore;
66 using namespace HTMLNames;
67
68 namespace WebKit {
69
70 static double area(WebFrame* frame)
71 {
72     IntSize size = frame->visibleContentBoundsExcludingScrollbars().size();
73     return static_cast<double>(size.height()) * size.width();
74 }
75
76
77 static WebFrame* findLargestFrameInFrameSet(WebPage* page)
78 {
79     // Approximate what a user could consider a default target frame for application menu operations.
80
81     WebFrame* mainFrame = page->mainWebFrame();
82     if (!mainFrame->isFrameSet())
83         return 0;
84
85     WebFrame* largestSoFar = 0;
86
87     RefPtr<ImmutableArray> frameChildren = mainFrame->childFrames();
88     size_t count = frameChildren->size();
89     for (size_t i = 0; i < count; ++i) {
90         WebFrame* childFrame = frameChildren->at<WebFrame>(i);
91         if (!largestSoFar || area(childFrame) > area(largestSoFar))
92             largestSoFar = childFrame;
93     }
94
95     return largestSoFar;
96 }
97
98 void WebChromeClient::chromeDestroyed()
99 {
100     delete this;
101 }
102
103 void WebChromeClient::setWindowRect(const FloatRect& windowFrame)
104 {
105     m_page->send(Messages::WebPageProxy::SetWindowFrame(windowFrame));
106 }
107
108 FloatRect WebChromeClient::windowRect()
109 {
110     FloatRect newWindowFrame;
111
112     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::GetWindowFrame(), Messages::WebPageProxy::GetWindowFrame::Reply(newWindowFrame), m_page->pageID()))
113         return FloatRect();
114
115     return newWindowFrame;
116 }
117
118 FloatRect WebChromeClient::pageRect()
119 {
120     return FloatRect(FloatPoint(), m_page->size());
121 }
122
123 void WebChromeClient::focus()
124 {
125     m_page->send(Messages::WebPageProxy::SetFocus(true));
126 }
127
128 void WebChromeClient::unfocus()
129 {
130     m_page->send(Messages::WebPageProxy::SetFocus(false));
131 }
132
133 #if PLATFORM(MAC)
134 void WebChromeClient::makeFirstResponder()
135 {
136     m_page->send(Messages::WebPageProxy::MakeFirstResponder());
137 }    
138 #endif    
139
140 bool WebChromeClient::canTakeFocus(FocusDirection)
141 {
142     notImplemented();
143     return true;
144 }
145
146 void WebChromeClient::takeFocus(FocusDirection direction)
147 {
148     m_page->send(Messages::WebPageProxy::TakeFocus(direction));
149 }
150
151 void WebChromeClient::focusedNodeChanged(Node* node)
152 {
153 #if PLATFORM(EFL)
154     IntRect nodeRect = IntRect(0, 0, 0, 0);
155     if (node) {
156         nodeRect = WebCore::pixelSnappedIntRect(node->getRect());
157         Frame* mainFrame = m_page->corePage()->mainFrame();
158         Frame* frame = node->document()->frame();
159         Node* owner;
160         while (frame && frame != mainFrame) {
161             owner = frame->ownerElement();
162             if (owner) {
163                 nodeRect.setX(nodeRect.x() + owner->getRect().x());
164                 nodeRect.setY(nodeRect.y() + owner->getRect().y());
165                 frame = owner->document()->frame();
166             } else {
167                 break;
168             }
169         }
170         // we have to divide (x, y) with pageZoomFactor because pageZoomFactor was applied to them.
171         nodeRect.setX(nodeRect.x() / m_page->pageScaleFactor());
172         nodeRect.setY(nodeRect.y() / m_page->pageScaleFactor());
173     }
174     m_page->send(Messages::WebPageProxy::FocusedNodeChanged(nodeRect));
175
176 #if ENABLE(TIZEN_FOCUS_UI)
177     if (m_page->corePage()->settings()->isSpatialNavigationEnabled())
178         m_page->didChangeFocusedRect(m_page->corePage()->focusController()->focusedOrMainFrame()->document()->focusedNode());
179 #endif
180 #else
181     notImplemented();
182 #endif
183 }
184
185 void WebChromeClient::focusedFrameChanged(Frame* frame)
186 {
187     WebFrame* webFrame = frame ? static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame() : 0;
188
189     WebProcess::shared().connection()->send(Messages::WebPageProxy::FocusedFrameChanged(webFrame ? webFrame->frameID() : 0), m_page->pageID());
190 }
191
192 Page* WebChromeClient::createWindow(Frame* frame, const FrameLoadRequest& request, const WindowFeatures& windowFeatures, const NavigationAction& navigationAction)
193 {
194     uint32_t modifiers = static_cast<uint32_t>(InjectedBundleNavigationAction::modifiersForNavigationAction(navigationAction));
195     int32_t mouseButton = static_cast<int32_t>(InjectedBundleNavigationAction::mouseButtonForNavigationAction(navigationAction));
196
197     uint64_t newPageID = 0;
198     WebPageCreationParameters parameters;
199     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::CreateNewPage(request.resourceRequest(), windowFeatures, modifiers, mouseButton), Messages::WebPageProxy::CreateNewPage::Reply(newPageID, parameters), m_page->pageID()))
200         return 0;
201
202     if (!newPageID)
203         return 0;
204
205     WebProcess::shared().createWebPage(newPageID, parameters);
206 #if ENABLE(TIZEN_WEBKIT2_SAME_PAGE_GROUP_FOR_CREATE_WINDOW_OPERATION)
207     WebCore::Page* page = WebProcess::shared().webPage(newPageID)->corePage();
208     page->setGroupName(frame->page()->groupName());
209     return page;
210 #endif
211     return WebProcess::shared().webPage(newPageID)->corePage();
212 }
213
214 void WebChromeClient::show()
215 {
216     m_page->show();
217 }
218
219 bool WebChromeClient::canRunModal()
220 {
221     return m_page->canRunModal();
222 }
223
224 void WebChromeClient::runModal()
225 {
226     m_page->runModal();
227 }
228
229 void WebChromeClient::setToolbarsVisible(bool toolbarsAreVisible)
230 {
231     m_page->send(Messages::WebPageProxy::SetToolbarsAreVisible(toolbarsAreVisible));
232 }
233
234 bool WebChromeClient::toolbarsVisible()
235 {
236     WKBundlePageUIElementVisibility toolbarsVisibility = m_page->injectedBundleUIClient().toolbarsAreVisible(m_page);
237     if (toolbarsVisibility != WKBundlePageUIElementVisibilityUnknown)
238         return toolbarsVisibility == WKBundlePageUIElementVisible;
239     
240     bool toolbarsAreVisible = true;
241     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::GetToolbarsAreVisible(), Messages::WebPageProxy::GetToolbarsAreVisible::Reply(toolbarsAreVisible), m_page->pageID()))
242         return true;
243
244     return toolbarsAreVisible;
245 }
246
247 void WebChromeClient::setStatusbarVisible(bool statusBarIsVisible)
248 {
249     m_page->send(Messages::WebPageProxy::SetStatusBarIsVisible(statusBarIsVisible));
250 }
251
252 bool WebChromeClient::statusbarVisible()
253 {
254     WKBundlePageUIElementVisibility statusbarVisibility = m_page->injectedBundleUIClient().statusBarIsVisible(m_page);
255     if (statusbarVisibility != WKBundlePageUIElementVisibilityUnknown)
256         return statusbarVisibility == WKBundlePageUIElementVisible;
257
258     bool statusBarIsVisible = true;
259     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::GetStatusBarIsVisible(), Messages::WebPageProxy::GetStatusBarIsVisible::Reply(statusBarIsVisible), m_page->pageID()))
260         return true;
261
262     return statusBarIsVisible;
263 }
264
265 void WebChromeClient::setScrollbarsVisible(bool)
266 {
267     notImplemented();
268 }
269
270 bool WebChromeClient::scrollbarsVisible()
271 {
272     notImplemented();
273     return true;
274 }
275
276 void WebChromeClient::setMenubarVisible(bool menuBarVisible)
277 {
278     m_page->send(Messages::WebPageProxy::SetMenuBarIsVisible(menuBarVisible));
279 }
280
281 bool WebChromeClient::menubarVisible()
282 {
283     WKBundlePageUIElementVisibility menubarVisibility = m_page->injectedBundleUIClient().menuBarIsVisible(m_page);
284     if (menubarVisibility != WKBundlePageUIElementVisibilityUnknown)
285         return menubarVisibility == WKBundlePageUIElementVisible;
286     
287     bool menuBarIsVisible = true;
288     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::GetMenuBarIsVisible(), Messages::WebPageProxy::GetMenuBarIsVisible::Reply(menuBarIsVisible), m_page->pageID()))
289         return true;
290
291     return menuBarIsVisible;
292 }
293
294 void WebChromeClient::setResizable(bool resizable)
295 {
296     m_page->send(Messages::WebPageProxy::SetIsResizable(resizable));
297 }
298
299 #if ENABLE(TIZEN_DISPLAY_MESSAGE_TO_CONSOLE)
300 void WebChromeClient::addMessageToConsole(MessageSource, MessageType, MessageLevel level, const String& message, unsigned int lineNumber, const String& sourceID)
301 #else
302 void WebChromeClient::addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, unsigned int lineNumber, const String& sourceID)
303 #endif
304 {
305 #if ENABLE(TIZEN_DISPLAY_MESSAGE_TO_CONSOLE) // Request for WAC SDK
306     String newMessage;
307     if (lineNumber)
308         newMessage = String::format("%s:%d:%s", sourceID.utf8().data(), lineNumber, message.utf8().data());
309     else
310         newMessage = message;
311
312     switch (level) {
313     case WarningMessageLevel:
314         TIZEN_CONSOLEW("%s", newMessage.utf8().data());
315         break;
316     case ErrorMessageLevel:
317         TIZEN_CONSOLEE("%s", newMessage.utf8().data());
318         break;
319     case LogMessageLevel:
320         TIZEN_CONSOLED("%s", newMessage.utf8().data());
321         break;
322     default:
323         TIZEN_CONSOLEI("%s", newMessage.utf8().data());
324         break;
325     }
326 #endif
327     // Notify the bundle client.
328     m_page->injectedBundleUIClient().willAddMessageToConsole(m_page, message, lineNumber);
329
330     notImplemented();
331 }
332
333 bool WebChromeClient::canRunBeforeUnloadConfirmPanel()
334 {
335     return m_page->canRunBeforeUnloadConfirmPanel();
336 }
337
338 bool WebChromeClient::runBeforeUnloadConfirmPanel(const String& message, Frame* frame)
339 {
340 #if ENABLE(TIZEN_SUPPORT_BEFORE_UNLOAD_CONFIRM_PANEL)
341     WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
342
343     unsigned syncSendFlags = (WebCore::AXObjectCache::accessibilityEnabled()) ? CoreIPC::SpinRunLoopWhileWaitingForReply : 0;
344     bool shouldClose = false;
345 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
346     WebProcess::WaitForJavaScriptPopupFinished waiting;
347 #endif
348     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::RunBeforeUnloadConfirmPanel(message, webFrame->frameID()), Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::Reply(shouldClose), m_page->pageID(), CoreIPC::Connection::DefaultTimeout, syncSendFlags))
349         return false;
350
351     return shouldClose;
352 #else
353     WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
354
355     bool shouldClose = false;
356     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::RunBeforeUnloadConfirmPanel(message, webFrame->frameID()), Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::Reply(shouldClose), m_page->pageID()))
357         return false;
358
359     return shouldClose;
360 #endif
361 }
362
363 void WebChromeClient::closeWindowSoon()
364 {
365     // FIXME: This code assumes that the client will respond to a close page
366     // message by actually closing the page. Safari does this, but there is
367     // no guarantee that other applications will, which will leave this page
368     // half detached. This approach is an inherent limitation making parts of
369     // a close execute synchronously as part of window.close, but other parts
370     // later on.
371
372     m_page->corePage()->setGroupName(String());
373
374     if (WebFrame* frame = m_page->mainWebFrame()) {
375         if (Frame* coreFrame = frame->coreFrame())
376             coreFrame->loader()->stopForUserCancel();
377     }
378
379     m_page->sendClose();
380 }
381
382 void WebChromeClient::runJavaScriptAlert(Frame* frame, const String& alertText)
383 {
384     WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
385
386     // Notify the bundle client.
387     m_page->injectedBundleUIClient().willRunJavaScriptAlert(m_page, alertText, webFrame);
388
389     unsigned syncSendFlags = (WebCore::AXObjectCache::accessibilityEnabled()) ? CoreIPC::SpinRunLoopWhileWaitingForReply : 0;
390 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
391     WebProcess::WaitForJavaScriptPopupFinished waiting;
392 #endif
393     WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::RunJavaScriptAlert(webFrame->frameID(), alertText), Messages::WebPageProxy::RunJavaScriptAlert::Reply(), m_page->pageID(), CoreIPC::Connection::DefaultTimeout, syncSendFlags);
394 }
395
396 bool WebChromeClient::runJavaScriptConfirm(Frame* frame, const String& message)
397 {
398     WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
399
400     // Notify the bundle client.
401     m_page->injectedBundleUIClient().willRunJavaScriptConfirm(m_page, message, webFrame);
402
403     unsigned syncSendFlags = (WebCore::AXObjectCache::accessibilityEnabled()) ? CoreIPC::SpinRunLoopWhileWaitingForReply : 0;
404     bool result = false;
405 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
406     WebProcess::WaitForJavaScriptPopupFinished waiting;
407 #endif
408     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::RunJavaScriptConfirm(webFrame->frameID(), message), Messages::WebPageProxy::RunJavaScriptConfirm::Reply(result), m_page->pageID(), CoreIPC::Connection::DefaultTimeout, syncSendFlags))
409         return false;
410
411     return result;
412 }
413
414 bool WebChromeClient::runJavaScriptPrompt(Frame* frame, const String& message, const String& defaultValue, String& result)
415 {
416     WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
417
418     // Notify the bundle client.
419     m_page->injectedBundleUIClient().willRunJavaScriptPrompt(m_page, message, defaultValue, webFrame);
420
421     unsigned syncSendFlags = (WebCore::AXObjectCache::accessibilityEnabled()) ? CoreIPC::SpinRunLoopWhileWaitingForReply : 0;
422 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
423     WebProcess::WaitForJavaScriptPopupFinished waiting;
424 #endif
425     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::RunJavaScriptPrompt(webFrame->frameID(), message, defaultValue), Messages::WebPageProxy::RunJavaScriptPrompt::Reply(result), m_page->pageID(), CoreIPC::Connection::DefaultTimeout, syncSendFlags))
426         return false;
427
428     return !result.isNull();
429 }
430
431 void WebChromeClient::setStatusbarText(const String& statusbarText)
432 {
433     // Notify the bundle client.
434     m_page->injectedBundleUIClient().willSetStatusbarText(m_page, statusbarText);
435
436     m_page->send(Messages::WebPageProxy::SetStatusText(statusbarText));
437 }
438
439 bool WebChromeClient::shouldInterruptJavaScript()
440 {
441     bool shouldInterrupt = false;
442     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::ShouldInterruptJavaScript(), Messages::WebPageProxy::ShouldInterruptJavaScript::Reply(shouldInterrupt), m_page->pageID()))
443         return false;
444
445     return shouldInterrupt;
446 }
447
448 KeyboardUIMode WebChromeClient::keyboardUIMode()
449 {
450     return m_page->keyboardUIMode();
451 }
452
453 IntRect WebChromeClient::windowResizerRect() const
454 {
455     return m_page->windowResizerRect();
456 }
457
458 void WebChromeClient::invalidateRootView(const IntRect&, bool)
459 {
460     // Do nothing here, there's no concept of invalidating the window in the web process.
461 }
462
463 void WebChromeClient::invalidateContentsAndRootView(const IntRect& rect, bool)
464 {
465     if (Document* document = m_page->corePage()->mainFrame()->document()) {
466         if (document->printing())
467             return;
468     }
469
470     m_page->drawingArea()->setNeedsDisplay(rect);
471 }
472
473 void WebChromeClient::invalidateContentsForSlowScroll(const IntRect& rect, bool)
474 {
475     if (Document* document = m_page->corePage()->mainFrame()->document()) {
476         if (document->printing())
477             return;
478     }
479
480     m_page->pageDidScroll();
481     m_page->drawingArea()->setNeedsDisplay(rect);
482 }
483
484 void WebChromeClient::scroll(const IntSize& scrollOffset, const IntRect& scrollRect, const IntRect& clipRect)
485 {
486     m_page->pageDidScroll();
487     m_page->drawingArea()->scroll(intersection(scrollRect, clipRect), scrollOffset);
488 }
489
490 #if USE(TILED_BACKING_STORE)
491 void WebChromeClient::delegatedScrollRequested(const IntPoint& scrollOffset)
492 {
493     m_page->pageDidRequestScroll(scrollOffset);
494
495 #if OS(TIZEN)
496     m_page->didChangeContents(m_page->bounds());
497 #endif
498 }
499 #endif
500
501 IntPoint WebChromeClient::screenToRootView(const IntPoint& point) const
502 {
503     return m_page->screenToWindow(point);
504 }
505
506 IntRect WebChromeClient::rootViewToScreen(const IntRect& rect) const
507 {
508     return m_page->windowToScreen(rect);
509 }
510
511 PlatformPageClient WebChromeClient::platformPageClient() const
512 {
513     notImplemented();
514     return 0;
515 }
516
517 #if ENABLE(TIZEN_VIEWPORT_META_TAG)
518 bool WebChromeClient::canContentsSizeChange(Frame* frame, const IntSize& size) const
519 {
520     // FIXME1: This patch should be removed AS SOON AS unexpected layout change problem is fixed.
521     // A page on naver isn't fitted when device is moved from landscape to portrait.
522     String url = frame->document()->url().string();
523     if (url.startsWith("https://nid.naver.com/user"))
524         return false;
525
526     return true;
527 }
528 #endif
529
530 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
531 bool WebChromeClient::getStandaloneStatus()
532 {
533     bool standalone = false;
534     m_page->sendSync(Messages::WebPageProxy::GetStandaloneStatus(), Messages::WebPageProxy::GetStandaloneStatus::Reply(standalone), m_page->pageID());
535     return standalone;
536 }
537 #endif
538
539 #if ENABLE(TIZEN_SEARCH_PROVIDER)
540 void WebChromeClient::addSearchProvider(const String& baseURL, const String& engineURL)
541 {
542     m_page->send(Messages::WebPageProxy::AddSearchProvider(baseURL, engineURL));
543 }
544
545 unsigned long WebChromeClient::isSearchProviderInstalled(const String& baseURL, const String& engineURL)
546 {
547     uint64_t result;
548     m_page->sendSync(Messages::WebPageProxy::IsSearchProviderInstalled(baseURL, engineURL), Messages::WebPageProxy::IsSearchProviderInstalled::Reply(result));
549     return result;
550 }
551 #endif
552
553 void WebChromeClient::contentsSizeChanged(Frame* frame, const IntSize& size) const
554 {
555     if (!m_page->corePage()->settings()->frameFlatteningEnabled()) {
556         WebFrame* largestFrame = findLargestFrameInFrameSet(m_page);
557         if (largestFrame != m_cachedFrameSetLargestFrame.get()) {
558             m_cachedFrameSetLargestFrame = largestFrame;
559             m_page->send(Messages::WebPageProxy::FrameSetLargestFrameChanged(largestFrame ? largestFrame->frameID() : 0));
560         }
561     }
562
563     if (frame->page()->mainFrame() != frame)
564         return;
565
566 #if PLATFORM(QT) || (PLATFORM(EFL) && USE(TILED_BACKING_STORE))
567     if (m_page->useFixedLayout()) {
568         // The below method updates the size().
569         m_page->resizeToContentsIfNeeded();
570         m_page->drawingArea()->layerTreeHost()->sizeDidChange(m_page->size());
571     }
572
573 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
574     // FIXME: Logic to calculate the node's position is inefficient.
575     Frame* focusedFrame = m_page->corePage()->focusController()->focusedFrame();
576     if(focusedFrame && focusedFrame->document() && focusedFrame->document()->focusedNode()) {
577         Node* node = focusedFrame->document()->focusedNode();
578         IntRect nodeRect = IntRect(0, 0, 0, 0);
579         if (node) {
580             nodeRect = WebCore::pixelSnappedIntRect(node->getRect());
581             Frame* mainFrame = m_page->corePage()->mainFrame();
582             Frame* frame = node->document()->frame();
583             Node* owner;
584             while (frame && frame != mainFrame) {
585                 owner = frame->ownerElement();
586                 if (!owner)
587                     break;
588
589                 nodeRect.setX(nodeRect.x() + owner->getRect().x());
590                 nodeRect.setY(nodeRect.y() + owner->getRect().y());
591                 frame = owner->document()->frame();
592             }
593             // we have to divide (x, y) with pageZoomFactor because pageZoomFactor was applied to them.
594             nodeRect.setX(nodeRect.x() / m_page->pageScaleFactor());
595             nodeRect.setY(nodeRect.y() / m_page->pageScaleFactor());
596         }
597         m_page->send(Messages::WebPageProxy::FocusedNodeChanged(nodeRect));
598     }
599 #endif
600
601     m_page->send(Messages::WebPageProxy::DidChangeContentsSize(m_page->size()));
602 #endif
603
604     FrameView* frameView = frame->view();
605     if (frameView && !frameView->delegatesScrolling())  {
606         bool hasHorizontalScrollbar = frameView->horizontalScrollbar();
607         bool hasVerticalScrollbar = frameView->verticalScrollbar();
608
609         if (hasHorizontalScrollbar != m_cachedMainFrameHasHorizontalScrollbar || hasVerticalScrollbar != m_cachedMainFrameHasVerticalScrollbar) {
610             m_page->send(Messages::WebPageProxy::DidChangeScrollbarsForMainFrame(hasHorizontalScrollbar, hasVerticalScrollbar));
611
612             m_cachedMainFrameHasHorizontalScrollbar = hasHorizontalScrollbar;
613             m_cachedMainFrameHasVerticalScrollbar = hasVerticalScrollbar;
614         }
615     }
616 }
617
618 void WebChromeClient::scrollRectIntoView(const IntRect&) const
619 {
620     notImplemented();
621 }
622
623 bool WebChromeClient::shouldUnavailablePluginMessageBeButton(RenderEmbeddedObject::PluginUnavailabilityReason pluginUnavailabilityReason) const
624 {
625     if (pluginUnavailabilityReason == RenderEmbeddedObject::PluginMissing || pluginUnavailabilityReason == RenderEmbeddedObject::InsecurePluginVersion) {
626         // FIXME: <rdar://problem/8794397> We should only return true when there is a
627         // missingPluginButtonClicked callback defined on the Page UI client.
628         return true;
629     }
630
631     return false;
632 }
633     
634 void WebChromeClient::unavailablePluginButtonClicked(Element* element, RenderEmbeddedObject::PluginUnavailabilityReason pluginUnavailabilityReason) const
635 {
636     ASSERT(element->hasTagName(objectTag) || element->hasTagName(embedTag) || element->hasTagName(appletTag));
637     ASSERT(pluginUnavailabilityReason == RenderEmbeddedObject::PluginMissing || pluginUnavailabilityReason == RenderEmbeddedObject::InsecurePluginVersion);
638
639     HTMLPlugInImageElement* pluginElement = static_cast<HTMLPlugInImageElement*>(element);
640
641     m_page->send(Messages::WebPageProxy::UnavailablePluginButtonClicked(pluginUnavailabilityReason, pluginElement->serviceType(), pluginElement->url(), pluginElement->getAttribute(pluginspageAttr)));
642 }
643
644 void WebChromeClient::scrollbarsModeDidChange() const
645 {
646     notImplemented();
647 }
648
649 void WebChromeClient::mouseDidMoveOverElement(const HitTestResult& hitTestResult, unsigned modifierFlags)
650 {
651     RefPtr<APIObject> userData;
652
653     // Notify the bundle client.
654     m_page->injectedBundleUIClient().mouseDidMoveOverElement(m_page, hitTestResult, static_cast<WebEvent::Modifiers>(modifierFlags), userData);
655
656     // Notify the UIProcess.
657     WebHitTestResult::Data webHitTestResultData(hitTestResult);
658     m_page->send(Messages::WebPageProxy::MouseDidMoveOverElement(webHitTestResultData, modifierFlags, InjectedBundleUserMessageEncoder(userData.get())));
659 }
660
661 void WebChromeClient::setToolTip(const String& toolTip, TextDirection)
662 {
663     // Only send a tool tip to the WebProcess if it has changed since the last time this function was called.
664
665     if (toolTip == m_cachedToolTip)
666         return;
667     m_cachedToolTip = toolTip;
668
669     m_page->send(Messages::WebPageProxy::SetToolTip(m_cachedToolTip));
670 }
671
672 void WebChromeClient::print(Frame* frame)
673 {
674     WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
675     m_page->sendSync(Messages::WebPageProxy::PrintFrame(webFrame->frameID()), Messages::WebPageProxy::PrintFrame::Reply());
676 }
677
678 #if ENABLE(SQL_DATABASE)
679 void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& databaseName)
680 {
681     WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
682     SecurityOrigin* origin = frame->document()->securityOrigin();
683
684     DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(databaseName, origin);
685     uint64_t currentQuota = DatabaseTracker::tracker().quotaForOrigin(origin);
686
687 #if ENABLE(TIZEN_SQL_DATABASE)
688     uint64_t newQuota = 0;
689     const uint64_t defaultQuota = 5 * 1024 * 1024;
690     uint64_t requirement = currentQuota + details.expectedUsage();
691     if (requirement <= defaultQuota)
692         newQuota = requirement;
693     else {
694         unsigned syncSendFlags = (WebCore::AXObjectCache::accessibilityEnabled()) ? CoreIPC::SpinRunLoopWhileWaitingForReply : 0;
695         bool allowExceed = false;
696         WebProcess::shared().connection()->sendSync(
697             Messages::WebPageProxy::ExceededDatabaseQuota(webFrame->frameID(), origin->databaseIdentifier(), details.displayName(), details.expectedUsage()),
698             Messages::WebPageProxy::ExceededDatabaseQuota::Reply(allowExceed), m_page->pageID(), CoreIPC::Connection::DefaultTimeout, syncSendFlags);
699         if (allowExceed)
700             newQuota = currentQuota + details.expectedUsage();
701         else
702             newQuota = currentQuota;
703     }
704 #else
705     uint64_t currentOriginUsage = DatabaseTracker::tracker().usageForOrigin(origin);
706     uint64_t newQuota = 0;
707     WebProcess::shared().connection()->sendSync(
708         Messages::WebPageProxy::ExceededDatabaseQuota(webFrame->frameID(), origin->databaseIdentifier(), databaseName, details.displayName(), currentQuota, currentOriginUsage, details.currentUsage(), details.expectedUsage()),
709         Messages::WebPageProxy::ExceededDatabaseQuota::Reply(newQuota), m_page->pageID());
710 #endif
711
712     DatabaseTracker::tracker().setQuota(origin, newQuota);
713 }
714 #endif
715
716
717 void WebChromeClient::reachedMaxAppCacheSize(int64_t)
718 {
719     notImplemented();
720 }
721
722 void WebChromeClient::reachedApplicationCacheOriginQuota(SecurityOrigin*, int64_t)
723 {
724     notImplemented();
725 }
726
727 #if ENABLE(TIZEN_APPLICATION_CACHE)
728 bool WebChromeClient::requestApplicationCachePermission(Frame* frame)
729 {
730     WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
731     SecurityOrigin* origin = frame->document()->securityOrigin();
732
733     unsigned syncSendFlags = WebCore::AXObjectCache::accessibilityEnabled() ? CoreIPC::SpinRunLoopWhileWaitingForReply : 0;
734     bool allow = false;
735 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
736     WebProcess::WaitForJavaScriptPopupFinished waiting;
737 #endif
738
739     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::RequestApplicationCachePermission(webFrame->frameID(), origin->databaseIdentifier()), Messages::WebPageProxy::RequestApplicationCachePermission::Reply(allow), m_page->pageID(), CoreIPC::Connection::DefaultTimeout, syncSendFlags))
740         return false;
741
742     return allow;
743 }
744 #endif
745
746 #if ENABLE(DASHBOARD_SUPPORT)
747 void WebChromeClient::dashboardRegionsChanged()
748 {
749     notImplemented();
750 }
751 #endif
752
753 void WebChromeClient::populateVisitedLinks()
754 {
755 }
756
757 FloatRect WebChromeClient::customHighlightRect(Node*, const AtomicString& type, const FloatRect& lineRect)
758 {
759     notImplemented();
760     return FloatRect();
761 }
762
763 void WebChromeClient::paintCustomHighlight(Node*, const AtomicString& type, const FloatRect& boxRect, const FloatRect& lineRect,
764                                   bool behindText, bool entireLine)
765 {
766     notImplemented();
767 }
768
769 bool WebChromeClient::shouldReplaceWithGeneratedFileForUpload(const String& path, String& generatedFilename)
770 {
771     generatedFilename = m_page->injectedBundleUIClient().shouldGenerateFileForUpload(m_page, path);
772     return !generatedFilename.isNull();
773 }
774
775 String WebChromeClient::generateReplacementFile(const String& path)
776 {
777     return m_page->injectedBundleUIClient().generateFileForUpload(m_page, path);
778 }
779
780 bool WebChromeClient::paintCustomOverhangArea(GraphicsContext* context, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect)
781 {
782     if (!m_page->injectedBundleUIClient().shouldPaintCustomOverhangArea())
783         return false;
784
785     m_page->injectedBundleUIClient().paintCustomOverhangArea(m_page, context, horizontalOverhangArea, verticalOverhangArea, dirtyRect);
786     return true;
787 }
788
789 #if ENABLE(INPUT_TYPE_COLOR)
790 PassOwnPtr<ColorChooser> WebChromeClient::createColorChooser(ColorChooserClient* client, const Color& initialColor)
791 {
792     if (m_page->activeColorChooser())
793         return nullptr;
794
795     return adoptPtr(new WebColorChooser(m_page, client, initialColor));
796 }
797 #endif
798
799 void WebChromeClient::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> prpFileChooser)
800 {
801 #if OS(TIZEN)
802     if (m_page->activeOpenPanelResultListener())
803         m_page->cancelForOpenPanel();
804 #else
805     if (m_page->activeOpenPanelResultListener())
806         return;
807 #endif
808
809     RefPtr<FileChooser> fileChooser = prpFileChooser;
810
811     m_page->setActiveOpenPanelResultListener(WebOpenPanelResultListener::create(m_page, fileChooser.get()));
812     m_page->send(Messages::WebPageProxy::RunOpenPanel(static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame()->frameID(), fileChooser->settings()));
813 }
814
815 void WebChromeClient::loadIconForFiles(const Vector<String>& filenames, FileIconLoader* loader)
816 {
817     loader->notifyFinished(Icon::createIconForFiles(filenames));
818 }
819
820 void WebChromeClient::setCursor(const WebCore::Cursor& cursor)
821 {
822 #if USE(LAZY_NATIVE_CURSOR)
823     m_page->send(Messages::WebPageProxy::SetCursor(cursor));
824 #endif
825 }
826
827 void WebChromeClient::setCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves)
828 {
829     m_page->send(Messages::WebPageProxy::SetCursorHiddenUntilMouseMoves(hiddenUntilMouseMoves));
830 }
831
832 #if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER)
833 void WebChromeClient::scheduleAnimation()
834 {
835 #if USE(UI_SIDE_COMPOSITING)
836     m_page->drawingArea()->layerTreeHost()->scheduleAnimation();
837 #endif
838 }
839 #endif
840
841 void WebChromeClient::formStateDidChange(const Node*)
842 {
843     notImplemented();
844 }
845
846 bool WebChromeClient::selectItemWritingDirectionIsNatural()
847 {
848 #if PLATFORM(WIN)
849     return true;
850 #else
851     return false;
852 #endif
853 }
854
855 bool WebChromeClient::selectItemAlignmentFollowsMenuWritingDirection()
856 {
857 #if PLATFORM(WIN)
858     return false;
859 #else
860     return true;
861 #endif
862 }
863
864 bool WebChromeClient::hasOpenedPopup() const
865 {
866     notImplemented();
867     return false;
868 }
869
870 PassRefPtr<WebCore::PopupMenu> WebChromeClient::createPopupMenu(WebCore::PopupMenuClient* client) const
871 {
872     return WebPopupMenu::create(m_page, client);
873 }
874
875 PassRefPtr<WebCore::SearchPopupMenu> WebChromeClient::createSearchPopupMenu(WebCore::PopupMenuClient* client) const
876 {
877     return WebSearchPopupMenu::create(m_page, client);
878 }
879
880 #if USE(ACCELERATED_COMPOSITING)
881 void WebChromeClient::attachRootGraphicsLayer(Frame*, GraphicsLayer* layer)
882 {
883     if (layer)
884         m_page->enterAcceleratedCompositingMode(layer);
885     else
886         m_page->exitAcceleratedCompositingMode();
887 }
888
889 void WebChromeClient::setNeedsOneShotDrawingSynchronization()
890 {
891 #if ENABLE(TIZEN_ONESHOT_DRAWING_SYNCHRONIZATION)
892     if (m_page->drawingArea())
893         m_page->drawingArea()->setNeedsOneShotDrawingSynchronization();
894 #else
895     notImplemented();
896 #endif
897 }
898
899 void WebChromeClient::scheduleCompositingLayerSync()
900 {
901     if (m_page->drawingArea())
902         m_page->drawingArea()->scheduleCompositingLayerSync();
903 }
904
905 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
906 void WebChromeClient::addOrUpdateScrollingLayer(WebCore::Node*, WebCore::GraphicsLayer* scrollingLayer, WebCore::GraphicsLayer* contentsLayer, const WebCore::IntSize& scrollSize)
907 {
908     if (!m_page->drawingArea())
909         return;
910     m_page->drawingArea()->addOrUpdateScrollingLayer(scrollingLayer, contentsLayer, scrollSize);
911 }
912
913 void WebChromeClient::removeScrollingLayer(WebCore::Node*, WebCore::GraphicsLayer* scrollingLayer, WebCore::GraphicsLayer* contentsLayer)
914 {
915     if (!m_page->drawingArea())
916         return;
917     m_page->drawingArea()->removeScrollingLayer(scrollingLayer, contentsLayer);
918 }
919 #endif // ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
920 #endif // USE(ACCELERATED_COMPOSITING)
921
922 #if PLATFORM(WIN) && USE(AVFOUNDATION)
923 WebCore::GraphicsDeviceAdapter* WebChromeClient::graphicsDeviceAdapter() const
924 {
925     if (!m_page->drawingArea())
926         return 0;
927     return m_page->drawingArea()->layerTreeHost()->graphicsDeviceAdapter();
928 }
929 #endif
930
931 #if ENABLE(TOUCH_EVENTS)
932 void WebChromeClient::needTouchEvents(bool needTouchEvents)
933 {
934     m_page->send(Messages::WebPageProxy::NeedTouchEvents(needTouchEvents));
935 }
936 #endif
937
938 #if PLATFORM(WIN)
939 void WebChromeClient::setLastSetCursorToCurrentCursor()
940 {
941 }
942 #endif
943
944 #if ENABLE(FULLSCREEN_API)
945 bool WebChromeClient::supportsFullScreenForElement(const WebCore::Element* element, bool withKeyboard)
946 {
947     return m_page->fullScreenManager()->supportsFullScreen(withKeyboard);
948 }
949
950 void WebChromeClient::enterFullScreenForElement(WebCore::Element* element)
951 {
952     m_page->fullScreenManager()->enterFullScreenForElement(element);
953 }
954
955 void WebChromeClient::exitFullScreenForElement(WebCore::Element* element)
956 {
957     m_page->fullScreenManager()->exitFullScreenForElement(element);
958 }
959 #endif
960
961 void WebChromeClient::dispatchViewportPropertiesDidChange(const ViewportArguments&) const
962 {
963 #if USE(TILED_BACKING_STORE)
964     if (!m_page->useFixedLayout())
965         return;
966
967     m_page->sendViewportAttributesChanged();
968 #endif
969 }
970
971 void WebChromeClient::notifyScrollerThumbIsVisibleInRect(const IntRect& scrollerThumb)
972 {
973     m_page->send(Messages::WebPageProxy::NotifyScrollerThumbIsVisibleInRect(scrollerThumb));
974 }
975
976 void WebChromeClient::recommendedScrollbarStyleDidChange(int32_t newStyle)
977 {
978     m_page->send(Messages::WebPageProxy::RecommendedScrollbarStyleDidChange(newStyle));
979 }
980
981 bool WebChromeClient::shouldRubberBandInDirection(WebCore::ScrollDirection direction) const
982 {
983     ASSERT(direction != WebCore::ScrollUp && direction != WebCore::ScrollDown);
984     
985     if (direction == WebCore::ScrollLeft)
986         return m_page->injectedBundleUIClient().shouldRubberBandInDirection(m_page, WKScrollDirectionLeft);
987     if (direction == WebCore::ScrollRight)
988         return m_page->injectedBundleUIClient().shouldRubberBandInDirection(m_page, WKScrollDirectionRight);
989
990     ASSERT_NOT_REACHED();
991     return true;
992 }
993
994 void WebChromeClient::numWheelEventHandlersChanged(unsigned count)
995 {
996     m_page->numWheelEventHandlersChanged(count);
997 }
998
999 #if ENABLE(SCREEN_ORIENTATION_SUPPORT) && ENABLE(TIZEN_SCREEN_ORIENTATION_SUPPORT)
1000 bool WebChromeClient::lockOrientation(int willLockOrientation)
1001 {
1002     bool result = false;
1003     m_page->sendSync(Messages::WebPageProxy::LockOrientation(willLockOrientation), Messages::WebPageProxy::LockOrientation::Reply(result));
1004     return result;
1005 }
1006 void WebChromeClient::unlockOrientation()
1007 {
1008     m_page->send(Messages::WebPageProxy::UnlockOrientation());
1009 }
1010 #endif
1011
1012 void WebChromeClient::logDiagnosticMessage(const String& message, const String& description, const String& success)
1013 {
1014     if (!m_page->corePage()->settings()->diagnosticLoggingEnabled())
1015         return;
1016
1017     m_page->injectedBundleDiagnosticLoggingClient().logDiagnosticMessage(m_page, message, description, success);
1018 }
1019
1020 #if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
1021 void WebChromeClient::requestVisibleContentRectRestore(const IntPoint& scrollOffset, float scale)
1022 {
1023     m_page->pageDidRequestRestoreVisibleContentRect(scrollOffset, scale);
1024 }
1025
1026 float WebChromeClient::contentsScaleFactor() const
1027 {
1028     if (!m_page->drawingArea())
1029         return 0;
1030     return m_page->drawingArea()->layerTreeHost()->contentsScaleFactor();
1031 }
1032 #endif
1033
1034 #if OS(TIZEN)
1035 void WebChromeClient::rendererWillBeDestroyed(RenderObject* object)
1036 {
1037 #if ENABLE(TIZEN_SCREEN_READER)
1038     m_page->updateScreenReaderFocus(object);
1039 #endif
1040
1041 #if ENABLE(TIZEN_ISF_PORT)
1042     if (object->node() && object->node()->isRootEditableElement())
1043         m_page->send(Messages::WebPageProxy::RemoveInputMethodContext(reinterpret_cast<uintptr_t>(object->node())));
1044 #endif
1045 }
1046 #endif
1047
1048 #if ENABLE(TIZEN_INDEXED_DATABASE)
1049 bool WebChromeClient::exceededIndexedDatabaseQuota(Frame* frame, int64_t currentQuota)
1050 {
1051     WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
1052     SecurityOrigin* origin = frame->document()->securityOrigin();
1053
1054     unsigned syncSendFlags = (WebCore::AXObjectCache::accessibilityEnabled()) ? CoreIPC::SpinRunLoopWhileWaitingForReply : 0;
1055     bool allow = false;
1056 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1057     WebProcess::WaitForJavaScriptPopupFinished waiting;
1058 #endif
1059     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::ExceededIndexedDatabaseQuota(webFrame->frameID(), origin->databaseIdentifier(), currentQuota), Messages::WebPageProxy::ExceededIndexedDatabaseQuota::Reply(allow), m_page->pageID(), CoreIPC::Connection::DefaultTimeout, syncSendFlags))
1060         return false;
1061
1062     return allow;
1063 }
1064 #endif
1065
1066 #if ENABLE(TIZEN_FILE_SYSTEM)
1067 bool WebChromeClient::exceededLocalFileSystemQuota(Frame* frame, int64_t currentQuota)
1068 {
1069     WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
1070     SecurityOrigin* origin = frame->document()->securityOrigin();
1071
1072     unsigned syncSendFlags = (WebCore::AXObjectCache::accessibilityEnabled()) ? CoreIPC::SpinRunLoopWhileWaitingForReply : 0;
1073     bool result = false;
1074 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1075     WebProcess::WaitForJavaScriptPopupFinished waiting;
1076 #endif
1077     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::ExceededLocalFileSystemQuota(webFrame->frameID(), origin->databaseIdentifier(), currentQuota), Messages::WebPageProxy::ExceededLocalFileSystemQuota::Reply(result), m_page->pageID(), CoreIPC::Connection::DefaultTimeout, syncSendFlags))
1078         return false;
1079
1080     return result;
1081 }
1082 #endif
1083
1084 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
1085 void WebChromeClient::setContentSuspendedByInspector(bool isSuspended)
1086 {
1087     m_page->send(Messages::WebPageProxy::setContentSuspendedByInspector(isSuspended));
1088 }
1089 #endif
1090 } // namespace WebKit