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


C++ Chrome类代码示例

本文整理汇总了C++中Chrome的典型用法代码示例。如果您正苦于以下问题:C++ Chrome类的具体用法?C++ Chrome怎么用?C++ Chrome使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Chrome类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: adoptPtr

bool GraphicsContext3DInternal::initialize(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, bool renderDirectlyToHostWindow)
{
    WebKit::WebGraphicsContext3D::Attributes webAttributes;
    webAttributes.alpha = attrs.alpha;
    webAttributes.depth = attrs.depth;
    webAttributes.stencil = attrs.stencil;
    webAttributes.antialias = attrs.antialias;
    webAttributes.premultipliedAlpha = attrs.premultipliedAlpha;
    webAttributes.canRecoverFromContextLoss = attrs.canRecoverFromContextLoss;
    webAttributes.noExtensions = attrs.noExtensions;
    OwnPtr<WebKit::WebGraphicsContext3D> webContext = adoptPtr(WebKit::webKitClient()->createGraphicsContext3D());
    if (!webContext)
        return false;

    Chrome* chrome = static_cast<Chrome*>(hostWindow);
    m_webViewImpl = static_cast<WebKit::WebViewImpl*>(chrome->client()->webView());

    if (!m_webViewImpl)
        return false;
    if (!webContext->initialize(webAttributes, m_webViewImpl, renderDirectlyToHostWindow))
        return false;
    m_impl = webContext.release();

#if USE(ACCELERATED_COMPOSITING)
    m_compositingLayer = WebGLLayerChromium::create(0);
#endif
    return true;
}
开发者ID:,项目名称:,代码行数:28,代码来源:

示例2: finder

void TestChromeBookmarks::itShouldGracefullyExitWhenFileIsNotFound()
{
    FakeFindProfile finder(QList<Profile>() << Profile("FileNotExisting.json", NULL));
    Chrome *chrome = new Chrome(&finder, this);
    chrome->prepare();
    QCOMPARE(chrome->match("any", true).size(), 0);
}
开发者ID:isoft-linux,项目名称:plasma-workspace,代码行数:7,代码来源:testchromebookmarks.cpp

示例3: Chrome

void TestChromeBookmarks::itShouldFindOnlyMatches()
{
    Chrome *chrome = new Chrome(m_findBookmarksInCurrentDirectory.data(), this);
    chrome->prepare();
    QList<BookmarkMatch> matches = chrome->match("other", false);
    QCOMPARE(matches.size(), 1);
    verifyMatch(matches[0], "bookmark in other bookmarks", "http://otherbookmarks.com/", 0.45, QueryMatch::PossibleMatch);
}
开发者ID:isoft-linux,项目名称:plasma-workspace,代码行数:8,代码来源:testchromebookmarks.cpp

示例4: document

