Fix horizontal scroll issue
[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 #else
176     notImplemented();
177 #endif
178 }
179
180 void WebChromeClient::focusedFrameChanged(Frame* frame)
181 {
182     WebFrame* webFrame = frame ? static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame() : 0;
183
184     WebProcess::shared().connection()->send(Messages::WebPageProxy::FocusedFrameChanged(webFrame ? webFrame->frameID() : 0), m_page->pageID());
185 }
186
187 Page* WebChromeClient::createWindow(Frame* frame, const FrameLoadRequest& request, const WindowFeatures& windowFeatures, const NavigationAction& navigationAction)
188 {
189     uint32_t modifiers = static_cast<uint32_t>(InjectedBundleNavigationAction::modifiersForNavigationAction(navigationAction));
190     int32_t mouseButton = static_cast<int32_t>(InjectedBundleNavigationAction::mouseButtonForNavigationAction(navigationAction));
191
192     uint64_t newPageID = 0;
193     WebPageCreationParameters parameters;
194     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::CreateNewPage(request.resourceRequest(), windowFeatures, modifiers, mouseButton), Messages::WebPageProxy::CreateNewPage::Reply(newPageID, parameters), m_page->pageID()))
195         return 0;
196
197     if (!newPageID)
198         return 0;
199
200     WebProcess::shared().createWebPage(newPageID, parameters);
201 #if ENABLE(TIZEN_WEBKIT2_SAME_PAGE_GROUP_FOR_CREATE_WINDOW_OPERATION)
202     WebCore::Page* page = WebProcess::shared().webPage(newPageID)->corePage();
203     page->setGroupName(frame->page()->groupName());
204     return page;
205 #endif
206     return WebProcess::shared().webPage(newPageID)->corePage();
207 }
208
209 void WebChromeClient::show()
210 {
211     m_page->show();
212 }
213
214 bool WebChromeClient::canRunModal()
215 {
216     return m_page->canRunModal();
217 }
218
219 void WebChromeClient::runModal()
220 {
221     m_page->runModal();
222 }
223
224 void WebChromeClient::setToolbarsVisible(bool toolbarsAreVisible)
225 {
226     m_page->send(Messages::WebPageProxy::SetToolbarsAreVisible(toolbarsAreVisible));
227 }
228
229 bool WebChromeClient::toolbarsVisible()
230 {
231     WKBundlePageUIElementVisibility toolbarsVisibility = m_page->injectedBundleUIClient().toolbarsAreVisible(m_page);
232     if (toolbarsVisibility != WKBundlePageUIElementVisibilityUnknown)
233         return toolbarsVisibility == WKBundlePageUIElementVisible;
234     
235     bool toolbarsAreVisible = true;
236     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::GetToolbarsAreVisible(), Messages::WebPageProxy::GetToolbarsAreVisible::Reply(toolbarsAreVisible), m_page->pageID()))
237         return true;
238
239     return toolbarsAreVisible;
240 }
241
242 void WebChromeClient::setStatusbarVisible(bool statusBarIsVisible)
243 {
244     m_page->send(Messages::WebPageProxy::SetStatusBarIsVisible(statusBarIsVisible));
245 }
246
247 bool WebChromeClient::statusbarVisible()
248 {
249     WKBundlePageUIElementVisibility statusbarVisibility = m_page->injectedBundleUIClient().statusBarIsVisible(m_page);
250     if (statusbarVisibility != WKBundlePageUIElementVisibilityUnknown)
251         return statusbarVisibility == WKBundlePageUIElementVisible;
252
253     bool statusBarIsVisible = true;
254     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::GetStatusBarIsVisible(), Messages::WebPageProxy::GetStatusBarIsVisible::Reply(statusBarIsVisible), m_page->pageID()))
255         return true;
256
257     return statusBarIsVisible;
258 }
259
260 void WebChromeClient::setScrollbarsVisible(bool)
261 {
262     notImplemented();
263 }
264
265 bool WebChromeClient::scrollbarsVisible()
266 {
267     notImplemented();
268     return true;
269 }
270
271 void WebChromeClient::setMenubarVisible(bool menuBarVisible)
272 {
273     m_page->send(Messages::WebPageProxy::SetMenuBarIsVisible(menuBarVisible));
274 }
275
276 bool WebChromeClient::menubarVisible()
277 {
278     WKBundlePageUIElementVisibility menubarVisibility = m_page->injectedBundleUIClient().menuBarIsVisible(m_page);
279     if (menubarVisibility != WKBundlePageUIElementVisibilityUnknown)
280         return menubarVisibility == WKBundlePageUIElementVisible;
281     
282     bool menuBarIsVisible = true;
283     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::GetMenuBarIsVisible(), Messages::WebPageProxy::GetMenuBarIsVisible::Reply(menuBarIsVisible), m_page->pageID()))
284         return true;
285
286     return menuBarIsVisible;
287 }
288
289 void WebChromeClient::setResizable(bool resizable)
290 {
291     m_page->send(Messages::WebPageProxy::SetIsResizable(resizable));
292 }
293
294 #if ENABLE(TIZEN_DISPLAY_MESSAGE_TO_CONSOLE)
295 void WebChromeClient::addMessageToConsole(MessageSource, MessageType, MessageLevel level, const String& message, unsigned int lineNumber, const String& sourceID)
296 #else
297 void WebChromeClient::addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, unsigned int lineNumber, const String& sourceID)
298 #endif
299 {
300 #if ENABLE(TIZEN_DISPLAY_MESSAGE_TO_CONSOLE) // Request for WAC SDK
301     String newMessage;
302     if (lineNumber)
303         newMessage = String::format("%s:%d:%s", sourceID.utf8().data(), lineNumber, message.utf8().data());
304     else
305         newMessage = message;
306
307     switch (level) {
308     case WarningMessageLevel:
309         TIZEN_CONSOLEW("%s", newMessage.utf8().data());
310         break;
311     case ErrorMessageLevel:
312         TIZEN_CONSOLEE("%s", newMessage.utf8().data());
313         break;
314     case LogMessageLevel:
315         TIZEN_CONSOLED("%s", newMessage.utf8().data());
316         break;
317     default:
318         TIZEN_CONSOLEI("%s", newMessage.utf8().data());
319         break;
320     }
321 #endif
322     // Notify the bundle client.
323     m_page->injectedBundleUIClient().willAddMessageToConsole(m_page, message, lineNumber);
324
325     notImplemented();
326 }
327
328 bool WebChromeClient::canRunBeforeUnloadConfirmPanel()
329 {
330     return m_page->canRunBeforeUnloadConfirmPanel();
331 }
332
333 bool WebChromeClient::runBeforeUnloadConfirmPanel(const String& message, Frame* frame)
334 {
335 #if ENABLE(TIZEN_SUPPORT_BEFORE_UNLOAD_CONFIRM_PANEL)
336     WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
337
338     unsigned syncSendFlags = (WebCore::AXObjectCache::accessibilityEnabled()) ? CoreIPC::SpinRunLoopWhileWaitingForReply : 0;
339     bool shouldClose = false;
340 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
341     WebProcess::WaitForJavaScriptPopupFinished waiting;
342 #endif
343     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::RunBeforeUnloadConfirmPanel(message, webFrame->frameID()), Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::Reply(shouldClose), m_page->pageID(), CoreIPC::Connection::DefaultTimeout, syncSendFlags))
344         return false;
345
346     return shouldClose;
347 #else
348     WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
349
350     bool shouldClose = false;
351     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::RunBeforeUnloadConfirmPanel(message, webFrame->frameID()), Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::Reply(shouldClose), m_page->pageID()))
352         return false;
353
354     return shouldClose;
355 #endif
356 }
357
358 void WebChromeClient::closeWindowSoon()
359 {
360     // FIXME: This code assumes that the client will respond to a close page
361     // message by actually closing the page. Safari does this, but there is
362     // no guarantee that other applications will, which will leave this page
363     // half detached. This approach is an inherent limitation making parts of
364     // a close execute synchronously as part of window.close, but other parts
365     // later on.
366
367     m_page->corePage()->setGroupName(String());
368
369     if (WebFrame* frame = m_page->mainWebFrame()) {
370         if (Frame* coreFrame = frame->coreFrame())
371             coreFrame->loader()->stopForUserCancel();
372     }
373
374     m_page->sendClose();
375 }
376
377 void WebChromeClient::runJavaScriptAlert(Frame* frame, const String& alertText)
378 {
379     WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
380
381     // Notify the bundle client.
382     m_page->injectedBundleUIClient().willRunJavaScriptAlert(m_page, alertText, webFrame);
383
384     unsigned syncSendFlags = (WebCore::AXObjectCache::accessibilityEnabled()) ? CoreIPC::SpinRunLoopWhileWaitingForReply : 0;
385 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
386     WebProcess::WaitForJavaScriptPopupFinished waiting;
387 #endif
388     WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::RunJavaScriptAlert(webFrame->frameID(), alertText), Messages::WebPageProxy::RunJavaScriptAlert::Reply(), m_page->pageID(), CoreIPC::Connection::DefaultTimeout, syncSendFlags);
389 }
390
391 bool WebChromeClient::runJavaScriptConfirm(Frame* frame, const String& message)
392 {
393     WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
394
395     // Notify the bundle client.
396     m_page->injectedBundleUIClient().willRunJavaScriptConfirm(m_page, message, webFrame);
397
398     unsigned syncSendFlags = (WebCore::AXObjectCache::accessibilityEnabled()) ? CoreIPC::SpinRunLoopWhileWaitingForReply : 0;
399     bool result = false;
400 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
401     WebProcess::WaitForJavaScriptPopupFinished waiting;
402 #endif
403     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::RunJavaScriptConfirm(webFrame->frameID(), message), Messages::WebPageProxy::RunJavaScriptConfirm::Reply(result), m_page->pageID(), CoreIPC::Connection::DefaultTimeout, syncSendFlags))
404         return false;
405
406     return result;
407 }
408
409 bool WebChromeClient::runJavaScriptPrompt(Frame* frame, const String& message, const String& defaultValue, String& result)
410 {
411     WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
412
413     // Notify the bundle client.
414     m_page->injectedBundleUIClient().willRunJavaScriptPrompt(m_page, message, defaultValue, webFrame);
415
416     unsigned syncSendFlags = (WebCore::AXObjectCache::accessibilityEnabled()) ? CoreIPC::SpinRunLoopWhileWaitingForReply : 0;
417 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
418     WebProcess::WaitForJavaScriptPopupFinished waiting;
419 #endif
420     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::RunJavaScriptPrompt(webFrame->frameID(), message, defaultValue), Messages::WebPageProxy::RunJavaScriptPrompt::Reply(result), m_page->pageID(), CoreIPC::Connection::DefaultTimeout, syncSendFlags))
421         return false;
422
423     return !result.isNull();
424 }
425
426 void WebChromeClient::setStatusbarText(const String& statusbarText)
427 {
428     // Notify the bundle client.
429     m_page->injectedBundleUIClient().willSetStatusbarText(m_page, statusbarText);
430
431     m_page->send(Messages::WebPageProxy::SetStatusText(statusbarText));
432 }
433
434 bool WebChromeClient::shouldInterruptJavaScript()
435 {
436     bool shouldInterrupt = false;
437     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::ShouldInterruptJavaScript(), Messages::WebPageProxy::ShouldInterruptJavaScript::Reply(shouldInterrupt), m_page->pageID()))
438         return false;
439
440     return shouldInterrupt;
441 }
442
443 KeyboardUIMode WebChromeClient::keyboardUIMode()
444 {
445     return m_page->keyboardUIMode();
446 }
447
448 IntRect WebChromeClient::windowResizerRect() const
449 {
450     return m_page->windowResizerRect();
451 }
452
453 void WebChromeClient::invalidateRootView(const IntRect&, bool)
454 {
455     // Do nothing here, there's no concept of invalidating the window in the web process.
456 }
457
458 void WebChromeClient::invalidateContentsAndRootView(const IntRect& rect, bool)
459 {
460     if (Document* document = m_page->corePage()->mainFrame()->document()) {
461         if (document->printing())
462             return;
463     }
464
465     m_page->drawingArea()->setNeedsDisplay(rect);
466 }
467
468 void WebChromeClient::invalidateContentsForSlowScroll(const IntRect& rect, bool)
469 {
470     if (Document* document = m_page->corePage()->mainFrame()->document()) {
471         if (document->printing())
472             return;
473     }
474
475     m_page->pageDidScroll();
476     m_page->drawingArea()->setNeedsDisplay(rect);
477 }
478
479 void WebChromeClient::scroll(const IntSize& scrollOffset, const IntRect& scrollRect, const IntRect& clipRect)
480 {
481     m_page->pageDidScroll();
482     m_page->drawingArea()->scroll(intersection(scrollRect, clipRect), scrollOffset);
483 }
484
485 #if USE(TILED_BACKING_STORE)
486 void WebChromeClient::delegatedScrollRequested(const IntPoint& scrollOffset)
487 {
488     m_page->pageDidRequestScroll(scrollOffset);
489 }
490 #endif
491
492 IntPoint WebChromeClient::screenToRootView(const IntPoint& point) const
493 {
494     return m_page->screenToWindow(point);
495 }
496
497 IntRect WebChromeClient::rootViewToScreen(const IntRect& rect) const
498 {
499     return m_page->windowToScreen(rect);
500 }
501
502 PlatformPageClient WebChromeClient::platformPageClient() const
503 {
504     notImplemented();
505     return 0;
506 }
507
508 #if ENABLE(TIZEN_VIEWPORT_META_TAG)
509 static const int landscapeWidth = 640;
510 bool WebChromeClient::canContentsSizeChange(Frame* frame, const IntSize& size) const
511 {
512     // FIXME1: This patch should be removed AS SOON AS unexpected layout change problem is fixed.
513     // ex) m.news.naver.com
514     // FIXME2: By this patch, contents size is not changed properly on big size contents
515     // ex) www.expedia.com - fixedLayoutSize.width: 980, changedContentsSize: 1272
516     // ex) www.adobe.com - fixedLayoutSize.width: 360, changedContentsSize: 950
517     // ex) www.mt.co.kr (desktop site) - fixedLayoutSize.width: 980, changedContentsSize: 1090
518     FrameView* view = m_page->mainFrame()->view();
519     if (view->fixedLayoutSize().width() < size.width() && size.width() < landscapeWidth)
520         return false;
521
522     return true;
523 }
524 #endif
525
526 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
527 bool WebChromeClient::getStandaloneStatus()
528 {
529     bool standalone = false;
530     m_page->sendSync(Messages::WebPageProxy::GetStandaloneStatus(), Messages::WebPageProxy::GetStandaloneStatus::Reply(standalone), m_page->pageID());
531     return standalone;
532 }
533 #endif
534
535 #if ENABLE(TIZEN_SEARCH_PROVIDER)
536 void WebChromeClient::addSearchProvider(const String& baseURL, const String& engineURL)
537 {
538     m_page->send(Messages::WebPageProxy::AddSearchProvider(baseURL, engineURL));
539 }
540
541 unsigned long WebChromeClient::isSearchProviderInstalled(const String& baseURL, const String& engineURL)
542 {
543     uint64_t result;
544     m_page->sendSync(Messages::WebPageProxy::IsSearchProviderInstalled(baseURL, engineURL), Messages::WebPageProxy::IsSearchProviderInstalled::Reply(result));
545     return result;
546 }
547 #endif
548
549 void WebChromeClient::contentsSizeChanged(Frame* frame, const IntSize& size) const
550 {
551     if (!m_page->corePage()->settings()->frameFlatteningEnabled()) {
552         WebFrame* largestFrame = findLargestFrameInFrameSet(m_page);
553         if (largestFrame != m_cachedFrameSetLargestFrame.get()) {
554             m_cachedFrameSetLargestFrame = largestFrame;
555             m_page->send(Messages::WebPageProxy::FrameSetLargestFrameChanged(largestFrame ? largestFrame->frameID() : 0));
556         }
557     }
558
559     if (frame->page()->mainFrame() != frame)
560         return;
561
562 #if PLATFORM(QT) || (PLATFORM(EFL) && USE(TILED_BACKING_STORE))
563     if (m_page->useFixedLayout()) {
564         // The below method updates the size().
565         m_page->resizeToContentsIfNeeded();
566         m_page->drawingArea()->layerTreeHost()->sizeDidChange(m_page->size());
567     }
568
569 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
570     // FIXME: Logic to calculate the node's position is inefficient.
571     Frame* focusedFrame = m_page->corePage()->focusController()->focusedFrame();
572     if(focusedFrame && focusedFrame->document() && focusedFrame->document()->focusedNode()) {
573         Node* node = focusedFrame->document()->focusedNode();
574         IntRect nodeRect = IntRect(0, 0, 0, 0);
575         if (node) {
576             nodeRect = WebCore::pixelSnappedIntRect(node->getRect());
577             Frame* mainFrame = m_page->corePage()->mainFrame();
578             Frame* frame = node->document()->frame();
579             Node* owner;
580             while (frame && frame != mainFrame) {
581                 owner = frame->ownerElement();
582                 if (!owner)
583                     break;
584
585                 nodeRect.setX(nodeRect.x() + owner->getRect().x());
586                 nodeRect.setY(nodeRect.y() + owner->getRect().y());
587                 frame = owner->document()->frame();
588             }
589             // we have to divide (x, y) with pageZoomFactor because pageZoomFactor was applied to them.
590             nodeRect.setX(nodeRect.x() / m_page->pageScaleFactor());
591             nodeRect.setY(nodeRect.y() / m_page->pageScaleFactor());
592         }
593         m_page->send(Messages::WebPageProxy::FocusedNodeChanged(nodeRect));
594     }
595 #endif
596
597     m_page->send(Messages::WebPageProxy::DidChangeContentsSize(m_page->size()));
598 #endif
599
600     FrameView* frameView = frame->view();
601     if (frameView && !frameView->delegatesScrolling())  {
602         bool hasHorizontalScrollbar = frameView->horizontalScrollbar();
603         bool hasVerticalScrollbar = frameView->verticalScrollbar();
604
605         if (hasHorizontalScrollbar != m_cachedMainFrameHasHorizontalScrollbar || hasVerticalScrollbar != m_cachedMainFrameHasVerticalScrollbar) {
606             m_page->send(Messages::WebPageProxy::DidChangeScrollbarsForMainFrame(hasHorizontalScrollbar, hasVerticalScrollbar));
607
608             m_cachedMainFrameHasHorizontalScrollbar = hasHorizontalScrollbar;
609             m_cachedMainFrameHasVerticalScrollbar = hasVerticalScrollbar;
610         }
611     }
612 }
613
614 void WebChromeClient::scrollRectIntoView(const IntRect&) const
615 {
616     notImplemented();
617 }
618
619 bool WebChromeClient::shouldUnavailablePluginMessageBeButton(RenderEmbeddedObject::PluginUnavailabilityReason pluginUnavailabilityReason) const
620 {
621     if (pluginUnavailabilityReason == RenderEmbeddedObject::PluginMissing || pluginUnavailabilityReason == RenderEmbeddedObject::InsecurePluginVersion) {
622         // FIXME: <rdar://problem/8794397> We should only return true when there is a
623         // missingPluginButtonClicked callback defined on the Page UI client.
624         return true;
625     }
626
627     return false;
628 }
629     
630 void WebChromeClient::unavailablePluginButtonClicked(Element* element, RenderEmbeddedObject::PluginUnavailabilityReason pluginUnavailabilityReason) const
631 {
632     ASSERT(element->hasTagName(objectTag) || element->hasTagName(embedTag) || element->hasTagName(appletTag));
633     ASSERT(pluginUnavailabilityReason == RenderEmbeddedObject::PluginMissing || pluginUnavailabilityReason == RenderEmbeddedObject::InsecurePluginVersion);
634
635     HTMLPlugInImageElement* pluginElement = static_cast<HTMLPlugInImageElement*>(element);
636
637     m_page->send(Messages::WebPageProxy::UnavailablePluginButtonClicked(pluginUnavailabilityReason, pluginElement->serviceType(), pluginElement->url(), pluginElement->getAttribute(pluginspageAttr)));
638 }
639
640 void WebChromeClient::scrollbarsModeDidChange() const
641 {
642     notImplemented();
643 }
644
645 void WebChromeClient::mouseDidMoveOverElement(const HitTestResult& hitTestResult, unsigned modifierFlags)
646 {
647     RefPtr<APIObject> userData;
648
649     // Notify the bundle client.
650     m_page->injectedBundleUIClient().mouseDidMoveOverElement(m_page, hitTestResult, static_cast<WebEvent::Modifiers>(modifierFlags), userData);
651
652     // Notify the UIProcess.
653     WebHitTestResult::Data webHitTestResultData(hitTestResult);
654     m_page->send(Messages::WebPageProxy::MouseDidMoveOverElement(webHitTestResultData, modifierFlags, InjectedBundleUserMessageEncoder(userData.get())));
655 }
656
657 void WebChromeClient::setToolTip(const String& toolTip, TextDirection)
658 {
659     // Only send a tool tip to the WebProcess if it has changed since the last time this function was called.
660
661     if (toolTip == m_cachedToolTip)
662         return;
663     m_cachedToolTip = toolTip;
664
665     m_page->send(Messages::WebPageProxy::SetToolTip(m_cachedToolTip));
666 }
667
668 void WebChromeClient::print(Frame* frame)
669 {
670     WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
671     m_page->sendSync(Messages::WebPageProxy::PrintFrame(webFrame->frameID()), Messages::WebPageProxy::PrintFrame::Reply());
672 }
673
674 #if ENABLE(SQL_DATABASE)
675 void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& databaseName)
676 {
677     WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
678     SecurityOrigin* origin = frame->document()->securityOrigin();
679
680     DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(databaseName, origin);
681     uint64_t currentQuota = DatabaseTracker::tracker().quotaForOrigin(origin);
682
683 #if ENABLE(TIZEN_SQL_DATABASE)
684     uint64_t newQuota = 0;
685     const uint64_t defaultQuota = 5 * 1024 * 1024;
686     uint64_t requirement = currentQuota + details.expectedUsage();
687     if (requirement <= defaultQuota)
688         newQuota = requirement;
689     else {
690         unsigned syncSendFlags = (WebCore::AXObjectCache::accessibilityEnabled()) ? CoreIPC::SpinRunLoopWhileWaitingForReply : 0;
691         bool allowExceed = false;
692         WebProcess::shared().connection()->sendSync(
693             Messages::WebPageProxy::ExceededDatabaseQuota(webFrame->frameID(), origin->databaseIdentifier(), details.displayName(), details.expectedUsage()),
694             Messages::WebPageProxy::ExceededDatabaseQuota::Reply(allowExceed), m_page->pageID(), CoreIPC::Connection::DefaultTimeout, syncSendFlags);
695         if (allowExceed)
696             newQuota = currentQuota + details.expectedUsage();
697         else
698             newQuota = currentQuota;
699     }
700 #else
701     uint64_t currentOriginUsage = DatabaseTracker::tracker().usageForOrigin(origin);
702     uint64_t newQuota = 0;
703     WebProcess::shared().connection()->sendSync(
704         Messages::WebPageProxy::ExceededDatabaseQuota(webFrame->frameID(), origin->databaseIdentifier(), databaseName, details.displayName(), currentQuota, currentOriginUsage, details.currentUsage(), details.expectedUsage()),
705         Messages::WebPageProxy::ExceededDatabaseQuota::Reply(newQuota), m_page->pageID());
706 #endif
707
708     DatabaseTracker::tracker().setQuota(origin, newQuota);
709 }
710 #endif
711
712
713 void WebChromeClient::reachedMaxAppCacheSize(int64_t)
714 {
715     notImplemented();
716 }
717
718 void WebChromeClient::reachedApplicationCacheOriginQuota(SecurityOrigin*, int64_t)
719 {
720     notImplemented();
721 }
722
723 #if ENABLE(TIZEN_APPLICATION_CACHE)
724 bool WebChromeClient::requestApplicationCachePermission(Frame* frame)
725 {
726     WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
727     SecurityOrigin* origin = frame->document()->securityOrigin();
728
729     unsigned syncSendFlags = WebCore::AXObjectCache::accessibilityEnabled() ? CoreIPC::SpinRunLoopWhileWaitingForReply : 0;
730     bool allow = false;
731 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
732     WebProcess::WaitForJavaScriptPopupFinished waiting;
733 #endif
734
735     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::RequestApplicationCachePermission(webFrame->frameID(), origin->databaseIdentifier()), Messages::WebPageProxy::RequestApplicationCachePermission::Reply(allow), m_page->pageID(), CoreIPC::Connection::DefaultTimeout, syncSendFlags))
736         return false;
737
738     return allow;
739 }
740 #endif
741
742 #if ENABLE(DASHBOARD_SUPPORT)
743 void WebChromeClient::dashboardRegionsChanged()
744 {
745     notImplemented();
746 }
747 #endif
748
749 void WebChromeClient::populateVisitedLinks()
750 {
751 }
752
753 FloatRect WebChromeClient::customHighlightRect(Node*, const AtomicString& type, const FloatRect& lineRect)
754 {
755     notImplemented();
756     return FloatRect();
757 }
758
759 void WebChromeClient::paintCustomHighlight(Node*, const AtomicString& type, const FloatRect& boxRect, const FloatRect& lineRect,
760                                   bool behindText, bool entireLine)
761 {
762     notImplemented();
763 }
764
765 bool WebChromeClient::shouldReplaceWithGeneratedFileForUpload(const String& path, String& generatedFilename)
766 {
767     generatedFilename = m_page->injectedBundleUIClient().shouldGenerateFileForUpload(m_page, path);
768     return !generatedFilename.isNull();
769 }
770
771 String WebChromeClient::generateReplacementFile(const String& path)
772 {
773     return m_page->injectedBundleUIClient().generateFileForUpload(m_page, path);
774 }
775
776 bool WebChromeClient::paintCustomOverhangArea(GraphicsContext* context, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect)
777 {
778     if (!m_page->injectedBundleUIClient().shouldPaintCustomOverhangArea())
779         return false;
780
781     m_page->injectedBundleUIClient().paintCustomOverhangArea(m_page, context, horizontalOverhangArea, verticalOverhangArea, dirtyRect);
782     return true;
783 }
784
785 #if ENABLE(INPUT_TYPE_COLOR)
786 PassOwnPtr<ColorChooser> WebChromeClient::createColorChooser(ColorChooserClient* client, const Color& initialColor)
787 {
788     if (m_page->activeColorChooser())
789         return nullptr;
790
791     return adoptPtr(new WebColorChooser(m_page, client, initialColor));
792 }
793 #endif
794
795 void WebChromeClient::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> prpFileChooser)
796 {
797 #if OS(TIZEN)
798     if (m_page->activeOpenPanelResultListener())
799         m_page->cancelForOpenPanel();
800 #else
801     if (m_page->activeOpenPanelResultListener())
802         return;
803 #endif
804
805     RefPtr<FileChooser> fileChooser = prpFileChooser;
806
807     m_page->setActiveOpenPanelResultListener(WebOpenPanelResultListener::create(m_page, fileChooser.get()));
808     m_page->send(Messages::WebPageProxy::RunOpenPanel(static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame()->frameID(), fileChooser->settings()));
809 }
810
811 void WebChromeClient::loadIconForFiles(const Vector<String>& filenames, FileIconLoader* loader)
812 {
813     loader->notifyFinished(Icon::createIconForFiles(filenames));
814 }
815
816 void WebChromeClient::setCursor(const WebCore::Cursor& cursor)
817 {
818 #if USE(LAZY_NATIVE_CURSOR)
819     m_page->send(Messages::WebPageProxy::SetCursor(cursor));
820 #endif
821 }
822
823 void WebChromeClient::setCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves)
824 {
825     m_page->send(Messages::WebPageProxy::SetCursorHiddenUntilMouseMoves(hiddenUntilMouseMoves));
826 }
827
828 #if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER)
829 void WebChromeClient::scheduleAnimation()
830 {
831 #if USE(UI_SIDE_COMPOSITING)
832     m_page->drawingArea()->layerTreeHost()->scheduleAnimation();
833 #endif
834 }
835 #endif
836
837 void WebChromeClient::formStateDidChange(const Node*)
838 {
839     notImplemented();
840 }
841
842 bool WebChromeClient::selectItemWritingDirectionIsNatural()
843 {
844 #if PLATFORM(WIN)
845     return true;
846 #else
847     return false;
848 #endif
849 }
850
851 bool WebChromeClient::selectItemAlignmentFollowsMenuWritingDirection()
852 {
853 #if PLATFORM(WIN)
854     return false;
855 #else
856     return true;
857 #endif
858 }
859
860 bool WebChromeClient::hasOpenedPopup() const
861 {
862     notImplemented();
863     return false;
864 }
865
866 PassRefPtr<WebCore::PopupMenu> WebChromeClient::createPopupMenu(WebCore::PopupMenuClient* client) const
867 {
868     return WebPopupMenu::create(m_page, client);
869 }
870
871 PassRefPtr<WebCore::SearchPopupMenu> WebChromeClient::createSearchPopupMenu(WebCore::PopupMenuClient* client) const
872 {
873     return WebSearchPopupMenu::create(m_page, client);
874 }
875
876 #if USE(ACCELERATED_COMPOSITING)
877 void WebChromeClient::attachRootGraphicsLayer(Frame*, GraphicsLayer* layer)
878 {
879     if (layer)
880         m_page->enterAcceleratedCompositingMode(layer);
881     else
882         m_page->exitAcceleratedCompositingMode();
883 }
884
885 void WebChromeClient::setNeedsOneShotDrawingSynchronization()
886 {
887 #if ENABLE(TIZEN_ONESHOT_DRAWING_SYNCHRONIZATION)
888     if (m_page->drawingArea())
889         m_page->drawingArea()->setNeedsOneShotDrawingSynchronization();
890 #else
891     notImplemented();
892 #endif
893 }
894
895 void WebChromeClient::scheduleCompositingLayerSync()
896 {
897     if (m_page->drawingArea())
898         m_page->drawingArea()->scheduleCompositingLayerSync();
899 }
900
901 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
902 void WebChromeClient::addOrUpdateScrollingLayer(WebCore::Node*, WebCore::GraphicsLayer* scrollingLayer, WebCore::GraphicsLayer* contentsLayer, const WebCore::IntSize& scrollSize)
903 {
904     if (!m_page->drawingArea())
905         return;
906     m_page->drawingArea()->addOrUpdateScrollingLayer(scrollingLayer, contentsLayer, scrollSize);
907 }
908
909 void WebChromeClient::removeScrollingLayer(WebCore::Node*, WebCore::GraphicsLayer* scrollingLayer, WebCore::GraphicsLayer* contentsLayer)
910 {
911     if (!m_page->drawingArea())
912         return;
913     m_page->drawingArea()->removeScrollingLayer(scrollingLayer, contentsLayer);
914 }
915 #endif // ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
916 #endif // USE(ACCELERATED_COMPOSITING)
917
918 #if PLATFORM(WIN) && USE(AVFOUNDATION)
919 WebCore::GraphicsDeviceAdapter* WebChromeClient::graphicsDeviceAdapter() const
920 {
921     if (!m_page->drawingArea())
922         return 0;
923     return m_page->drawingArea()->layerTreeHost()->graphicsDeviceAdapter();
924 }
925 #endif
926
927 #if ENABLE(TOUCH_EVENTS)
928 void WebChromeClient::needTouchEvents(bool needTouchEvents)
929 {
930     m_page->send(Messages::WebPageProxy::NeedTouchEvents(needTouchEvents));
931 }
932 #endif
933
934 #if PLATFORM(WIN)
935 void WebChromeClient::setLastSetCursorToCurrentCursor()
936 {
937 }
938 #endif
939
940 #if ENABLE(FULLSCREEN_API)
941 bool WebChromeClient::supportsFullScreenForElement(const WebCore::Element* element, bool withKeyboard)
942 {
943     return m_page->fullScreenManager()->supportsFullScreen(withKeyboard);
944 }
945
946 void WebChromeClient::enterFullScreenForElement(WebCore::Element* element)
947 {
948     m_page->fullScreenManager()->enterFullScreenForElement(element);
949 }
950
951 void WebChromeClient::exitFullScreenForElement(WebCore::Element* element)
952 {
953     m_page->fullScreenManager()->exitFullScreenForElement(element);
954 }
955 #endif
956
957 void WebChromeClient::dispatchViewportPropertiesDidChange(const ViewportArguments&) const
958 {
959 #if USE(TILED_BACKING_STORE)
960     if (!m_page->useFixedLayout())
961         return;
962
963     m_page->sendViewportAttributesChanged();
964 #endif
965 }
966
967 void WebChromeClient::notifyScrollerThumbIsVisibleInRect(const IntRect& scrollerThumb)
968 {
969     m_page->send(Messages::WebPageProxy::NotifyScrollerThumbIsVisibleInRect(scrollerThumb));
970 }
971
972 void WebChromeClient::recommendedScrollbarStyleDidChange(int32_t newStyle)
973 {
974     m_page->send(Messages::WebPageProxy::RecommendedScrollbarStyleDidChange(newStyle));
975 }
976
977 bool WebChromeClient::shouldRubberBandInDirection(WebCore::ScrollDirection direction) const
978 {
979     ASSERT(direction != WebCore::ScrollUp && direction != WebCore::ScrollDown);
980     
981     if (direction == WebCore::ScrollLeft)
982         return m_page->injectedBundleUIClient().shouldRubberBandInDirection(m_page, WKScrollDirectionLeft);
983     if (direction == WebCore::ScrollRight)
984         return m_page->injectedBundleUIClient().shouldRubberBandInDirection(m_page, WKScrollDirectionRight);
985
986     ASSERT_NOT_REACHED();
987     return true;
988 }
989
990 void WebChromeClient::numWheelEventHandlersChanged(unsigned count)
991 {
992     m_page->numWheelEventHandlersChanged(count);
993 }
994
995 #if ENABLE(SCREEN_ORIENTATION_SUPPORT) && ENABLE(TIZEN_SCREEN_ORIENTATION_SUPPORT)
996 bool WebChromeClient::lockOrientation(int willLockOrientation)
997 {
998     bool result = false;
999     m_page->sendSync(Messages::WebPageProxy::LockOrientation(willLockOrientation), Messages::WebPageProxy::LockOrientation::Reply(result));
1000     return result;
1001 }
1002 void WebChromeClient::unlockOrientation()
1003 {
1004     m_page->send(Messages::WebPageProxy::UnlockOrientation());
1005 }
1006 #endif
1007
1008 void WebChromeClient::logDiagnosticMessage(const String& message, const String& description, const String& success)
1009 {
1010     if (!m_page->corePage()->settings()->diagnosticLoggingEnabled())
1011         return;
1012
1013     m_page->injectedBundleDiagnosticLoggingClient().logDiagnosticMessage(m_page, message, description, success);
1014 }
1015
1016 #if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
1017 void WebChromeClient::requestVisibleContentRectRestore(const IntPoint& scrollOffset, float scale)
1018 {
1019     m_page->pageDidRequestRestoreVisibleContentRect(scrollOffset, scale);
1020 }
1021
1022 float WebChromeClient::contentsScaleFactor() const
1023 {
1024     if (!m_page->drawingArea())
1025         return 0;
1026     return m_page->drawingArea()->layerTreeHost()->contentsScaleFactor();
1027 }
1028 #endif
1029
1030 #if OS(TIZEN)
1031 void WebChromeClient::rendererWillBeDestroyed(RenderObject* object)
1032 {
1033 #if ENABLE(TIZEN_SCREEN_READER)
1034     m_page->updateScreenReaderFocus(object);
1035 #endif
1036
1037 #if ENABLE(TIZEN_ISF_PORT)
1038     if (object->node() && object->node()->isRootEditableElement())
1039         m_page->send(Messages::WebPageProxy::RemoveInputMethodContext(reinterpret_cast<uintptr_t>(object->node())));
1040 #endif
1041 }
1042 #endif
1043
1044 #if ENABLE(TIZEN_INDEXED_DATABASE)
1045 bool WebChromeClient::exceededIndexedDatabaseQuota(Frame* frame, int64_t currentQuota)
1046 {
1047     WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
1048     SecurityOrigin* origin = frame->document()->securityOrigin();
1049
1050     unsigned syncSendFlags = (WebCore::AXObjectCache::accessibilityEnabled()) ? CoreIPC::SpinRunLoopWhileWaitingForReply : 0;
1051     bool allow = false;
1052 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1053     WebProcess::WaitForJavaScriptPopupFinished waiting;
1054 #endif
1055     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))
1056         return false;
1057
1058     return allow;
1059 }
1060 #endif
1061
1062 #if ENABLE(TIZEN_FILE_SYSTEM)
1063 bool WebChromeClient::exceededLocalFileSystemQuota(Frame* frame, int64_t currentQuota)
1064 {
1065     WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
1066     SecurityOrigin* origin = frame->document()->securityOrigin();
1067
1068     unsigned syncSendFlags = (WebCore::AXObjectCache::accessibilityEnabled()) ? CoreIPC::SpinRunLoopWhileWaitingForReply : 0;
1069     bool result = false;
1070 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1071     WebProcess::WaitForJavaScriptPopupFinished waiting;
1072 #endif
1073     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))
1074         return false;
1075
1076     return result;
1077 }
1078 #endif
1079
1080 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
1081 void WebChromeClient::setContentSuspendedByInspector(bool isSuspended)
1082 {
1083     m_page->send(Messages::WebPageProxy::setContentSuspendedByInspector(isSuspended));
1084 }
1085 #endif
1086 } // namespace WebKit