本文整理汇总了C++中HTMLFrameOwnerElement::setWidget方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLFrameOwnerElement::setWidget方法的具体用法?C++ HTMLFrameOwnerElement::setWidget怎么用?C++ HTMLFrameOwnerElement::setWidget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLFrameOwnerElement
的用法示例。
在下文中一共展示了HTMLFrameOwnerElement::setWidget方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createView
void RemoteFrame::createView()
{
setView(nullptr);
if (!tree().parent() || !tree().parent()->isLocalFrame()) {
// FIXME: This is not the right place to clear the previous frame's
// widget. We do it here because the LocalFrame cleanup after a swap is
// still work in progress.
if (ownerLayoutObject()) {
HTMLFrameOwnerElement* owner = deprecatedLocalOwner();
ASSERT(owner);
owner->setWidget(nullptr);
}
return;
}
RefPtrWillBeRawPtr<RemoteFrameView> view = RemoteFrameView::create(this);
setView(view);
if (ownerLayoutObject()) {
HTMLFrameOwnerElement* owner = deprecatedLocalOwner();
ASSERT(owner);
owner->setWidget(view);
}
}
示例2: createView
void RemoteFrame::createView()
{
RefPtrWillBeRawPtr<RemoteFrameView> view = RemoteFrameView::create(this);
setView(view);
if (ownerRenderer()) {
HTMLFrameOwnerElement* owner = deprecatedLocalOwner();
ASSERT(owner);
owner->setWidget(view);
}
}
示例3: createView
void LocalFrame::createView(const IntSize& viewportSize,
const Color& backgroundColor,
bool transparent,
ScrollbarMode horizontalScrollbarMode,
bool horizontalLock,
ScrollbarMode verticalScrollbarMode,
bool verticalLock) {
ASSERT(this);
ASSERT(page());
bool isLocalRoot = this->isLocalRoot();
if (isLocalRoot && view())
view()->setParentVisible(false);
setView(nullptr);
FrameView* frameView = nullptr;
if (isLocalRoot) {
frameView = FrameView::create(this, viewportSize);
// The layout size is set by WebViewImpl to support @viewport
frameView->setLayoutSizeFixedToFrameSize(false);
} else {
frameView = FrameView::create(this);
}
frameView->setScrollbarModes(horizontalScrollbarMode, verticalScrollbarMode,
horizontalLock, verticalLock);
setView(frameView);
frameView->updateBackgroundRecursively(backgroundColor, transparent);
if (isLocalRoot)
frameView->setParentVisible(true);
// FIXME: Not clear what the right thing for OOPI is here.
if (!ownerLayoutItem().isNull()) {
HTMLFrameOwnerElement* owner = deprecatedLocalOwner();
ASSERT(owner);
// FIXME: OOPI might lead to us temporarily lying to a frame and telling it
// that it's owned by a FrameOwner that knows nothing about it. If we're
// lying to this frame, don't let it clobber the existing widget.
if (owner->contentFrame() == this)
owner->setWidget(frameView);
}
if (owner())
view()->setCanHaveScrollbars(owner()->scrollingMode() !=
ScrollbarAlwaysOff);
}
示例4: createView
void LocalFrame::createView(const IntSize& viewportSize, const Color& backgroundColor, bool transparent,
ScrollbarMode horizontalScrollbarMode, bool horizontalLock,
ScrollbarMode verticalScrollbarMode, bool verticalLock)
{
ASSERT(this);
ASSERT(page());
bool isMainFrame = this->isMainFrame();
if (isMainFrame && view())
view()->setParentVisible(false);
setView(nullptr);
RefPtr<FrameView> frameView;
if (isMainFrame) {
frameView = FrameView::create(this, viewportSize);
// The layout size is set by WebViewImpl to support @viewport
frameView->setLayoutSizeFixedToFrameSize(false);
} else
frameView = FrameView::create(this);
frameView->setScrollbarModes(horizontalScrollbarMode, verticalScrollbarMode, horizontalLock, verticalLock);
setView(frameView);
frameView->updateBackgroundRecursively(backgroundColor, transparent);
if (isMainFrame)
frameView->setParentVisible(true);
// FIXME: Not clear what the right thing for OOPI is here.
if (ownerRenderer()) {
HTMLFrameOwnerElement* owner = deprecatedLocalOwner();
ASSERT(owner);
owner->setWidget(frameView);
}
if (HTMLFrameOwnerElement* owner = deprecatedLocalOwner())
view()->setCanHaveScrollbars(owner->scrollingMode() != ScrollbarAlwaysOff);
}
示例5: swap
bool WebFrame::swap(WebFrame* frame)
{
using std::swap;
RefPtrWillBeRawPtr<Frame> oldFrame = toCoreFrame(this);
// All child frames must be detached first.
oldFrame->detachChildren();
// If the frame has been detached during detaching its children, return
// immediately.
// FIXME: There is no unit test for this condition, so one needs to be
// written.
if (!oldFrame->host())
return false;
if (m_parent) {
if (m_parent->m_firstChild == this)
m_parent->m_firstChild = frame;
if (m_parent->m_lastChild == this)
m_parent->m_lastChild = frame;
swap(m_parent, frame->m_parent);
}
if (m_previousSibling) {
m_previousSibling->m_nextSibling = frame;
swap(m_previousSibling, frame->m_previousSibling);
}
if (m_nextSibling) {
m_nextSibling->m_previousSibling = frame;
swap(m_nextSibling, frame->m_nextSibling);
}
if (m_opener) {
m_opener->m_openedFrameTracker->remove(this);
m_opener->m_openedFrameTracker->add(frame);
swap(m_opener, frame->m_opener);
}
if (!m_openedFrameTracker->isEmpty()) {
m_openedFrameTracker->updateOpener(frame);
frame->m_openedFrameTracker.reset(m_openedFrameTracker.release());
}
// Finally, clone the state of the current Frame into one matching
// the type of the passed in WebFrame.
// FIXME: This is a bit clunky; this results in pointless decrements and
// increments of connected subframes.
FrameOwner* owner = oldFrame->owner();
oldFrame->disconnectOwnerElement();
if (Frame* newFrame = toCoreFrame(frame)) {
ASSERT(owner == newFrame->owner());
if (owner->isLocal()) {
HTMLFrameOwnerElement* ownerElement = toHTMLFrameOwnerElement(owner);
ownerElement->setContentFrame(*newFrame);
if (newFrame->isLocalFrame())
ownerElement->setWidget(toLocalFrame(newFrame)->view());
}
} else if (frame->isWebLocalFrame()) {
toWebLocalFrameImpl(frame)->initializeCoreFrame(oldFrame->host(), owner, oldFrame->tree().name(), nullAtom);
} else {
toWebRemoteFrameImpl(frame)->initializeCoreFrame(oldFrame->host(), owner, oldFrame->tree().name());
}
return true;
}