~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2010, 2011 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 "WebPageProxy.h"
 
28
 
 
29
#import "AttributedString.h"
 
30
#import "ColorSpaceData.h"
 
31
#import "DataReference.h"
 
32
#import "DictionaryPopupInfo.h"
 
33
#import "EditorState.h"
 
34
#import "NativeWebKeyboardEvent.h"
 
35
#import "PluginComplexTextInputState.h"
 
36
#import "PageClient.h"
 
37
#import "PageClientImpl.h"
 
38
#import "StringUtilities.h"
 
39
#import "TextChecker.h"
 
40
#import "WebPageMessages.h"
 
41
#import "WebProcessProxy.h"
 
42
#import <WebCore/DictationAlternative.h>
 
43
#import <WebCore/GraphicsLayer.h>
 
44
#import <WebCore/SharedBuffer.h>
 
45
#import <WebCore/TextAlternativeWithRange.h>
 
46
#import <WebKitSystemInterface.h>
 
47
#import <wtf/text/StringConcatenate.h>
 
48
 
 
49
@interface NSApplication (Details)
 
50
- (void)speakString:(NSString *)string;
 
51
@end
 
52
 
 
53
#define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, process()->connection())
 
54
 
 
55
using namespace WebCore;
 
56
 
 
57
namespace WebKit {
 
58
 
 
59
#if defined(__ppc__) || defined(__ppc64__)
 
60
#define PROCESSOR "PPC"
 
61
#elif defined(__i386__) || defined(__x86_64__)
 
62
#define PROCESSOR "Intel"
 
63
#else
 
64
#error Unknown architecture
 
65
#endif
 
66
 
 
67
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
 
68
 
 
69
static String macOSXVersionString()
 
70
{
 
71
    // Use underscores instead of dots because when we first added the Mac OS X version to the user agent string
 
72
    // we were concerned about old DHTML libraries interpreting "4." as Netscape 4. That's no longer a concern for us
 
73
    // but we're sticking with the underscores for compatibility with the format used by older versions of Safari.
 
74
    return [WKGetMacOSXVersionString() stringByReplacingOccurrencesOfString:@"." withString:@"_"];
 
75
}
 
76
 
 
77
#else
 
78
 
 
79
static inline int callGestalt(OSType selector)
 
80
{
 
81
    SInt32 value = 0;
 
82
    Gestalt(selector, &value);
 
83
    return value;
 
84
}
 
85
 
 
86
// Uses underscores instead of dots because if "4." ever appears in a user agent string, old DHTML libraries treat it as Netscape 4.
 
87
static String macOSXVersionString()
 
88
{
 
89
    // Can't use -[NSProcessInfo operatingSystemVersionString] because it has too much stuff we don't want.
 
90
    int major = callGestalt(gestaltSystemVersionMajor);
 
91
    ASSERT(major);
 
92
 
 
93
    int minor = callGestalt(gestaltSystemVersionMinor);
 
94
    int bugFix = callGestalt(gestaltSystemVersionBugFix);
 
95
    if (bugFix)
 
96
        return String::format("%d_%d_%d", major, minor, bugFix);
 
97
    if (minor)
 
98
        return String::format("%d_%d", major, minor);
 
99
    return String::format("%d", major);
 
100
}
 
101
 
 
102
#endif // __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
 
103
 
 
104
static String userVisibleWebKitVersionString()
 
105
{
 
106
    // If the version is 4 digits long or longer, then the first digit represents
 
107
    // the version of the OS. Our user agent string should not include this first digit,
 
108
    // so strip it off and report the rest as the version. <rdar://problem/4997547>
 
109
    NSString *fullVersion = [[NSBundle bundleForClass:NSClassFromString(@"WKView")] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey];
 
110
    NSRange nonDigitRange = [fullVersion rangeOfCharacterFromSet:[[NSCharacterSet decimalDigitCharacterSet] invertedSet]];
 
111
    if (nonDigitRange.location == NSNotFound && [fullVersion length] >= 4)
 
112
        return [fullVersion substringFromIndex:1];
 
113
    if (nonDigitRange.location != NSNotFound && nonDigitRange.location >= 4)
 
114
        return [fullVersion substringFromIndex:1];
 
115
    return fullVersion;
 
116
}
 
117
 
 
118
String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent)
 
119
{
 
120
    DEFINE_STATIC_LOCAL(String, osVersion, (macOSXVersionString()));
 
121
    DEFINE_STATIC_LOCAL(String, webKitVersion, (userVisibleWebKitVersionString()));
 
122
 
 
123
    if (applicationNameForUserAgent.isEmpty())
 
124
        return makeString("Mozilla/5.0 (Macintosh; " PROCESSOR " Mac OS X ", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko)");
 
125
    return makeString("Mozilla/5.0 (Macintosh; " PROCESSOR " Mac OS X ", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko) ", applicationNameForUserAgent);
 
126
}
 
127
 
 
128
void WebPageProxy::getIsSpeaking(bool& isSpeaking)
 
129
{
 
130
    isSpeaking = [NSApp isSpeaking];
 
131
}
 
132
 
 
133
void WebPageProxy::speak(const String& string)
 
134
{
 
135
    [NSApp speakString:nsStringFromWebCoreString(string)];
 
136
}
 
137
 
 
138
void WebPageProxy::stopSpeaking()
 
139
{
 
140
    [NSApp stopSpeaking:nil];
 
141
}
 
142
 
 
143
void WebPageProxy::searchWithSpotlight(const String& string)
 
144
{
 
145
    [[NSWorkspace sharedWorkspace] showSearchResultsForQueryString:nsStringFromWebCoreString(string)];
 
146
}
 
147
    
 
148
CGContextRef WebPageProxy::containingWindowGraphicsContext()
 
149
{
 
150
    return m_pageClient->containingWindowGraphicsContext();
 
151
}
 
152
 
 
153
void WebPageProxy::updateWindowIsVisible(bool windowIsVisible)
 
154
{
 
155
    if (!isValid())
 
156
        return;
 
157
    process()->send(Messages::WebPage::SetWindowIsVisible(windowIsVisible), m_pageID);
 
158
}
 
159
 
 
160
void WebPageProxy::windowAndViewFramesChanged(const IntRect& windowFrameInScreenCoordinates, const IntRect& viewFrameInWindowCoordinates, const IntPoint& accessibilityViewCoordinates)
 
161
{
 
162
    if (!isValid())
 
163
        return;
 
164
 
 
165
    process()->send(Messages::WebPage::WindowAndViewFramesChanged(windowFrameInScreenCoordinates, viewFrameInWindowCoordinates, accessibilityViewCoordinates), m_pageID);
 
166
}
 
167
 
 
168
void WebPageProxy::setComposition(const String& text, Vector<CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd)
 
169
{
 
170
    if (!isValid()) {
 
171
        // If this fails, we should call -discardMarkedText on input context to notify the input method.
 
172
        // This will happen naturally later, as part of reloading the page.
 
173
        return;
 
174
    }
 
175
 
 
176
    process()->sendSync(Messages::WebPage::SetComposition(text, underlines, selectionStart, selectionEnd, replacementRangeStart, replacementRangeEnd), Messages::WebPage::SetComposition::Reply(m_editorState), m_pageID);
 
177
}
 
178
 
 
179
void WebPageProxy::confirmComposition()
 
180
{
 
181
    if (!isValid())
 
182
        return;
 
183
 
 
184
    process()->sendSync(Messages::WebPage::ConfirmComposition(), Messages::WebPage::ConfirmComposition::Reply(m_editorState), m_pageID);
 
185
}
 
186
 
 
187
void WebPageProxy::cancelComposition()
 
188
{
 
189
    if (!isValid())
 
190
        return;
 
191
 
 
192
    process()->sendSync(Messages::WebPage::CancelComposition(), Messages::WebPage::ConfirmComposition::Reply(m_editorState), m_pageID);
 
193
}
 
194
 
 
195
bool WebPageProxy::insertText(const String& text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd)
 
196
{
 
197
    if (!isValid())
 
198
        return true;
 
199
 
 
200
    bool handled = true;
 
201
    process()->sendSync(Messages::WebPage::InsertText(text, replacementRangeStart, replacementRangeEnd), Messages::WebPage::InsertText::Reply(handled, m_editorState), m_pageID);
 
202
    return handled;
 
203
}
 
204
 
 
205
bool WebPageProxy::insertDictatedText(const String& text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, const Vector<TextAlternativeWithRange>& dictationAlternativesWithRange)
 
