1/*
2 * Copyright (C) 2012 Apple Inc. All rights reserved.
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#import "config.h"
27#import "WebChromeClient.h"
28
29#if PLATFORM(IOS)
30
31#import "DrawingArea.h"
32#import "WebCoreArgumentCoders.h"
33#import "WebFrame.h"
34#import "WebPage.h"
35#import "WebPageProxyMessages.h"
36#import <WebCore/NotImplemented.h>
37
38namespace WebKit {
39
40#if ENABLE(IOS_TOUCH_EVENTS)
41void WebChromeClient::didPreventDefaultForEvent()
42{
43    notImplemented();
44}
45#endif
46
47void WebChromeClient::elementDidFocus(const WebCore::Node* node)
48{
49    m_page->elementDidFocus(const_cast<WebCore::Node*>(node));
50}
51
52void WebChromeClient::elementDidBlur(const WebCore::Node* node)
53{
54    m_page->elementDidBlur(const_cast<WebCore::Node*>(node));
55}
56
57void WebChromeClient::didReceiveMobileDocType(bool isMobileDoctype)
58{
59    m_page->didReceiveMobileDocType(isMobileDoctype);
60}
61
62void WebChromeClient::setNeedsScrollNotifications(WebCore::Frame*, bool)
63{
64    notImplemented();
65}
66
67void WebChromeClient::observedContentChange(WebCore::Frame*)
68{
69    m_page->completePendingSyntheticClickForContentChangeObserver();
70}
71
72void WebChromeClient::clearContentChangeObservers(WebCore::Frame*)
73{
74    notImplemented();
75}
76
77void WebChromeClient::notifyRevealedSelectionByScrollingFrame(WebCore::Frame*)
78{
79    m_page->send(Messages::WebPageProxy::NotifyRevealedSelection());
80}
81
82bool WebChromeClient::isStopping()
83{
84    notImplemented();
85    return false;
86}
87
88void WebChromeClient::didLayout(LayoutType)
89{
90    notImplemented();
91}
92
93void WebChromeClient::didStartOverflowScroll()
94{
95    notImplemented();
96}
97
98void WebChromeClient::didEndOverflowScroll()
99{
100    notImplemented();
101}
102
103bool WebChromeClient::hasStablePageScaleFactor() const
104{
105    return m_page->hasStablePageScaleFactor();
106}
107
108void WebChromeClient::suppressFormNotifications()
109{
110    notImplemented();
111}
112
113void WebChromeClient::restoreFormNotifications()
114{
115    notImplemented();
116}
117
118void WebChromeClient::addOrUpdateScrollingLayer(WebCore::Node*, PlatformLayer*, PlatformLayer*, const WebCore::IntSize&, bool, bool)
119{
120    notImplemented();
121}
122
123void WebChromeClient::removeScrollingLayer(WebCore::Node*, PlatformLayer*, PlatformLayer*)
124{
125    notImplemented();
126}
127
128void WebChromeClient::webAppOrientationsUpdated()
129{
130    notImplemented();
131}
132
133void WebChromeClient::showPlaybackTargetPicker(bool hasVideo)
134{
135    m_page->send(Messages::WebPageProxy::ShowPlaybackTargetPicker(hasVideo, m_page->rectForElementAtInteractionLocation()));
136}
137
138std::chrono::milliseconds WebChromeClient::eventThrottlingDelay()
139{
140    return m_page->eventThrottlingDelay();
141}
142
143int WebChromeClient::deviceOrientation() const
144{
145    return m_page->deviceOrientation();
146}
147
148} // namespace WebKit
149
150#endif // PLATFORM(IOS)
151