void CalendarPickerElement::closePopup()
{
    if (!m_popup)
        return;
    if (!document()->page())
        return;
    Chrome* chrome = document()->page()->chrome();
    if (!chrome)
        return;
    chrome->client()->closePagePopup(m_popup);
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例5: widgetFromFrame

static inline GtkWidget* widgetFromFrame(Frame* frame)
{
    ASSERT(frame);
    Page* page = frame->page();
    ASSERT(page);
    Chrome* chrome = page->chrome();
    ASSERT(chrome);
    PlatformPageClient client = chrome->platformPageClient();
    ASSERT(client);
    return client;
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例6: handleDOMActivateEvent

void ColorInputType::handleDOMActivateEvent(Event* event)
{
    if (element()->isDisabledFormControl() || !element()->renderer())
        return;

    if (!ScriptController::processingUserGesture())
        return;

    Chrome* chrome = this->chrome();
    if (chrome && !m_chooser)
        m_chooser = chrome->createColorChooser(this, valueAsColor());

    event->setDefaultHandled();
}
开发者ID:halton,项目名称:blink-crosswalk,代码行数:14,代码来源:ColorInputType.cpp

示例7: findBookmarksFromAllProfiles

void TestChromeBookmarks::itShouldFindBookmarksFromAllProfiles()
{
    FakeFindProfile findBookmarksFromAllProfiles(QList<Profile>()
        << Profile("chrome-config-home/Chrome-Bookmarks-Sample.json", new FallbackFavicon(this))
        << Profile("chrome-config-home/Chrome-Bookmarks-SecondProfile.json", new FallbackFavicon(this)) );
    Chrome *chrome = new Chrome(&findBookmarksFromAllProfiles, this);
    chrome->prepare();
    QList<BookmarkMatch> matches = chrome->match("any", true);
    QCOMPARE(matches.size(), 4);
    verifyMatch(matches[0], "some bookmark in bookmark bar", "http://somehost.com/", 0.18, QueryMatch::PossibleMatch);
    verifyMatch(matches[1], "bookmark in other bookmarks", "http://otherbookmarks.com/", 0.18, QueryMatch::PossibleMatch);
    verifyMatch(matches[2], "bookmark in somefolder", "http://somefolder.com/", 0.18, QueryMatch::PossibleMatch);
    verifyMatch(matches[3], "bookmark in secondProfile", "http://secondprofile.com/", 0.18, QueryMatch::PossibleMatch);
}
开发者ID:isoft-linux,项目名称:plasma-workspace,代码行数:14,代码来源:testchromebookmarks.cpp

示例8: document

void PickerIndicatorElement::openPopup()
{
    if (m_chooser)
        return;
    if (!document()->page())
        return;
    if (!m_pickerIndicatorOwner)
        return;
    Chrome* chrome = document()->page()->chrome();
    if (!chrome)
        return;
    DateTimeChooserParameters parameters;
    if (!m_pickerIndicatorOwner->setupDateTimeChooserParameters(parameters))
        return;
    m_chooser = chrome->openDateTimeChooser(this, parameters);
}
开发者ID:harlanlewis,项目名称:webkit,代码行数:16,代码来源:PickerIndicatorElement.cpp

示例9: requestIcon

void FileInputType::requestIcon(const Vector<String>& paths)
{
    if (!paths.size())
        return;

    Chrome* chrome = this->chrome();
    if (!chrome)
        return;

    if (m_fileIconLoader)
        m_fileIconLoader->invalidate();

    m_fileIconLoader = FileIconLoader::create(this);

    chrome->loadIconForFiles(paths, m_fileIconLoader.get());
}
开发者ID:DHRUVKUMARSINGH,项目名称:phantomjs,代码行数:16,代码来源:FileInputType.cpp

示例10: setPaletteFromPageClientIfExists

void RenderThemeQt::setPaletteFromPageClientIfExists(QPalette& palette) const
{
    // If the webview has a custom palette, use it
    if (!m_page)
        return;
    Chrome* chrome = m_page->chrome();
    if (!chrome)
        return;
    ChromeClient* chromeClient = chrome->client();
    if (!chromeClient)
        return;
    QWebPageClient* pageClient = chromeClient->platformPageClient();
    if (!pageClient)
        return;
    palette = pageClient->palette();
}
开发者ID:,项目名称:,代码行数:16,代码来源:

示例11: adoptRef

PassRefPtr<GraphicsContext3D> GraphicsContext3DPrivate::createGraphicsContextFromWebContext(PassOwnPtr<WebKit::WebGraphicsContext3D> webContext, GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle, ThreadUsage threadUsage)
{
    Chrome* chrome = static_cast<Chrome*>(hostWindow);
    WebKit::WebViewImpl* webViewImpl = chrome ? static_cast<WebKit::WebViewImpl*>(chrome->client()->webView()) : 0;

    if (threadUsage == ForUseOnThisThread && !webContext->makeContextCurrent())
        return 0;

    OwnPtr<GraphicsContext3DPrivate> priv = GraphicsContext3DPrivate::create(webViewImpl, webContext, attrs);
    if (!priv)
        return 0;

    bool renderDirectlyToHostWindow = renderStyle == GraphicsContext3D::RenderDirectlyToHostWindow;
    RefPtr<GraphicsContext3D> result = adoptRef(new GraphicsContext3D(attrs, hostWindow, renderDirectlyToHostWindow));
    result->m_private = priv.release();
    return result.release();
}
开发者ID:sysrqb,项目名称:chromium-src,代码行数:17,代码来源:GraphicsContext3DChromium.cpp

示例12: element

void BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent(Event*)
{
    if (element()->isDisabledOrReadOnly() || !element()->renderer() || !ScriptController::processingUserGesture())
        return;

    if (m_dateTimeChooser)
        return;
    if (!element()->document()->page())
        return;
    Chrome* chrome = element()->document()->page()->chrome();
    if (!chrome)
        return;
    DateTimeChooserParameters parameters;
    if (!element()->setupDateTimeChooserParameters(parameters))
        return;
    m_dateTimeChooser = chrome->openDateTimeChooser(this, parameters);
}
开发者ID:harlanlewis,项目名称:webkit,代码行数:17,代码来源:BaseChooserOnlyDateAndTimeInputType.cpp

示例13: receiveDropForDirectoryUpload

void FileInputType::receiveDropForDirectoryUpload(const Vector<String>& paths)
{
    Chrome* chrome = this->chrome();
    if (!chrome)
        return;

    FileChooserSettings settings;
    HTMLInputElement* input = element();
    settings.allowsDirectoryUpload = true;
    settings.allowsMultipleFiles = true;
    settings.selectedFiles.append(paths[0]);
    settings.acceptMIMETypes = input->acceptMIMETypes();
    settings.acceptFileExtensions = input->acceptFileExtensions();

    applyFileChooserSettings(settings);
    chrome->enumerateChosenDirectory(m_fileChooser);
}
开发者ID:DHRUVKUMARSINGH,项目名称:phantomjs,代码行数:17,代码来源:FileInputType.cpp

示例14: PLATFORM

void FileInputType::requestIcon(const Vector<String>& paths)
{
#if PLATFORM(IOS)
    UNUSED_PARAM(paths);
#else
    if (!paths.size())
        return;

    Chrome* chrome = this->chrome();
    if (!chrome)
        return;

    if (m_fileIconLoader)
        m_fileIconLoader->invalidate();

    m_fileIconLoader = std::make_unique<FileIconLoader>(static_cast<FileIconLoaderClient&>(*this));

    chrome->loadIconForFiles(paths, m_fileIconLoader.get());
#endif
}
开发者ID:MYSHLIFE,项目名称:webkit,代码行数:20,代码来源:FileInputType.cpp

示例15: USE

void RenderThemeQt::setPaletteFromPageClientIfExists(QPalette& palette) const
{
#if USE(QT_MOBILE_THEME)
    static QPalette lightGrayPalette(Qt::lightGray);
    palette = lightGrayPalette;
    return;
#endif
    // If the webview has a custom palette, use it
    if (!m_page)
        return;
    Chrome* chrome = m_page->chrome();
    if (!chrome)
        return;
    ChromeClient* chromeClient = chrome->client();
    if (!chromeClient)
        return;
    QWebPageClient* pageClient = chromeClient->platformPageClient();
    if (!pageClient)
        return;
    palette = pageClient->palette();
}
开发者ID:sanyaade-mobiledev,项目名称:Webkit-Projects,代码行数:21,代码来源:RenderThemeQt.cpp


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