|
Lines 49-54
a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp_sec1
|
| 49 |
#include "DumpRenderTreeSupportQt.h" |
49 |
#include "DumpRenderTreeSupportQt.h" |
| 50 |
#endif |
50 |
#endif |
| 51 |
|
51 |
|
|
|
52 |
#if ENABLE(WEB_INTENTS) |
| 53 |
#include <WebKit2/WKIntentData.h> |
| 54 |
#endif |
| 55 |
#if ENABLE(WEB_INTENTS_TAG) |
| 56 |
#include <WebKit2/WKIntentServiceInfo.h> |
| 57 |
#endif |
| 58 |
|
| 52 |
using namespace std; |
59 |
using namespace std; |
| 53 |
|
60 |
|
| 54 |
namespace WTR { |
61 |
namespace WTR { |
|
Lines 241-247
InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp_sec2
|
| 241 |
0, // didReconnectDOMWindowExtensionToGlobalObject |
248 |
0, // didReconnectDOMWindowExtensionToGlobalObject |
| 242 |
0, // willDestroyGlobalObjectForDOMWindowExtension |
249 |
0, // willDestroyGlobalObjectForDOMWindowExtension |
| 243 |
didFinishProgress, // didFinishProgress |
250 |
didFinishProgress, // didFinishProgress |
| 244 |
0 // shouldForceUniversalAccessFromLocalURL |
251 |
0, // shouldForceUniversalAccessFromLocalURL |
|
|
252 |
didReceiveIntentForFrame, // didReceiveIntentForFrame |
| 253 |
registerIntentServiceForFrame // registerIntentServiceForFrame |
| 245 |
}; |
254 |
}; |
| 246 |
WKBundlePageSetPageLoaderClient(m_page, &loaderClient); |
255 |
WKBundlePageSetPageLoaderClient(m_page, &loaderClient); |
| 247 |
|
256 |
|
|
Lines 416-421
void InjectedBundlePage::didFinishProgress(WKBundlePageRef, const void *clientIn
a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp_sec3
|
| 416 |
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFinishProgress(); |
425 |
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFinishProgress(); |
| 417 |
} |
426 |
} |
| 418 |
|
427 |
|
|
|
428 |
void InjectedBundlePage::didReceiveIntentForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKIntentDataRef intent, WKTypeRef* userData, const void* clientInfo) |
| 429 |
{ |
| 430 |
#if ENABLE(WEB_INTENTS) |
| 431 |
InjectedBundle::shared().stringBuilder()->append("Received Web Intent: action="); |
| 432 |
WKRetainPtr<WKStringRef> wkAction(AdoptWK, WKIntentDataCopyAction(intent)); |
| 433 |
InjectedBundle::shared().stringBuilder()->append(toWTFString(wkAction.get())); |
| 434 |
InjectedBundle::shared().stringBuilder()->append(" type="); |
| 435 |
WKRetainPtr<WKStringRef> wkType(AdoptWK, WKIntentDataCopyType(intent)); |
| 436 |
InjectedBundle::shared().stringBuilder()->append(toWTFString(wkType.get())); |
| 437 |
InjectedBundle::shared().stringBuilder()->append("\n"); |
| 438 |
|
| 439 |
// FIXME: Print number of ports when exposed in WebKit2 |
| 440 |
|
| 441 |
WKRetainPtr<WKURLRef> wkServiceUrl(AdoptWK, WKIntentDataCopyService(intent)); |
| 442 |
if (wkServiceUrl) { |
| 443 |
WKRetainPtr<WKStringRef> wkService(AdoptWK, WKURLCopyString(wkServiceUrl.get())); |
| 444 |
if (wkService && !WKStringIsEmpty(wkService.get())) { |
| 445 |
InjectedBundle::shared().stringBuilder()->append("Explicit intent service: "); |
| 446 |
InjectedBundle::shared().stringBuilder()->append(toWTFString(wkService.get())); |
| 447 |
InjectedBundle::shared().stringBuilder()->append("\n"); |
| 448 |
} |
| 449 |
} |
| 450 |
|
| 451 |
WKRetainPtr<WKDictionaryRef> wkExtras(AdoptWK, WKIntentDataCopyExtras(intent)); |
| 452 |
WKRetainPtr<WKArrayRef> wkExtraKeys(AdoptWK, WKDictionaryCopyKeys(wkExtras.get())); |
| 453 |
const size_t numExtraKeys = WKArrayGetSize(wkExtraKeys.get()); |
| 454 |
for (size_t i = 0; i < numExtraKeys; ++i) { |
| 455 |
WKStringRef wkKey = static_cast<WKStringRef>(WKArrayGetItemAtIndex(wkExtraKeys.get(), i)); |
| 456 |
WKStringRef wkValue = static_cast<WKStringRef>(WKDictionaryGetItemForKey(wkExtras.get(), wkKey)); |
| 457 |
InjectedBundle::shared().stringBuilder()->append("Extras["); |
| 458 |
InjectedBundle::shared().stringBuilder()->append(toWTFString(wkKey)); |
| 459 |
InjectedBundle::shared().stringBuilder()->append("] = "); |
| 460 |
InjectedBundle::shared().stringBuilder()->append(toWTFString(wkValue)); |
| 461 |
InjectedBundle::shared().stringBuilder()->append("\n"); |
| 462 |
} |
| 463 |
|
| 464 |
WKRetainPtr<WKArrayRef> wkSuggestions(AdoptWK, WKIntentDataCopySuggestions(intent)); |
| 465 |
const size_t numSuggestions = WKArrayGetSize(wkSuggestions.get()); |
| 466 |
for (size_t i = 0; i < numSuggestions; ++i) { |
| 467 |
WKStringRef wkSuggestion = static_cast<WKStringRef>(WKArrayGetItemAtIndex(wkSuggestions.get(), i)); |
| 468 |
InjectedBundle::shared().stringBuilder()->append("Have suggestion "); |
| 469 |
InjectedBundle::shared().stringBuilder()->append(toWTFString(wkSuggestion)); |
| 470 |
InjectedBundle::shared().stringBuilder()->append("\n"); |
| 471 |
} |
| 472 |
#endif |
| 473 |
} |
| 474 |
|
| 475 |
void InjectedBundlePage::registerIntentServiceForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKIntentServiceInfoRef serviceInfo, WKTypeRef* userData, const void* clientInfo) |
| 476 |
{ |
| 477 |
#if ENABLE(WEB_INTENTS_TAG) |
| 478 |
InjectedBundle::shared().stringBuilder()->append("Registered Web Intent Service: action="); |
| 479 |
WKRetainPtr<WKStringRef> wkAction(AdoptWK, WKIntentServiceInfoCopyAction(serviceInfo)); |
| 480 |
InjectedBundle::shared().stringBuilder()->append(toWTFString(wkAction.get())); |
| 481 |
InjectedBundle::shared().stringBuilder()->append(" type="); |
| 482 |
WKRetainPtr<WKStringRef> wkType(AdoptWK, WKIntentServiceInfoCopyType(serviceInfo)); |
| 483 |
InjectedBundle::shared().stringBuilder()->append(toWTFString(wkType.get())); |
| 484 |
InjectedBundle::shared().stringBuilder()->append(" title="); |
| 485 |
WKRetainPtr<WKStringRef> wkTitle(AdoptWK, WKIntentServiceInfoCopyTitle(serviceInfo)); |
| 486 |
InjectedBundle::shared().stringBuilder()->append(toWTFString(wkTitle.get())); |
| 487 |
InjectedBundle::shared().stringBuilder()->append(" url="); |
| 488 |
WKRetainPtr<WKURLRef> wkUrl(AdoptWK, WKIntentServiceInfoCopyHref(serviceInfo)); |
| 489 |
InjectedBundle::shared().stringBuilder()->append(toWTFString(adoptWK(WKURLCopyString(wkUrl.get())))); |
| 490 |
InjectedBundle::shared().stringBuilder()->append(" disposition="); |
| 491 |
WKRetainPtr<WKStringRef> wkDisposition(AdoptWK, WKIntentServiceInfoCopyDisposition(serviceInfo)); |
| 492 |
InjectedBundle::shared().stringBuilder()->append(toWTFString(wkDisposition.get())); |
| 493 |
InjectedBundle::shared().stringBuilder()->append("\n"); |
| 494 |
#endif |
| 495 |
} |
| 496 |
|
| 419 |
void InjectedBundlePage::didFinishDocumentLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void* clientInfo) |
497 |
void InjectedBundlePage::didFinishDocumentLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void* clientInfo) |
| 420 |
{ |
498 |
{ |
| 421 |
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFinishDocumentLoadForFrame(frame); |
499 |
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFinishDocumentLoadForFrame(frame); |