本文整理汇总了C++中WebLocalFrameImpl::frame方法的典型用法代码示例。如果您正苦于以下问题:C++ WebLocalFrameImpl::frame方法的具体用法?C++ WebLocalFrameImpl::frame怎么用?C++ WebLocalFrameImpl::frame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebLocalFrameImpl
的用法示例。
在下文中一共展示了WebLocalFrameImpl::frame方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initializeFromFrame
void WebRemoteFrameImpl::initializeFromFrame(WebLocalFrame* source) const
{
ASSERT(source);
WebLocalFrameImpl* localFrameImpl = toWebLocalFrameImpl(source);
client()->initializeChildFrame(
localFrameImpl->frame()->view()->frameRect(),
localFrameImpl->frame()->view()->visibleContentScaleFactor());
}
示例2: initializeFromFrame
void WebRemoteFrameImpl::initializeFromFrame(WebLocalFrame* source) const
{
DCHECK(source);
WebLocalFrameImpl* localFrameImpl = toWebLocalFrameImpl(source);
client()->initializeChildFrame(
localFrameImpl->frame()->view()->frameRect(),
localFrameImpl->frame()->page()->deviceScaleFactor());
}
示例3: serialize
bool WebPageSerializerImpl::serialize()
{
bool didSerialization = false;
KURL mainURL = m_specifiedWebLocalFrameImpl->frame()->document()->url();
WebLocalFrameImpl* webFrame = m_specifiedWebLocalFrameImpl;
Document* document = webFrame->frame()->document();
const KURL& url = document->url();
if (url.isValid() && m_localLinks.contains(url.string())) {
didSerialization = true;
const WTF::TextEncoding& textEncoding = document->encoding().isValid() ? document->encoding() : UTF8Encoding();
String directoryName = url == mainURL ? m_localDirectoryName : "";
SerializeDomParam param(url, textEncoding, document, directoryName);
Element* documentElement = document->documentElement();
if (documentElement)
buildContentForNode(documentElement, ¶m);
encodeAndFlushBuffer(WebPageSerializerClient::CurrentFrameIsFinished, ¶m, ForceFlush);
} else {
// Report empty contents for invalid URLs.
m_client->didSerializeDataForFrame(
url, WebCString(),
WebPageSerializerClient::CurrentFrameIsFinished);
}
ASSERT(m_dataBuffer.isEmpty());
return didSerialization;
}
示例4: didStopLoading
void WebRemoteFrameImpl::didStopLoading()
{
frame()->setIsLoading(false);
if (parent() && parent()->isWebLocalFrame()) {
WebLocalFrameImpl* parentFrame =
toWebLocalFrameImpl(parent()->toWebLocalFrame());
parentFrame->frame()->loader().checkCompleted();
}
}
示例5: loadShadowPage
void WebSharedWorkerImpl::loadShadowPage()
{
WebLocalFrameImpl* webFrame = toWebLocalFrameImpl(m_webView->mainFrame());
// Construct substitute data source for the 'shadow page'. We only need it
// to have same origin as the worker so the loading checks work correctly.
CString content("");
RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), content.length()));
webFrame->frame()->loader().load(FrameLoadRequest(0, ResourceRequest(m_url), SubstituteData(buffer, "text/html", "UTF-8", KURL())));
}
示例6: createLocalChild
WebLocalFrame* WebRemoteFrameImpl::createLocalChild(WebTreeScopeType scope, const WebString& name, const WebString& uniqueName, WebSandboxFlags sandboxFlags, WebFrameClient* client, WebFrame* previousSibling, const WebFrameOwnerProperties& frameOwnerProperties, WebFrame* opener)
{
WebLocalFrameImpl* child = WebLocalFrameImpl::create(scope, client, opener);
insertAfter(child, previousSibling);
RawPtr<RemoteFrameOwner> owner = RemoteFrameOwner::create(static_cast<SandboxFlags>(sandboxFlags), frameOwnerProperties);
// FIXME: currently this calls LocalFrame::init() on the created LocalFrame, which may
// result in the browser observing two navigations to about:blank (one from the initial
// frame creation, and one from swapping it into the remote process). FrameLoader might
// need a special initialization function for this case to avoid that duplicate navigation.
child->initializeCoreFrame(frame()->host(), owner.get(), name, uniqueName);
// Partially related with the above FIXME--the init() call may trigger JS dispatch. However,
// if the parent is remote, it should never be detached synchronously...
DCHECK(child->frame());
return child;
}
示例7: createLocalChild
WebLocalFrame* WebRemoteFrameImpl::createLocalChild(WebTreeScopeType scope, const WebString& name, WebSandboxFlags sandboxFlags, WebFrameClient* client, WebFrame* previousSibling, const WebFrameOwnerProperties& frameOwnerProperties)
{
WebLocalFrameImpl* child = toWebLocalFrameImpl(WebLocalFrame::create(scope, client));
WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult result =
m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(child, static_cast<SandboxFlags>(sandboxFlags), frameOwnerProperties));
insertAfter(child, previousSibling);
// FIXME: currently this calls LocalFrame::init() on the created LocalFrame, which may
// result in the browser observing two navigations to about:blank (one from the initial
// frame creation, and one from swapping it into the remote process). FrameLoader might
// need a special initialization function for this case to avoid that duplicate navigation.
child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(), name, nullAtom);
// Partially related with the above FIXME--the init() call may trigger JS dispatch. However,
// if the parent is remote, it should never be detached synchronously...
ASSERT(child->frame());
return child;
}
示例8: retrieveAllResources
bool WebPageSerializer::retrieveAllResources(WebView* view,
const WebVector<WebCString>& supportedSchemes,
WebVector<WebURL>* resourceURLs,
WebVector<WebURL>* frameURLs) {
WebLocalFrameImpl* mainFrame = toWebLocalFrameImpl(view->mainFrame());
if (!mainFrame)
return false;
Vector<LocalFrame*> framesToVisit;
Vector<LocalFrame*> visitedFrames;
Vector<KURL> frameKURLs;
Vector<KURL> resourceKURLs;
// Let's retrieve the resources from every frame in this page.
framesToVisit.append(mainFrame->frame());
while (!framesToVisit.isEmpty()) {
LocalFrame* frame = framesToVisit[0];
framesToVisit.remove(0);
retrieveResourcesForFrame(frame, supportedSchemes,
&visitedFrames, &framesToVisit,
&frameKURLs, &resourceKURLs);
}
// Converts the results to WebURLs.
WebVector<WebURL> resultResourceURLs(resourceKURLs.size());
for (size_t i = 0; i < resourceKURLs.size(); ++i) {
resultResourceURLs[i] = resourceKURLs[i];
// A frame's src can point to the same URL as another resource, keep the
// resource URL only in such cases.
size_t index = frameKURLs.find(resourceKURLs[i]);
if (index != kNotFound)
frameKURLs.remove(index);
}
*resourceURLs = resultResourceURLs;
WebVector<WebURL> resultFrameURLs(frameKURLs.size());
for (size_t i = 0; i < frameKURLs.size(); ++i)
resultFrameURLs[i] = frameKURLs[i];
*frameURLs = resultFrameURLs;
return true;
}
示例9: lastChild
Frame* FrameLoaderClientImpl::lastChild() const
{
WebLocalFrameImpl* frame = toWebLocalFrameImpl(m_webFrame->lastChild());
return frame ? frame->frame() : 0;
}
示例10: nextSibling
Frame* FrameLoaderClientImpl::nextSibling() const
{
WebLocalFrameImpl* frame = toWebLocalFrameImpl(m_webFrame->nextSibling());
return frame ? frame->frame() : 0;
}
示例11: parent
Frame* FrameLoaderClientImpl::parent() const
{
WebLocalFrameImpl* frame = toWebLocalFrameImpl(m_webFrame->parent());
return frame ? frame->frame() : 0;
}
示例12: opener
Frame* FrameLoaderClientImpl::opener() const
{
WebLocalFrameImpl* opener = toWebLocalFrameImpl(m_webFrame->opener());
return opener ? opener->frame() : 0;
}
示例13: isActiveMatchFrameValid
bool TextFinder::isActiveMatchFrameValid() const
{
WebLocalFrameImpl* mainFrameImpl = m_ownerFrame.viewImpl()->mainFrameImpl();
WebLocalFrameImpl* activeMatchFrame = mainFrameImpl->activeMatchFrame();
return activeMatchFrame && activeMatchFrame->activeMatch() && activeMatchFrame->frame()->tree().isDescendantOf(mainFrameImpl->frame());
}