本文整理汇总了C++中Navigator::frame方法的典型用法代码示例。如果您正苦于以下问题:C++ Navigator::frame方法的具体用法?C++ Navigator::frame怎么用?C++ Navigator::frame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Navigator
的用法示例。
在下文中一共展示了Navigator::frame方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: throwError
JSValue *NavigatorFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &)
{
if (!thisObj->inherits(&KJS::Navigator::info))
return throwError(exec, TypeError);
Navigator *nav = static_cast<Navigator *>(thisObj);
// javaEnabled()
Settings* settings = nav->frame() ? nav->frame()->settings() : 0;
return jsBoolean(settings && settings->isJavaEnabled());
}
示例2: vibrate
bool NavigatorVibration::vibrate(Navigator& navigator, const VibrationPattern& pattern)
{
if (!navigator.frame())
return false;
Page* page = navigator.frame()->page();
if (!page)
return false;
if (page->visibilityState() != PageVisibilityStateVisible)
return false;
return NavigatorVibration::from(*page).vibrate(pattern);
}
示例3: unregisterProtocolHandler
void NavigatorContentUtils::unregisterProtocolHandler(Navigator& navigator, const String& scheme, const String& url, ExceptionCode& ec)
{
if (!navigator.frame())
return;
URL baseURL = navigator.frame()->document()->baseURL();
if (!verifyCustomHandlerURL(baseURL, url, ec))
return;
if (!verifyProtocolHandlerScheme(scheme, ec))
return;
NavigatorContentUtils::from(navigator.frame()->page())->client()->unregisterProtocolHandler(scheme, baseURL, URL(ParsedURLString, url));
}
示例4: URL
ExceptionOr<void> NavigatorContentUtils::registerProtocolHandler(Navigator& navigator, const String& scheme, const String& url, const String& title)
{
if (!navigator.frame())
return { };
URL baseURL = navigator.frame()->document()->baseURL();
if (!verifyCustomHandlerURL(baseURL, url))
return Exception { SyntaxError };
if (!verifyProtocolHandlerScheme(scheme))
return Exception { SecurityError };
NavigatorContentUtils::from(navigator.frame()->page())->client()->registerProtocolHandler(scheme, baseURL, URL({ }, url), navigator.frame()->displayStringModifiedByEncoding(title));
return { };
}
示例5: isProtocolHandlerRegistered
String NavigatorContentUtils::isProtocolHandlerRegistered(Navigator& navigator, const String& scheme, const String& url, ExceptionCode& ec)
{
static NeverDestroyed<String> declined(ASCIILiteral("declined"));
if (!navigator.frame())
return declined;
URL baseURL = navigator.frame()->document()->baseURL();
if (!verifyCustomHandlerURL(baseURL, url, ec))
return declined;
if (!verifyProtocolHandlerScheme(scheme, ec))
return declined;
return customHandlersStateString(NavigatorContentUtils::from(navigator.frame()->page())->client()->isProtocolHandlerRegistered(scheme, baseURL, URL(ParsedURLString, url)));
}
示例6: getMediaDevices
void NavigatorMediaStream::getMediaDevices(Navigator& navigator, PassOwnPtr<MediaDeviceInfoCallback> callback, ExceptionState& exceptionState)
{
UserMediaController* userMedia = UserMediaController::from(navigator.frame());
if (!userMedia) {
exceptionState.throwDOMException(NotSupportedError, "No media device controller available; is this a detached window?");
return;
}
MediaDevicesRequest* request = MediaDevicesRequest::create(navigator.frame()->document(), userMedia, callback, exceptionState);
if (!request) {
if (!exceptionState.hadException())
exceptionState.throwDOMException(NotSupportedError, "Failed to request media devices.");
return;
}
request->start();
}
示例7: customHandlersStateString
ExceptionOr<String> NavigatorContentUtils::isProtocolHandlerRegistered(Navigator& navigator, const String& scheme, const String& url)
{
static NeverDestroyed<String> declined(MAKE_STATIC_STRING_IMPL("declined"));
if (!navigator.frame())
return String { declined };
URL baseURL = navigator.frame()->document()->baseURL();
if (!verifyCustomHandlerURL(baseURL, url))
return Exception { SyntaxError };
if (!verifyProtocolHandlerScheme(scheme))
return Exception { SecurityError };
return customHandlersStateString(NavigatorContentUtils::from(navigator.frame()->page())->client()->isProtocolHandlerRegistered(scheme, baseURL, URL({ }, url)));
}
示例8: webkitGetUserMedia
void NavigatorMediaStream::webkitGetUserMedia(Navigator& navigator, const MediaStreamConstraints& options, NavigatorUserMediaSuccessCallback* successCallback, NavigatorUserMediaErrorCallback* errorCallback, ExceptionState& exceptionState)
{
if (!successCallback)
return;
UserMediaController* userMedia = UserMediaController::from(navigator.frame());
if (!userMedia) {
exceptionState.throwDOMException(NotSupportedError, "No user media controller available; is this a detached window?");
return;
}
String errorMessage;
if (navigator.frame()->document()->isPrivilegedContext(errorMessage)) {
UseCounter::count(navigator.frame(), UseCounter::GetUserMediaSecureOrigin);
} else {
UseCounter::countDeprecation(navigator.frame(), UseCounter::GetUserMediaInsecureOrigin);
OriginsUsingFeatures::countAnyWorld(*navigator.frame()->document(), OriginsUsingFeatures::Feature::GetUserMediaInsecureOrigin);
if (navigator.frame()->settings()->strictPowerfulFeatureRestrictions()) {
exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("webkitGetUserMedia", "Navigator", errorMessage));
return;
}
}
UserMediaRequest* request = UserMediaRequest::create(navigator.frame()->document(), userMedia, options, successCallback, errorCallback, exceptionState);
if (!request) {
ASSERT(exceptionState.hadException());
return;
}
request->start();
}
示例9: vibrate
bool NavigatorVibration::vibrate(Navigator& navigator, const VibrationPattern& pattern)
{
if (!navigator.frame())
return false;
UseCounter::count(navigator.frame(), UseCounter::NavigatorVibrate);
if (!navigator.frame()->isMainFrame())
UseCounter::count(navigator.frame(), UseCounter::NavigatorVibrateSubFrame);
Page* page = navigator.frame()->page();
if (!page)
return false;
if (!page->isPageVisible())
return false;
return NavigatorVibration::from(*page).vibrate(pattern);
}
示例10: webkitGetUserMedia
void NavigatorMediaStream::webkitGetUserMedia(Navigator& navigator, const Dictionary& options, PassOwnPtr<NavigatorUserMediaSuccessCallback> successCallback, PassOwnPtr<NavigatorUserMediaErrorCallback> errorCallback, ExceptionState& exceptionState)
{
if (!successCallback)
return;
UserMediaController* userMedia = UserMediaController::from(navigator.frame());
if (!userMedia) {
exceptionState.throwDOMException(NotSupportedError, "No user media controller available; is this a detached window?");
return;
}
UserMediaRequest* request = UserMediaRequest::create(navigator.frame()->document(), userMedia, options, successCallback, errorCallback, exceptionState);
if (!request) {
ASSERT(exceptionState.hadException());
return;
}
request->start();
}
示例11: DOMWindowProperty
NavigatorServiceWorker::NavigatorServiceWorker(Navigator& navigator)
: DOMWindowProperty(navigator.frame())
{
}
示例12: LocalFrameLifecycleObserver
NavigatorBeacon::NavigatorBeacon(Navigator& navigator)
: LocalFrameLifecycleObserver(navigator.frame())
, m_transmittedBytes(0)
{
}
示例13: DOMWindowProperty
NavigatorCredentials::NavigatorCredentials(Navigator& navigator)
: DOMWindowProperty(navigator.frame())
{
}
示例14:
NavigatorUSB::NavigatorUSB(Navigator& navigator) {
if (navigator.frame())
m_usb = USB::create(*navigator.frame());
}