206
{
 
207
#if USE(DICTATION_ALTERNATIVES)
 
208
    if (dictationAlternativesWithRange.isEmpty())
 
209
        return insertText(text, replacementRangeStart, replacementRangeEnd);
 
210
 
 
211
    if (!isValid())
 
212
        return true;
 
213
 
 
214
    Vector<DictationAlternative> dictationAlternatives;
 
215
 
 
216
    for (size_t i = 0; i < dictationAlternativesWithRange.size(); ++i) {
 
217
        const TextAlternativeWithRange& alternativeWithRange = dictationAlternativesWithRange[i];
 
218
        uint64_t dictationContext = m_pageClient->addDictationAlternatives(alternativeWithRange.alternatives);
 
219
        if (dictationContext)
 
220
            dictationAlternatives.append(DictationAlternative(alternativeWithRange.range.location, alternativeWithRange.range.length, dictationContext));
 
221
    }
 
222
 
 
223
    if (dictationAlternatives.isEmpty())
 
224
        return insertText(text, replacementRangeStart, replacementRangeEnd);
 
225
 
 
226
    bool handled = true;
 
227
    process()->sendSync(Messages::WebPage::InsertDictatedText(text, replacementRangeStart, replacementRangeEnd, dictationAlternatives), Messages::WebPage::InsertDictatedText::Reply(handled, m_editorState), m_pageID);
 
228
    return handled;
 
229
#else
 
230
    return insertText(text, replacementRangeStart, replacementRangeEnd);
 
231
#endif
 
232
}
 
233
 
 
234
void WebPageProxy::getMarkedRange(uint64_t& location, uint64_t& length)
 
235
{
 
236
    location = NSNotFound;
 
237
    length = 0;
 
238
 
 
239
    if (!isValid())
 
240
        return;
 
241
 
 
242
    process()->sendSync(Messages::WebPage::GetMarkedRange(), Messages::WebPage::GetMarkedRange::Reply(location, length), m_pageID);
 
243
}
 
244
 
 
245
void WebPageProxy::getSelectedRange(uint64_t& location, uint64_t& length)
 
246
{
 
247
    location = NSNotFound;
 
248
    length = 0;
 
249
 
 
250
    if (!isValid())
 
251
        return;
 
252
 
 
253
    process()->sendSync(Messages::WebPage::GetSelectedRange(), Messages::WebPage::GetSelectedRange::Reply(location, length), m_pageID);
 
254
}
 
255
 
 
256
void WebPageProxy::getAttributedSubstringFromRange(uint64_t location, uint64_t length, AttributedString& result)
 
257
{
 
258
    if (!isValid())
 
259
        return;
 
260
    process()->sendSync(Messages::WebPage::GetAttributedSubstringFromRange(location, length), Messages::WebPage::GetAttributedSubstringFromRange::Reply(result), m_pageID);
 
261
}
 
262
 
 
263
uint64_t WebPageProxy::characterIndexForPoint(const IntPoint point)
 
264
{
 
265
    if (!isValid())
 
266
        return 0;
 
267
 
 
268
    uint64_t result = 0;
 
269
    process()->sendSync(Messages::WebPage::CharacterIndexForPoint(point), Messages::WebPage::CharacterIndexForPoint::Reply(result), m_pageID);
 
270
    return result;
 
271
}
 
272
 
 
273
IntRect WebPageProxy::firstRectForCharacterRange(uint64_t location, uint64_t length)
 
274
{
 
275
    if (!isValid())
 
276
        return IntRect();
 
277
 
 
278
    IntRect resultRect;
 
279
    process()->sendSync(Messages::WebPage::FirstRectForCharacterRange(location, length), Messages::WebPage::FirstRectForCharacterRange::Reply(resultRect), m_pageID);
 
280
    return resultRect;
 
281
}
 
282
 
 
283
bool WebPageProxy::executeKeypressCommands(const Vector<WebCore::KeypressCommand>& commands)
 
284
{
 
285
    if (!isValid())
 
286
        return false;
 
287
 
 
288
    bool result = false;
 
289
    process()->sendSync(Messages::WebPage::ExecuteKeypressCommands(commands), Messages::WebPage::ExecuteKeypressCommands::Reply(result, m_editorState), m_pageID);
 
290
    return result;
 
291
}
 
292
 
 
293
String WebPageProxy::stringSelectionForPasteboard()
 
294
{
 
295
    String value;
 
296
    if (!isValid())
 
297
        return value;
 
298
    
 
299
    const double messageTimeout = 20;
 
300
    process()->sendSync(Messages::WebPage::GetStringSelectionForPasteboard(), Messages::WebPage::GetStringSelectionForPasteboard::Reply(value), m_pageID, messageTimeout);
 
301
    return value;
 
302
}
 
303
 
 
304
PassRefPtr<WebCore::SharedBuffer> WebPageProxy::dataSelectionForPasteboard(const String& pasteboardType)
 
