当前位置: 首页>>代码示例>>C++>>正文


C++ Navigator::frame方法代码示例

本文整理汇总了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());
}
开发者ID:,项目名称:,代码行数:9,代码来源:

示例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);
}
开发者ID:joone,项目名称:blink-crosswalk,代码行数:14,代码来源:NavigatorVibration.cpp

示例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));
}
开发者ID:valbok,项目名称:WebKitForWayland,代码行数:15,代码来源:NavigatorContentUtils.cpp

示例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 { };
}
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:16,代码来源:NavigatorContentUtils.cpp

示例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)));
}
开发者ID:valbok,项目名称:WebKitForWayland,代码行数:17,代码来源:NavigatorContentUtils.cpp

示例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();
}
开发者ID:darktears,项目名称:blink-crosswalk,代码行数:17,代码来源:NavigatorMediaStream.cpp

示例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)));
}
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:17,代码来源:NavigatorContentUtils.cpp

示例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();
}
开发者ID:smishenk,项目名称:chromium-crosswalk,代码行数:31,代码来源:NavigatorMediaStream.cpp

示例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);
}
开发者ID:aobzhirov,项目名称:ChromiumGStreamerBackend,代码行数:18,代码来源:NavigatorVibration.cpp

示例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();
}
开发者ID:darktears,项目名称:blink-crosswalk,代码行数:19,代码来源:NavigatorMediaStream.cpp

示例11: DOMWindowProperty

NavigatorServiceWorker::NavigatorServiceWorker(Navigator& navigator)
    : DOMWindowProperty(navigator.frame())
{
}
开发者ID:smil-in-javascript,项目名称:blink,代码行数:4,代码来源:NavigatorServiceWorker.cpp

示例12: LocalFrameLifecycleObserver

NavigatorBeacon::NavigatorBeacon(Navigator& navigator)
    : LocalFrameLifecycleObserver(navigator.frame())
    , m_transmittedBytes(0)
{
}
开发者ID:aobzhirov,项目名称:ChromiumGStreamerBackend,代码行数:5,代码来源:NavigatorBeacon.cpp

示例13: DOMWindowProperty

NavigatorCredentials::NavigatorCredentials(Navigator& navigator)
    : DOMWindowProperty(navigator.frame())
{
}
开发者ID:dstockwell,项目名称:blink,代码行数:4,代码来源:NavigatorCredentials.cpp

示例14:

NavigatorUSB::NavigatorUSB(Navigator& navigator) {
    if (navigator.frame())
        m_usb = USB::create(*navigator.frame());
}
开发者ID:mirror,项目名称:chromium,代码行数:4,代码来源:NavigatorUSB.cpp


注:本文中的Navigator::frame方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。