summaryrefslogtreecommitdiffstats
path: root/WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp
blob: 468d86cbc3c2c21bc53575fe2e0d7a91971358b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
/*
 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include "config.h"
#include "ChromeClientWinCE.h"

#include "FileChooser.h"
#include "Icon.h"
#include "NotImplemented.h"
#include "PopupMenuWin.h"
#include "SearchPopupMenuWin.h"
#include "WebView.h"
#include <wtf/text/CString.h>

using namespace WebCore;

namespace WebKit {

ChromeClientWinCE::ChromeClientWinCE(WebView* webView)
    : m_webView(webView)
{
    ASSERT(m_webView);
}

void ChromeClientWinCE::chromeDestroyed()
{
    delete this;
}

FloatRect ChromeClientWinCE::windowRect()
{
    if (!m_webView)
        return FloatRect();

    RECT rect;
    m_webView->frameRect(&rect);
    return rect;
}

void ChromeClientWinCE::setWindowRect(const FloatRect&)
{
    notImplemented();
}

FloatRect ChromeClientWinCE::pageRect()
{
    return windowRect();
}

float ChromeClientWinCE::scaleFactor()
{
    return 1.0;
}

void ChromeClientWinCE::focus()
{
    notImplemented();
}

void ChromeClientWinCE::unfocus()
{
    notImplemented();
}

Page* ChromeClientWinCE::createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&)
{
    notImplemented();
    return 0;
}

void ChromeClientWinCE::show()
{
    notImplemented();
}

bool ChromeClientWinCE::canRunModal()
{
    notImplemented();
    return false;
}

void ChromeClientWinCE::runModal()
{
    notImplemented();
}

void ChromeClientWinCE::setToolbarsVisible(bool)
{
    notImplemented();
}

bool ChromeClientWinCE::toolbarsVisible()
{
    return false;
}

void ChromeClientWinCE::setStatusbarVisible(bool)
{
    notImplemented();
}

bool ChromeClientWinCE::statusbarVisible()
{
    notImplemented();
    return false;
}

void ChromeClientWinCE::setScrollbarsVisible(bool)
{
    notImplemented();
}

bool ChromeClientWinCE::scrollbarsVisible()
{
    notImplemented();
    return false;
}

void ChromeClientWinCE::setMenubarVisible(bool)
{
    notImplemented();
}

bool ChromeClientWinCE::menubarVisible()
{
    notImplemented();
    return false;
}

void ChromeClientWinCE::setResizable(bool)
{
    notImplemented();
}

void ChromeClientWinCE::closeWindowSoon()
{
    PostMessageW(m_webView->windowHandle(), WM_CLOSE, 0, 0);
}

bool ChromeClientWinCE::canTakeFocus(FocusDirection)
{
    return true;
}

void ChromeClientWinCE::takeFocus(FocusDirection)
{
    unfocus();
}

void ChromeClientWinCE::focusedNodeChanged(Node*)
{
    notImplemented();
}

bool ChromeClientWinCE::canRunBeforeUnloadConfirmPanel()
{
    return true;
}

bool ChromeClientWinCE::runBeforeUnloadConfirmPanel(const String& message, Frame* frame)
{
    return runJavaScriptConfirm(frame, message);
}

void ChromeClientWinCE::addMessageToConsole(MessageSource, MessageType, MessageLevel, const String&, unsigned int, const String&)
{
    notImplemented();
}

void ChromeClientWinCE::runJavaScriptAlert(Frame*, const String& message)
{
    m_webView->runJavaScriptAlert(message);
}

bool ChromeClientWinCE::runJavaScriptConfirm(Frame*, const String& message)
{
    return m_webView->runJavaScriptConfirm(message);
}

bool ChromeClientWinCE::runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result)
{
    return m_webView->runJavaScriptPrompt(message, defaultValue, result);
}

void ChromeClientWinCE::setStatusbarText(const String&)
{
    notImplemented();
}

bool ChromeClientWinCE::shouldInterruptJavaScript()
{
    notImplemented();
    return false;
}

bool ChromeClientWinCE::tabsToLinks() const
{
    return true;
}

IntRect ChromeClientWinCE::windowResizerRect() const
{
    notImplemented();
    return IntRect();
}

void ChromeClientWinCE::invalidateWindow(const IntRect&, bool)
{
    notImplemented();
}

void ChromeClientWinCE::invalidateContentsAndWindow(const IntRect& updateRect, bool immediate)
{
    RECT rect = updateRect;
    InvalidateRect(m_webView->windowHandle(), &rect, FALSE);

    if (immediate)
        UpdateWindow(m_webView->windowHandle());
}

void ChromeClientWinCE::invalidateContentsForSlowScroll(const IntRect& updateRect, bool immediate)
{
    invalidateContentsAndWindow(updateRect, immediate);
}

void ChromeClientWinCE::scroll(const IntSize&, const IntRect& rectToScroll, const IntRect&)
{
    invalidateContentsAndWindow(rectToScroll, false);
}

IntRect ChromeClientWinCE::windowToScreen(const IntRect& rect) const
{
    notImplemented();
    return rect;
}

IntPoint ChromeClientWinCE::screenToWindow(const IntPoint& point) const
{
    notImplemented();
    return point;
}

PlatformPageClient ChromeClientWinCE::platformPageClient() const
{
    notImplemented();
    return 0;
}

void ChromeClientWinCE::contentsSizeChanged(Frame*, const IntSize&) const
{
    notImplemented();
}

void ChromeClientWinCE::scrollRectIntoView(const IntRect&, const ScrollView*) const
{
    notImplemented();
}

void ChromeClientWinCE::scrollbarsModeDidChange() const
{
    notImplemented();
}

void ChromeClientWinCE::mouseDidMoveOverElement(const HitTestResult&, unsigned)
{
    notImplemented();
}

void ChromeClientWinCE::setToolTip(const String&, TextDirection)
{
    notImplemented();
}

void ChromeClientWinCE::print(Frame*)
{
    notImplemented();
}

#if ENABLE(DATABASE)
void ChromeClientWinCE::exceededDatabaseQuota(Frame*, const String&)
{
    notImplemented()
}
#endif

#if ENABLE(OFFLINE_WEB_APPLICATIONS)
void ChromeClientWinCE::reachedMaxAppCacheSize(int64_t)
{
    notImplemented();
}
#endif

#if ENABLE(TOUCH_EVENTS)
void ChromeClientWinCE::needTouchEvents(bool)
{
    notImplemented();
}
#endif

#if USE(ACCELERATED_COMPOSITING)
void ChromeClientWinCE::attachRootGraphicsLayer(Frame*, GraphicsLayer*)
{
    notImplemented();
}

void ChromeClientWinCE::setNeedsOneShotDrawingSynchronization()
{
    notImplemented();
}

void ChromeClientWinCE::scheduleCompositingLayerSync()
{
    notImplemented();
}
#endif

void ChromeClientWinCE::runOpenPanel(Frame*, PassRefPtr<FileChooser> prpFileChooser)
{
    notImplemented();
}

void ChromeClientWinCE::chooseIconForFiles(const Vector<String>& filenames, FileChooser* chooser)
{
    chooser->iconLoaded(Icon::createIconForFiles(filenames));
}

void ChromeClientWinCE::setCursor(const Cursor&)
{
    notImplemented();
}

void ChromeClientWinCE::setLastSetCursorToCurrentCursor()
{
    notImplemented();
}

void ChromeClientWinCE::formStateDidChange(const Node*)
{
    notImplemented();
}

PassOwnPtr<HTMLParserQuirks> ChromeClientWinCE::createHTMLParserQuirks()
{
    return 0;
}

void ChromeClientWinCE::requestGeolocationPermissionForFrame(Frame*, Geolocation*)
{
    notImplemented();
}

void ChromeClientWinCE::cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*)
{
    notImplemented();
}

bool ChromeClientWinCE::selectItemWritingDirectionIsNatural()
{
    return false;
}

PassRefPtr<PopupMenu> ChromeClientWinCE::createPopupMenu(PopupMenuClient* client) const
{
    return adoptRef(new PopupMenuWin(client));
}

PassRefPtr<SearchPopupMenu> ChromeClientWinCE::createSearchPopupMenu(PopupMenuClient* client) const
{
    return adoptRef(new SearchPopupMenuWin(client));
}

} // namespace WebKit