305
{
 
306
    if (!isValid())
 
307
        return 0;
 
308
    SharedMemory::Handle handle;
 
309
    uint64_t size = 0;
 
310
    const double messageTimeout = 20;
 
311
    process()->sendSync(Messages::WebPage::GetDataSelectionForPasteboard(pasteboardType),
 
312
                                                Messages::WebPage::GetDataSelectionForPasteboard::Reply(handle, size), m_pageID, messageTimeout);
 
313
    if (handle.isNull())
 
314
        return 0;
 
315
    RefPtr<SharedMemory> sharedMemoryBuffer = SharedMemory::create(handle, SharedMemory::ReadOnly);
 
316
    return SharedBuffer::create(static_cast<unsigned char *>(sharedMemoryBuffer->data()), size);
 
317
}
 
318
 
 
319
bool WebPageProxy::readSelectionFromPasteboard(const String& pasteboardName)
 
320
{
 
321
    if (!isValid())
 
322
        return false;
 
323
 
 
324
    bool result = false;
 
325
    const double messageTimeout = 20;
 
326
    process()->sendSync(Messages::WebPage::ReadSelectionFromPasteboard(pasteboardName), Messages::WebPage::ReadSelectionFromPasteboard::Reply(result), m_pageID, messageTimeout);
 
327
    return result;
 
328
}
 
329
 
 
330
#if ENABLE(DRAG_SUPPORT)
 
331
void WebPageProxy::setDragImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& dragImageHandle, bool isLinkDrag)
 
332
{
 
333
    RefPtr<ShareableBitmap> dragImage = ShareableBitmap::create(dragImageHandle);
 
334
    if (!dragImage)
 
335
        return;
 
336
    
 
337
    m_pageClient->setDragImage(clientPosition, dragImage.release(), isLinkDrag);
 
338
}
 
339
 
 
340
void WebPageProxy::setPromisedData(const String& pasteboardName, const SharedMemory::Handle& imageHandle, uint64_t imageSize, const String& filename, const String& extension,
 
341
                                   const String& title, const String& url, const String& visibleURL, const SharedMemory::Handle& archiveHandle, uint64_t archiveSize)
 
342
{
 
343
    RefPtr<SharedMemory> sharedMemoryImage = SharedMemory::create(imageHandle, SharedMemory::ReadOnly);
 
344
    RefPtr<SharedBuffer> imageBuffer = SharedBuffer::create(static_cast<unsigned char*>(sharedMemoryImage->data()), imageSize);
 
345
    RefPtr<SharedBuffer> archiveBuffer;
 
346
    
 
347
    if (!archiveHandle.isNull()) {
 
348
        RefPtr<SharedMemory> sharedMemoryArchive = SharedMemory::create(archiveHandle, SharedMemory::ReadOnly);;
 
349
        archiveBuffer = SharedBuffer::create(static_cast<unsigned char*>(sharedMemoryArchive->data()), archiveSize);
 
350
    }
 
351
    m_pageClient->setPromisedData(pasteboardName, imageBuffer, filename, extension, title, url, visibleURL, archiveBuffer);
 
352
}
 
353
#endif
 
354
 
 
355
void WebPageProxy::performDictionaryLookupAtLocation(const WebCore::FloatPoint& point)
 
356
{
 
357
    if (!isValid())
 
358
        return;
 
359
 
 
360
    process()->send(Messages::WebPage::PerformDictionaryLookupAtLocation(point), m_pageID); 
 
361
}
 
362
 
 
363
void WebPageProxy::interpretQueuedKeyEvent(const EditorState& state, bool& handled, Vector<WebCore::KeypressCommand>& commands)
 
364
{
 
365
    m_editorState = state;
 
366
    handled = m_pageClient->interpretKeyEvent(m_keyEventQueue.first(), commands);
 
367
}
 
368
 
 
369
// Complex text input support for plug-ins.
 
370
void WebPageProxy::sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput)
 
371
{
 
372
    if (!isValid())
 
373
        return;
 
374
    
 
375
    process()->send(Messages::WebPage::SendComplexTextInputToPlugin(pluginComplexTextInputIdentifier, textInput), m_pageID);
 
376
}
 
377
 
 
378
void WebPageProxy::uppercaseWord()
 
379
{
 
380
    process()->send(Messages::WebPage::UppercaseWord(), m_pageID);
 
381
}
 
382
 
 
383
void WebPageProxy::lowercaseWord()
 
384
{
 
385
    process()->send(Messages::WebPage::LowercaseWord(), m_pageID);
 
386
}
 
387
 
 
388
void WebPageProxy::capitalizeWord()
 
389
{
 
390
    process()->send(Messages::WebPage::CapitalizeWord(), m_pageID);
 
391
}
 
392
 
 
393
void WebPageProxy::setSmartInsertDeleteEnabled(bool isSmartInsertDeleteEnabled)
 
394
{
 
395
    if (m_isSmartInsertDeleteEnabled == isSmartInsertDeleteEnabled)
 
396
        return;
 
397
 
 
398
    TextChecker::setSmartInsertDeleteEnabled(isSmartInsertDeleteEnabled);
 
399
    m_isSmartInsertDeleteEnabled = isSmartInsertDeleteEnabled;
 
400
    process()->send(Messages::WebPage::SetSmartInsertDeleteEnabled(isSmartInsertDeleteEnabled), m_pageID);
 
401
}
 
402
 
 
403
void WebPageProxy::didPerformDictionaryLookup(const AttributedString& text, const DictionaryPopupInfo& dictionaryPopupInfo)
 
404
{
 
405
    m_pageClient->didPerformDictionaryLookup(text, dictionaryPopupInfo);
 
406
}
 
407
    
 
408
void WebPageProxy::registerWebProcessAccessibilityToken(const CoreIPC::DataReference& data)
 
409
{
 
410
    m_pageClient->accessibilityWebProcessTokenReceived(data);
 
411
}    
 
412
    
 
413
void WebPageProxy::makeFirstResponder()
 
414
{
 
415
    m_pageClient->makeFirstResponder();
 
416
}
 
417
 
 
418
ColorSpaceData WebPageProxy::colorSpace()
 
419
{
 
420
    return m_pageClient->colorSpace();
 
421
}
 
422
 
 
423
void WebPageProxy::registerUIProcessAccessibilityTokens(const CoreIPC::DataReference& elementToken, const CoreIPC::DataReference& windowToken)
 
424
{
 
425
    if (!isValid())
 
426
        return;
 
427
 
 
428
    process()->send(Messages::WebPage::RegisterUIProcessAccessibilityTokens(elementToken, windowToken), m_pageID);
 
429
}
 
430
 
 
431
void WebPageProxy::pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus)
 
432
{
 
433
    m_pageClient->pluginFocusOrWindowFocusChanged(pluginComplexTextInputIdentifier, pluginHasFocusAndWindowHasFocus);
 
434
}
 
435
 
 
436
void WebPageProxy::setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t pluginComplexTextInputState)
 
437
{
 
438
    MESSAGE_CHECK(isValidPluginComplexTextInputState(pluginComplexTextInputState));
 
439
 
 
440
    m_pageClient->setPluginComplexTextInputState(pluginComplexTextInputIdentifier, static_cast<PluginComplexTextInputState>(pluginComplexTextInputState));
 
441
}
 
442
 
 
443
void WebPageProxy::executeSavedCommandBySelector(const String& selector, bool& handled)
 
444
{
 
445
    MESSAGE_CHECK(isValidKeypressCommandName(selector));
 
446
 
 
447
    handled = m_pageClient->executeSavedCommandBySelector(selector);
 
448
}
 
449
 
 
450
bool WebPageProxy::shouldDelayWindowOrderingForEvent(const WebKit::WebMouseEvent& event)
 
451
{
 
452
    if (!process()->isValid())
 
453
        return false;
 
454
 
 
455
    bool result = false;
 
456
    const double messageTimeout = 3;
 
457
    process()->sendSync(Messages::WebPage::ShouldDelayWindowOrderingEvent(event), Messages::WebPage::ShouldDelayWindowOrderingEvent::Reply(result), m_pageID, messageTimeout);
 
458
    return result;
 
459
}
 
460
 
 
461
bool WebPageProxy::acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent& event)
 
462
{
 
463
    if (!isValid())
 
464
        return false;
 
465
 
 
466
    bool result = false;
 
467
    const double messageTimeout = 3;
 
468
    process()->sendSync(Messages::WebPage::AcceptsFirstMouse(eventNumber, event), Messages::WebPage::AcceptsFirstMouse::Reply(result), m_pageID, messageTimeout);
 
469
    return result;
 
470
}
 
471
 
 
472
WKView* WebPageProxy::wkView() const
 
473
{
 
474
    return m_pageClient->wkView();
 
475
}
 
476
 
 
477
void WebPageProxy::intrinsicContentSizeDidChange(const IntSize& intrinsicContentSize)
 
478
{
 
479
    m_pageClient->intrinsicContentSizeDidChange(intrinsicContentSize);
 
480
}
 
481
 
 
482
void WebPageProxy::setAcceleratedCompositingRootLayer(const GraphicsLayer* rootLayer)
 
483
{
 
484
    m_pageClient->setAcceleratedCompositingRootLayer(rootLayer->platformLayer());
 
485
}
 
486
 
 
487
} // namespace WebKit