void InjectedBundle::setGeolocationPermission(bool enabled) { WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetGeolocationPermission")); WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(enabled)); WKBundlePostMessage(m_bundle, messageName.get(), messageBody.get()); }
void InjectedBundle::postSetWindowIsKey(bool isKey) { WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetWindowIsKey")); WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(isKey)); WKBundlePostSynchronousMessage(m_bundle, messageName.get(), messageBody.get(), 0); }
void InjectedBundle::postSimulateWebNotificationClick(uint64_t notificationID) { WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SimulateWebNotificationClick")); WKRetainPtr<WKUInt64Ref> messageBody(AdoptWK, WKUInt64Create(notificationID)); WKBundlePostMessage(m_bundle, messageName.get(), messageBody.get()); }
void InjectedBundle::postNewBeforeUnloadReturnValue(bool value) { WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("BeforeUnloadReturnValue")); WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value)); WKBundlePostMessage(m_bundle, messageName.get(), messageBody.get()); }
void InjectedBundle::postSetBackingScaleFactor(double backingScaleFactor) { WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetBackingScaleFactor")); WKRetainPtr<WKDoubleRef> messageBody(AdoptWK, WKDoubleCreate(backingScaleFactor)); WKBundlePostMessage(m_bundle, messageName.get(), messageBody.get()); }
void QtBuiltinBundlePage::postNavigatorMessage(WKStringRef messageName, WKStringRef message) { WKTypeRef body[] = { page(), message }; WKRetainPtr<WKArrayRef> messageBody(AdoptWK, WKArrayCreate(body, sizeof(body) / sizeof(WKTypeRef))); WKBundlePostMessage(m_bundle->toRef(), messageName, messageBody.get()); }
qreal Telegram::messageBodyTextWidth(qint64 id) const { const QString & txt = messageBody(id); QFontMetricsF metric = QFontMetricsF( QFont() ); return metric.width(txt); }
void TestRunner::setBlockAllPlugins(bool shouldBlock) { WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetBlockAllPlugins")); WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(shouldBlock)); WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get()); }
void TestRunner::setAuthenticationPassword(JSStringRef password) { WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetAuthenticationPassword")); WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(password)); WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get()); }
void TestRunner::setHandlesAuthenticationChallenges(bool handlesAuthenticationChallenges) { WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetHandlesAuthenticationChallenge")); WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(handlesAuthenticationChallenges)); WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get()); }
std::string WebRequest::GetMessageBodyString() { std::string messageBody(mMessageBody.begin(), mMessageBody.end()); return messageBody; }
void TestRunner::setAuthenticationUsername(JSStringRef username) { WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetAuthenticationUsername")); WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(username)); WKBundlePostMessage(InjectedBundle::shared().bundle(), messageName.get(), messageBody.get()); }