本文整理汇总了C++中webcore::Page类的典型用法代码示例。如果您正苦于以下问题:C++ Page类的具体用法?C++ Page怎么用?C++ Page使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Page类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setDefersLoading
void DumpRenderTreeSupportEfl::setDefersLoading(Evas_Object* ewkView, bool defers)
{
WebCore::Page* page = EWKPrivate::corePage(ewkView);
if (!page)
return;
page->setDefersLoading(defers);
}
示例2: findString
bool DumpRenderTreeSupportEfl::findString(const Evas_Object* ewkView, const char* text, WebCore::FindOptions options)
{
WebCore::Page* page = EWKPrivate::corePage(ewkView);
if (!page)
return false;
return page->findString(String::fromUTF8(text), options);
}
示例3: WKBundlePageStartMonitoringScrollOperations
void WKBundlePageStartMonitoringScrollOperations(WKBundlePageRef pageRef)
{
WebKit::WebPage* webPage = toImpl(pageRef);
WebCore::Page* page = webPage ? webPage->corePage() : nullptr;
if (!page)
return;
page->ensureTestTrigger();
}
示例4: invalidateView
static void invalidateView(Evas_Object* webView)
{
Evas_Coord width, height;
Evas_Object* mainFrame = ewk_view_frame_main_get(webView);
if (mainFrame && ewk_frame_contents_size_get(mainFrame, &width, &height)) {
WebCore::Page* page = EWKPrivate::corePage(webView);
if (page)
page->mainFrame()->view()->invalidateRect(WebCore::IntRect(0, 0, width, height));
}
}
示例5: addUserScript
void DumpRenderTreeSupportEfl::addUserScript(const Evas_Object* ewkView, const String& sourceCode, bool runAtStart, bool allFrames)
{
WebCore::Page* page = EWKPrivate::corePage(ewkView);
if (!page)
return;
page->group().addUserScriptToWorld(WebCore::mainThreadNormalWorld(), sourceCode, WebCore::KURL(),
nullptr, nullptr, runAtStart ? WebCore::InjectAtDocumentStart : WebCore::InjectAtDocumentEnd,
allFrames ? WebCore::InjectInAllFrames : WebCore::InjectInTopFrameOnly);
}
示例6: WebHistoryRestoreIndex
static void WebHistoryRestoreIndex(JNIEnv* env, jobject obj, jint frame, jint index)
{
LOG_ASSERT(frame, "RestoreState needs a valid Frame pointer!");
WebCore::Frame* pFrame = (WebCore::Frame*)frame;
WebCore::Page* page = pFrame->page();
WebCore::HistoryItem* currentItem =
page->backForwardList()->entries()[index].get();
// load the current page with FrameLoadTypeIndexedBackForward so that it
// will use cache when it is possible
page->goToItem(currentItem, FrameLoadTypeIndexedBackForward);
}
示例7: setSelectTrailingWhitespaceEnabled
void DumpRenderTreeSupportEfl::setSelectTrailingWhitespaceEnabled(Evas_Object* ewkView, bool enabled)
{
WebCore::Page* page = EWKPrivate::corePage(ewkView);
if (!page)
return;
WebCore::EditorClientEfl* editorClient = static_cast<WebCore::EditorClientEfl*>(page->editorClient());
if (!editorClient)
return;
editorClient->setSelectTrailingWhitespaceEnabled(enabled);
}
示例8: collapseSelection
static void collapseSelection(GtkClipboard* clipboard, WebKitWebView* webView)
{
if (viewSettingClipboard && viewSettingClipboard == webView)
return;
WebCore::Page* corePage = core(webView);
if (!corePage)
return;
Frame& frame = corePage->focusController().focusedOrMainFrame();
// Collapse the selection without clearing it
frame.selection().setBase(frame.selection().extent(), frame.selection().affinity());
}
示例9: WKBundlePageRegisterScrollOperationCompletionCallback
void WKBundlePageRegisterScrollOperationCompletionCallback(WKBundlePageRef pageRef, WKBundlePageTestNotificationCallback callback, void* context)
{
if (!callback)
return;
WebKit::WebPage* webPage = toImpl(pageRef);
WebCore::Page* page = webPage ? webPage->corePage() : nullptr;
if (!page || !page->expectsWheelEventTriggers())
return;
page->ensureTestTrigger().setTestCallbackAndStartNotificationTimer([=]() {
callback(context);
});
}
示例10: startUpdating
void GeolocationClientQt::startUpdating()
{
if (!m_location && (m_location = QGeoPositionInfoSource::createDefaultSource(this)))
connect(m_location, SIGNAL(positionUpdated(QGeoPositionInfo)), this, SLOT(positionUpdated(QGeoPositionInfo)));
if (!m_location) {
WebCore::Page* page = QWebPagePrivate::core(m_page);
RefPtr<WebCore::GeolocationError> error = GeolocationError::create(GeolocationError::PositionUnavailable, failedToStartServiceErrorMessage);
page->geolocationController()->errorOccurred(error.get());
return;
}
m_location->startUpdates();
}
示例11: ewk_history_clear
Eina_Bool ewk_history_clear(Ewk_History* history)
{
EWK_HISTORY_CORE_GET_OR_RETURN(history, core, false);
WebCore::Page* page = core->page();
if (page && page->groupPtr())
page->groupPtr()->removeVisitedLinks();
const int limit = ewk_history_limit_get(history);
ewk_history_limit_set(history, 0);
ewk_history_limit_set(history, limit);
return true;
}
示例12: setComposition
void DumpRenderTreeSupportEfl::setComposition(Evas_Object* ewkView, const char* text, int start, int length)
{
WebCore::Page* page = EWKPrivate::corePage(ewkView);
if (!page || !page->focusController() || !page->focusController()->focusedOrMainFrame())
return;
WebCore::Editor* editor = page->focusController()->focusedOrMainFrame()->editor();
if (!editor || (!editor->canEdit() && !editor->hasComposition()))
return;
const String compositionString = String::fromUTF8(text);
Vector<WebCore::CompositionUnderline> underlines;
underlines.append(WebCore::CompositionUnderline(0, compositionString.length(), WebCore::Color(0, 0, 0), false));
editor->setComposition(compositionString, underlines, start, start + length);
}
示例13: dumpConfigurationForViewport
void DumpRenderTreeSupportEfl::dumpConfigurationForViewport(Evas_Object* ewkView, int deviceDPI, const WebCore::IntSize& deviceSize, const WebCore::IntSize& availableSize)
{
WebCore::Page* page = EWKPrivate::corePage(ewkView);
if (!page)
return;
WebCore::ViewportArguments arguments = page->mainFrame()->document()->viewportArguments();
WebCore::ViewportAttributes attributes = computeViewportAttributes(arguments,
/* default layout width for non-mobile pages */ 980,
deviceSize.width(), deviceSize.height(),
deviceDPI,
availableSize);
restrictMinimumScaleFactorToViewportSize(attributes, availableSize);
restrictScaleFactorToInitialScaleIfNotUserScalable(attributes);
fprintf(stdout, "viewport size %dx%d scale %f with limits [%f, %f] and userScalable %f\n", attributes.layoutSize.width(), attributes.layoutSize.height(), attributes.initialScale, attributes.minimumScale, attributes.maximumScale, attributes.userScalable);
}
示例14: getWebVisiblePluginInfo
void WebPluginInfoProvider::getWebVisiblePluginInfo(WebCore::Page& page, Vector<WebCore::PluginInfo>& plugins)
{
ASSERT_ARG(plugins, plugins.isEmpty());
getPluginInfo(page, plugins);
#if PLATFORM(MAC)
if (auto* document = page.mainFrame().document()) {
if (auto* securityOrigin = document->securityOrigin()) {
if (securityOrigin->isLocal())
return;
}
}
for (int32_t i = plugins.size() - 1; i >= 0; --i) {
auto& info = plugins.at(i);
// Allow built-in plugins. Also tentatively allow plugins that the client might later selectively permit.
if (info.isApplicationPlugin || info.clientLoadPolicy == WebCore::PluginLoadClientPolicyAsk)
continue;
if (info.clientLoadPolicy == WebCore::PluginLoadClientPolicyBlock)
plugins.remove(i);
}
#endif
}
示例15: compositionRange
bool DumpRenderTreeSupportEfl::compositionRange(Evas_Object* ewkView, int* start, int* length)
{
*start = *length = 0;
WebCore::Page* page = EWKPrivate::corePage(ewkView);
if (!page || !page->focusController() || !page->focusController()->focusedOrMainFrame())
return false;
WebCore::Editor* editor = page->focusController()->focusedOrMainFrame()->editor();
if (!editor || !editor->hasComposition())
return false;
*start = editor->compositionStart();
*length = editor->compositionEnd() - *start;
return true;
}