本文整理汇总了C++中WebFrame类的典型用法代码示例。如果您正苦于以下问题:C++ WebFrame类的具体用法?C++ WebFrame怎么用?C++ WebFrame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WebFrame类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: toWebFrameLoaderClient
void WebChromeClient::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> prpFileChooser)
{
if (m_page->activeOpenPanelResultListener())
return;
RefPtr<FileChooser> fileChooser = prpFileChooser;
m_page->setActiveOpenPanelResultListener(WebOpenPanelResultListener::create(m_page, fileChooser.get()));
WebFrameLoaderClient* webFrameLoaderClient = toWebFrameLoaderClient(frame->loader()->client());
WebFrame* webFrame = webFrameLoaderClient ? webFrameLoaderClient->webFrame() : 0;
ASSERT(webFrame);
m_page->send(Messages::WebPageProxy::RunOpenPanel(webFrame->frameID(), fileChooser->settings()));
}
开发者ID:,项目名称:,代码行数:15,代码来源:
示例2: getMainFrame
void TextInputController::setMarkedText(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
WebFrame* mainFrame = getMainFrame();
if (!mainFrame)
return;
if (arguments.size() >= 3 && arguments[0].isString()
&& arguments[1].isNumber() && arguments[2].isNumber()) {
mainFrame->setMarkedText(WebString::fromUTF8(arguments[0].toString()),
arguments[1].toInt32(),
arguments[2].toInt32());
}
}
开发者ID:,项目名称:,代码行数:15,代码来源:
示例3: pauseTransitionAtTimeOnElementWithId
bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const WebString& propertyName, double time, const WebString& elementId)
{
WebFrame* webFrame = m_shell->webView()->mainFrame();
if (!webFrame)
return false;
WebAnimationController* controller = webFrame->animationController();
if (!controller)
return false;
WebElement element = webFrame->document().getElementById(elementId);
if (element.isNull())
return false;
return controller->pauseTransitionAtTime(element, propertyName, time);
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:15,代码来源:LayoutTestController.cpp
示例4: exceededDatabaseQuota
void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& databaseName)
{
WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
SecurityOrigin* origin = frame->document()->securityOrigin();
DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(databaseName, origin);
uint64_t currentQuota = DatabaseTracker::tracker().quotaForOrigin(origin);
uint64_t currentOriginUsage = DatabaseTracker::tracker().usageForOrigin(origin);
uint64_t newQuota = 0;
WebProcess::shared().connection()->sendSync(
Messages::WebPageProxy::ExceededDatabaseQuota(webFrame->frameID(), origin->databaseIdentifier(), databaseName, details.displayName(), currentQuota, currentOriginUsage, details.currentUsage(), details.expectedUsage()),
Messages::WebPageProxy::ExceededDatabaseQuota::Reply(newQuota), m_page->pageID());
DatabaseTracker::tracker().setQuota(origin, newQuota);
}
开发者ID:Moondee,项目名称:Artemis,代码行数:15,代码来源:WebChromeClient.cpp
示例5: didPostMessage
// WebCore::UserMessageHandlerDescriptor
void didPostMessage(WebCore::UserMessageHandler& handler, WebCore::SerializedScriptValue* value) override
{
WebCore::Frame* frame = handler.frame();
if (!frame)
return;
WebFrame* webFrame = WebFrame::fromCoreFrame(*frame);
if (!webFrame)
return;
WebPage* webPage = webFrame->page();
if (!webPage)
return;
WebProcess::singleton().parentProcessConnection()->send(Messages::WebUserContentControllerProxy::DidPostMessage(webPage->pageID(), webFrame->frameID(), SecurityOriginData::fromFrame(frame), m_identifier, IPC::DataReference(value->data())), m_controller->identifier());
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:17,代码来源:WebUserContentController.cpp
示例6: ENABLE
Page* WebChromeClient::createWindow(Frame* frame, const FrameLoadRequest& request, const WindowFeatures& windowFeatures, const NavigationAction& navigationAction)
{
#if ENABLE(FULLSCREEN_API)
if (frame->document() && frame->document()->webkitCurrentFullScreenElement())
frame->document()->webkitCancelFullScreen();
#endif
auto& webProcess = WebProcess::singleton();
WebFrame* webFrame = WebFrame::fromCoreFrame(*frame);
NavigationActionData navigationActionData;
navigationActionData.navigationType = navigationAction.type();
navigationActionData.modifiers = InjectedBundleNavigationAction::modifiersForNavigationAction(navigationAction);
navigationActionData.mouseButton = InjectedBundleNavigationAction::mouseButtonForNavigationAction(navigationAction);
navigationActionData.syntheticClickType = InjectedBundleNavigationAction::syntheticClickTypeForNavigationAction(navigationAction);
navigationActionData.userGestureTokenIdentifier = webProcess.userGestureTokenIdentifier(navigationAction.userGestureToken());
navigationActionData.canHandleRequest = m_page->canHandleRequest(request.resourceRequest());
navigationActionData.shouldOpenExternalURLsPolicy = navigationAction.shouldOpenExternalURLsPolicy();
navigationActionData.downloadAttribute = navigationAction.downloadAttribute();
uint64_t newPageID = 0;
WebPageCreationParameters parameters;
if (!webProcess.parentProcessConnection()->sendSync(Messages::WebPageProxy::CreateNewPage(webFrame->frameID(), SecurityOriginData::fromFrame(frame), request.resourceRequest(), windowFeatures, navigationActionData), Messages::WebPageProxy::CreateNewPage::Reply(newPageID, parameters), m_page->pageID()))
return nullptr;
if (!newPageID)
return nullptr;
webProcess.createWebPage(newPageID, parameters);
return webProcess.webPage(newPageID)->corePage();
}
开发者ID:endlessm,项目名称:WebKit,代码行数:32,代码来源:WebChromeClient.cpp
示例7: findLargestFrameInFrameSet
void WebChromeClient::contentsSizeChanged(Frame* frame, const IntSize& size) const
{
if (!m_page->corePage()->settings().frameFlatteningEnabled()) {
WebFrame* largestFrame = findLargestFrameInFrameSet(m_page);
if (largestFrame != m_cachedFrameSetLargestFrame.get()) {
m_cachedFrameSetLargestFrame = largestFrame;
m_page->send(Messages::WebPageProxy::FrameSetLargestFrameChanged(largestFrame ? largestFrame->frameID() : 0));
}
}
if (&frame->page()->mainFrame() != frame)
return;
m_page->send(Messages::WebPageProxy::DidChangeContentSize(size));
m_page->drawingArea()->mainFrameContentSizeChanged(size);
FrameView* frameView = frame->view();
if (frameView && !frameView->delegatesScrolling()) {
bool hasHorizontalScrollbar = frameView->horizontalScrollbar();
bool hasVerticalScrollbar = frameView->verticalScrollbar();
if (hasHorizontalScrollbar != m_cachedMainFrameHasHorizontalScrollbar || hasVerticalScrollbar != m_cachedMainFrameHasVerticalScrollbar) {
m_page->send(Messages::WebPageProxy::DidChangeScrollbarsForMainFrame(hasHorizontalScrollbar, hasVerticalScrollbar));
m_cachedMainFrameHasHorizontalScrollbar = hasHorizontalScrollbar;
m_cachedMainFrameHasVerticalScrollbar = hasVerticalScrollbar;
}
}
}
开发者ID:endlessm,项目名称:WebKit,代码行数:30,代码来源:WebChromeClient.cpp
示例8: getMainFrame
void TextInputController::insertText(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
WebFrame* mainFrame = getMainFrame();
if (!mainFrame)
return;
if (arguments.size() < 1 || !arguments[0].isString())
return;
if (mainFrame->hasMarkedText()) {
mainFrame->unmarkText();
mainFrame->replaceSelection(WebString());
}
mainFrame->insertText(WebString::fromUTF8(arguments[0].toString()));
}
开发者ID:achellies,项目名称:WinCEWebKit,代码行数:16,代码来源:TextInputController.cpp
示例9: numberOfPages
void LayoutTestController::numberOfPages(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
float pageWidthInPixels = 0;
float pageHeightInPixels = 0;
if (!parsePageSizeParameters(arguments, 0, &pageWidthInPixels, &pageHeightInPixels))
return;
WebFrame* frame = m_shell->webView()->mainFrame();
if (!frame)
return;
WebSize size(pageWidthInPixels, pageHeightInPixels);
int numberOfPages = frame->printBegin(size);
frame->printEnd();
result->set(numberOfPages);
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:16,代码来源:LayoutTestController.cpp
示例10: pageNumberForElementById
void LayoutTestController::pageNumberForElementById(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
float pageWidthInPixels = 0;
float pageHeightInPixels = 0;
if (!parsePageSizeParameters(arguments, 1,
&pageWidthInPixels, &pageHeightInPixels))
return;
if (!arguments[0].isString())
return;
WebFrame* frame = m_shell->webView()->mainFrame();
if (!frame)
return;
result->set(frame->pageNumberForElementById(cppVariantToWebString(arguments[0]),
pageWidthInPixels, pageHeightInPixels));
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:16,代码来源:LayoutTestController.cpp
示例11: ENABLE
Page* WebChromeClient::createWindow(Frame* frame, const FrameLoadRequest& request, const WindowFeatures& windowFeatures, const NavigationAction& navigationAction)
{
#if ENABLE(FULLSCREEN_API)
if (frame->document() && frame->document()->webkitCurrentFullScreenElement())
frame->document()->webkitCancelFullScreen();
#endif
WebFrame* webFrame = WebFrame::fromCoreFrame(*frame);
NavigationActionData navigationActionData;
navigationActionData.navigationType = navigationAction.type();
navigationActionData.modifiers = InjectedBundleNavigationAction::modifiersForNavigationAction(navigationAction);
navigationActionData.mouseButton = InjectedBundleNavigationAction::mouseButtonForNavigationAction(navigationAction);
navigationActionData.isProcessingUserGesture = navigationAction.processingUserGesture();
navigationActionData.canHandleRequest = m_page->canHandleRequest(request.resourceRequest());
uint64_t newPageID = 0;
WebPageCreationParameters parameters;
auto& webProcess = WebProcess::singleton();
if (!webProcess.parentProcessConnection()->sendSync(Messages::WebPageProxy::CreateNewPage(webFrame->frameID(), request.resourceRequest(), windowFeatures, navigationActionData), Messages::WebPageProxy::CreateNewPage::Reply(newPageID, parameters), m_page->pageID()))
return nullptr;
if (!newPageID)
return nullptr;
webProcess.createWebPage(newPageID, parameters);
return webProcess.webPage(newPageID)->corePage();
}
开发者ID:LianYue1,项目名称:webkit,代码行数:28,代码来源:WebChromeClient.cpp
示例12: selectedRange
void TextInputController::selectedRange(const CppArgumentList&, CppVariant* result)
{
result->setNull();
WebFrame* mainFrame = m_webView->mainFrame();
if (!mainFrame)
return;
WebRange range = mainFrame->selectionRange();
vector<int> intArray(2);
intArray[0] = range.startOffset();
intArray[1] = range.endOffset();
NPObject* resultArray = WebBindings::makeIntArray(intArray);
result->set(resultArray);
WebBindings::releaseObject(resultArray);
}
开发者ID:MorS25,项目名称:chromium,代码行数:17,代码来源:TextInputController.cpp
示例13: setupTest
void TouchActionTest::runIFrameTest(std::string file) {
TouchActionTrackingWebViewClient client;
WebView* webView = setupTest(file, client);
WebFrame* curFrame = webView->mainFrame()->firstChild();
ASSERT_TRUE(curFrame);
for (; curFrame; curFrame = curFrame->nextSibling()) {
// Oilpan: see runTouchActionTest() comment why these are persistent
// references.
Persistent<Document> contentDoc =
static_cast<Document*>(curFrame->document());
runTestOnTree(contentDoc.get(), webView, client);
}
// Explicitly reset to break dependency on locally scoped client.
m_webViewHelper.reset();
}
开发者ID:mirror,项目名称:chromium,代码行数:18,代码来源:TouchActionTest.cpp
示例14: runJavaScriptAlert
void WebChromeClient::runJavaScriptAlert(Frame* frame, const String& alertText)
{
WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
// Notify the bundle client.
m_page->injectedBundleUIClient().willRunJavaScriptAlert(m_page, alertText, webFrame);
WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::RunJavaScriptAlert(webFrame->frameID(), alertText), Messages::WebPageProxy::RunJavaScriptAlert::Reply(), m_page->pageID());
}
开发者ID:,项目名称:,代码行数:9,代码来源:
示例15: dumpFrameScrollPosition
string dumpFrameScrollPosition(WebFrame* frame, bool recursive)
{
string result;
WebSize offset = frame->scrollOffset();
if (offset.width > 0 || offset.height > 0) {
if (frame->parent())
result = string("frame '") + frame->uniqueName().utf8().data() + "' ";
char data[100];
snprintf(data, sizeof(data), "scrolled to %d,%d\n", offset.width, offset.height);
result += data;
}
if (!recursive)
return result;
for (WebFrame* child = frame->firstChild(); child; child = child->nextSibling())
result += dumpFrameScrollPosition(child, recursive);
return result;
}
开发者ID:,项目名称:,代码行数:18,代码来源:
示例16: PLATFORM
Frame* WebFrameLoaderClient::dispatchCreatePage()
{
#if PLATFORM(AMIGAOS4)
extern BalWidget *createAmigaWindow(WebView *);
extern void closeAmigaWindow(BalWidget *);
WebView* newWebView = WebView::createInstance();
if (newWebView) {
BalWidget *newowbwindow = createAmigaWindow(newWebView);
if (newowbwindow) {
IntRect clientRect(0, 0, amigaConfig.width, amigaConfig.height);
newWebView->initWithFrame(clientRect, "", "");
newWebView->setViewWindow(newowbwindow);
WebFrame *mainFrame = newWebView->mainFrame();
if (mainFrame && mainFrame->impl())
return mainFrame->impl();
closeAmigaWindow(newowbwindow);
}
delete newWebView;
}
return 0;
#else
/*WebView* webView = m_webFrame->webView();
COMPtr<IWebUIDelegate> ui;
if (FAILED(webView->uiDelegate(&ui)))
return 0;
COMPtr<IWebView> newWebView;
if (FAILED(ui->createWebViewWithRequest(webView, 0, &newWebView)))
return 0;
COMPtr<IWebFrame> mainFrame;
if (FAILED(newWebView->mainFrame(&mainFrame)))
return 0;
COMPtr<WebFrame> mainFrameImpl(Query, mainFrame);
return core(mainFrameImpl.get());*/
return 0;
#endif
}
开发者ID:acss,项目名称:owb-mirror,代码行数:44,代码来源:WebFrameLoaderClient.cpp
示例17: runBeforeUnloadConfirmPanel
bool WebChromeClient::runBeforeUnloadConfirmPanel(const String& message, Frame* frame)
{
WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
bool shouldClose = false;
if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::RunBeforeUnloadConfirmPanel(message, webFrame->frameID()), Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::Reply(shouldClose), m_page->pageID()))
return false;
return shouldClose;
}
开发者ID:,项目名称:,代码行数:10,代码来源:
示例18: JSStringCopyUTF8CString
bool LoadItem::invoke() const
{
char* targetString = JSStringCopyUTF8CString(m_target.get());
WebFrame* targetFrame;
if (!strlen(targetString))
targetFrame = getWebView()->mainFrame();
else
targetFrame = getWebView()->mainFrame()->findFrameNamed(targetString);
free(targetString);
char* urlString = JSStringCopyUTF8CString(m_url.get());
targetFrame->loadURL(urlString);
// WebKitNetworkRequest* request = webkit_network_request_new(urlString);
free(urlString);
// webkit_web_frame_load_request(targetFrame, request);
// g_object_unref(request);
return true;
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:19,代码来源:WorkQueueItemBal.cpp
示例19: ownerFrame
void TextFinder::updateFindMatchRects() {
IntSize currentContentsSize = ownerFrame().contentsSize();
if (m_contentsSizeForCurrentFindMatchRects != currentContentsSize) {
m_contentsSizeForCurrentFindMatchRects = currentContentsSize;
m_findMatchRectsAreValid = false;
}
size_t deadMatches = 0;
for (FindMatch& match : m_findMatchesCache) {
if (!match.m_range->boundaryPointsValid() ||
!match.m_range->startContainer()->isConnected())
match.m_rect = FloatRect();
else if (!m_findMatchRectsAreValid)
match.m_rect = findInPageRectFromRange(match.m_range.get());
if (match.m_rect.isEmpty())
++deadMatches;
}
// Remove any invalid matches from the cache.
if (deadMatches) {
HeapVector<FindMatch> filteredMatches;
filteredMatches.reserveCapacity(m_findMatchesCache.size() - deadMatches);
for (const FindMatch& match : m_findMatchesCache) {
if (!match.m_rect.isEmpty())
filteredMatches.append(match);
}
m_findMatchesCache.swap(filteredMatches);
}
// Invalidate the rects in child frames. Will be updated later during
// traversal.
if (!m_findMatchRectsAreValid)
for (WebFrame* child = ownerFrame().firstChild(); child;
child = child->nextSibling())
toWebLocalFrameImpl(child)->ensureTextFinder().m_findMatchRectsAreValid =
false;
m_findMatchRectsAreValid = true;
}
开发者ID:mirror,项目名称:chromium,代码行数:42,代码来源:TextFinder.cpp
示例20: findLargestFrameInFrameSet
static WebFrame* findLargestFrameInFrameSet(WebPage* page)
{
// Approximate what a user could consider a default target frame for application menu operations.
WebFrame* mainFrame = page->mainWebFrame();
if (!mainFrame->isFrameSet())
return 0;
WebFrame* largestSoFar = 0;
RefPtr<ImmutableArray> frameChildren = mainFrame->childFrames();
size_t count = frameChildren->size();
for (size_t i = 0; i < count; ++i) {
WebFrame* childFrame = frameChildren->at<WebFrame>(i);
if (!largestSoFar || area(childFrame) > area(largestSoFar))
largestSoFar = childFrame;
}
return largestSoFar;
}
开发者ID:,项目名称:,代码行数:20,代码来源:
注:本文中的WebFrame类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论