本文整理汇总了C++中FrameView::frame方法的典型用法代码示例。如果您正苦于以下问题:C++ FrameView::frame方法的具体用法?C++ FrameView::frame怎么用?C++ FrameView::frame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrameView
的用法示例。
在下文中一共展示了FrameView::frame方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleMouseEvent
void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event)
{
ASSERT(parent()->isFrameView());
// We cache the parent FrameView here as the plugin widget could be deleted
// in the call to HandleEvent. See http://b/issue?id=1362948
FrameView* parentView = static_cast<FrameView*>(parent());
WebMouseEventBuilder webEvent(parentView, *event);
if (webEvent.type == WebInputEvent::Undefined)
return;
if (event->type() == eventNames().mousedownEvent) {
// Ensure that the frame containing the plugin has focus.
Frame* containingFrame = parentView->frame();
if (Page* currentPage = containingFrame->page())
currentPage->focusController()->setFocusedFrame(containingFrame);
// Give focus to our containing HTMLPluginElement.
containingFrame->document()->setFocusedNode(m_element);
}
WebCursorInfo cursorInfo;
if (m_webPlugin->handleInputEvent(webEvent, cursorInfo))
event->setDefaultHandled();
// A windowless plugin can change the cursor in response to a mouse move
// event. We need to reflect the changed cursor in the frame view as the
// mouse is moved in the boundaries of the windowless plugin.
Page* page = parentView->frame()->page();
if (!page)
return;
ChromeClientImpl* chromeClient =
static_cast<ChromeClientImpl*>(page->chrome()->client());
chromeClient->setCursorForPlugin(cursorInfo);
}
示例2: paintScrollCorner
void ScrollbarThemeComposite::paintScrollCorner(ScrollView* view, GraphicsContext* context, const IntRect& cornerRect)
{
FrameView* frameView = static_cast<FrameView*>(view);
Page* page = frameView->frame() ? frameView->frame()->page() : 0;
if (page && page->settings()->shouldPaintCustomScrollbars() && page->chrome()->client()->paintCustomScrollCorner(context, cornerRect))
return;
context->fillRect(cornerRect, Color::white, DeviceColorSpace);
}
示例3: layout
void RenderPartObject::layout()
{
ASSERT(needsLayout());
calcWidth();
calcHeight();
#ifdef FLATTEN_IFRAME
// Some IFrames have a width and/or height of 1 when they are meant to be
// hidden. If that is the case, don't try to expand.
if (m_widget && m_widget->isFrameView() &&
m_width > 1 && m_height > 1) {
FrameView* view = static_cast<FrameView*>(m_widget);
RenderView* root = NULL;
if (view->frame() && view->frame()->document() &&
view->frame()->document()->renderer() && view->frame()->document()->renderer()->isRenderView())
root = static_cast<RenderView*>(view->frame()->document()->renderer());
if (root) {
// Update the dimensions to get the correct minimum preferred width
updateWidgetPosition();
// Use the preferred width if it is larger.
m_width = max(m_width, root->minPrefWidth());
int extraWidth = paddingLeft() + paddingRight() + borderLeft() + borderRight();
int extraHeight = paddingTop() + paddingBottom() + borderTop() + borderBottom();
// Resize the view to recalc the height.
int height = m_height - extraHeight;
int width = m_width - extraWidth;
if (width > view->width())
height = 0;
if (width != view->width() || height != view->height()) {
view->resize(width, height);
root->setNeedsLayout(true, false);
}
// Layout the view.
if (view->needsLayout())
view->layout();
int contentHeight = view->contentsHeight();
int contentWidth = view->contentsWidth();
// Do not shrink iframes with specified sizes
if (contentHeight > m_height || style()->height().isAuto())
m_height = contentHeight;
m_width = std::min(contentWidth, 800);
}
}
#endif
adjustOverflowForBoxShadow();
RenderPart::layout();
if (!m_widget && m_view)
m_view->addWidgetToUpdate(this);
setNeedsLayout(false);
}
示例4: pageForScrollView
static Page* pageForScrollView(ScrollView* view)
{
if (!view)
return 0;
if (!view->isFrameView())
return 0;
FrameView* frameView = static_cast<FrameView*>(view);
if (!frameView->frame())
return 0;
return frameView->frame()->page();
}
示例5: baseURL
TEST(RemoteFrameThrottlingTest, ThrottledLocalRoot)
{
FrameTestHelpers::TestWebViewClient viewClient;
WebViewImpl* webView = WebViewImpl::create(&viewClient);
webView->resize(WebSize(640, 480));
// Create a remote root frame with a local child frame.
FrameTestHelpers::TestWebRemoteFrameClient remoteClient;
webView->setMainFrame(remoteClient.frame());
remoteClient.frame()->setReplicatedOrigin(WebSecurityOrigin::createUnique());
WebFrameOwnerProperties properties;
FrameTestHelpers::TestWebFrameClient localFrameClient;
WebRemoteFrame* rootFrame = webView->mainFrame()->toWebRemoteFrame();
WebLocalFrame* localFrame = rootFrame->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, &localFrameClient, nullptr, properties);
WebString baseURL("http://internal.test/");
URLTestHelpers::registerMockedURLFromBaseURL(baseURL, "simple_div.html");
FrameTestHelpers::loadFrame(localFrame, baseURL.utf8() + "simple_div.html");
FrameView* frameView = toWebLocalFrameImpl(localFrame)->frameView();
EXPECT_TRUE(frameView->frame().isLocalRoot());
// Enable throttling for the child frame.
frameView->setFrameRect(IntRect(0, 480, frameView->width(), frameView->height()));
frameView->frame().securityContext()->setSecurityOrigin(SecurityOrigin::createUnique());
frameView->updateAllLifecyclePhases();
testing::runPendingTasks();
EXPECT_TRUE(frameView->shouldThrottleRendering());
Document* frameDocument = frameView->frame().document();
if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled())
EXPECT_EQ(DocumentLifecycle::PaintClean, frameDocument->lifecycle().state());
else
EXPECT_EQ(DocumentLifecycle::PaintInvalidationClean, frameDocument->lifecycle().state());
// Mutate the local child frame contents.
auto* divElement = frameDocument->getElementById("div");
divElement->setAttribute(styleAttr, "width: 50px");
EXPECT_EQ(DocumentLifecycle::VisualUpdatePending, frameDocument->lifecycle().state());
// Update the lifecycle again. The frame's lifecycle should not advance
// because of throttling even though it is the local root.
frameView->updateAllLifecyclePhases();
testing::runPendingTasks();
EXPECT_EQ(DocumentLifecycle::VisualUpdatePending, frameDocument->lifecycle().state());
webView->close();
}
示例6: calcHeight
void RenderPartObject::calcHeight() {
RenderPart::calcHeight();
if (!node()->hasTagName(iframeTag) || !widget() || !widget()->isFrameView())
return;
FrameView* view = static_cast<FrameView*>(widget());
RenderView* root = static_cast<RenderView*>(view->frame()->contentRenderer());
if (!root)
return;
// Do not expand if the scrollbars are suppressed and the height is fixed.
bool scrolling = static_cast<HTMLIFrameElement*>(node())->scrollingMode() != ScrollbarAlwaysOff;
if (!scrolling && style()->height().isFixed())
return;
// Update the widget
updateWidgetPosition();
//SAMSUNG CHANGE >>
// Browser freeze issue in http://www.enuri.com/
/* do {
view->layout();
} while (view->layoutPending() || root->needsLayout()); */
node()->document()->page()->mainFrame()->view()->layoutIfNeededRecursive();
//SAMSUNG CHANGE <<
int extraHeight = paddingTop() + paddingBottom() + borderTop() + borderBottom();
setHeight(max(width(), view->contentsHeight() + extraHeight));
// Update one last time to ensure the dimensions.
updateWidgetPosition();
}
示例7: layout
void RenderFrame::layout()
{
FrameView* view = static_cast<FrameView*>(widget());
RenderView* root = view ? view->frame()->contentRenderer() : 0;
// Do not expand frames which has zero width or height
if (!width() || !height() || !root) {
updateWidgetPosition();
if (view)
view->layout();
setNeedsLayout(false);
return;
}
HTMLFrameElementBase* element = static_cast<HTMLFrameElementBase*>(node());
if (element->scrollingMode() == ScrollbarAlwaysOff && !root->isFrameSet()) {
setNeedsLayout(false);
return;
}
// Update the dimensions to get the correct width and height
updateWidgetPosition();
if (root->preferredLogicalWidthsDirty())
root->computePreferredLogicalWidths();
// Expand the frame by setting frame height = content height
setWidth(max(view->contentsWidth() + borderAndPaddingWidth(), width()));
setHeight(max(view->contentsHeight() + borderAndPaddingHeight(), height()));
// Update one more time
updateWidgetPosition();
setNeedsLayout(false);
}
示例8: write
void write(TextStream& ts, const RenderObject& o, int indent)
{
#if ENABLE(SVG)
if (o.isRenderPath()) {
write(ts, *toRenderPath(&o), indent);
return;
}
if (o.isSVGContainer()) {
writeSVGContainer(ts, o, indent);
return;
}
if (o.isSVGRoot()) {
write(ts, *toRenderSVGRoot(&o), indent);
return;
}
if (o.isSVGText()) {
if (!o.isText())
writeSVGText(ts, *toRenderBlock(&o), indent);
else
writeSVGInlineText(ts, *toRenderText(&o), indent);
return;
}
if (o.isSVGImage()) {
writeSVGImage(ts, *toRenderImage(&o), indent);
return;
}
#endif
writeIndent(ts, indent);
ts << o << "\n";
if (o.isText() && !o.isBR()) {
const RenderText& text = *toRenderText(&o);
for (InlineTextBox* box = text.firstTextBox(); box; box = box->nextTextBox()) {
writeIndent(ts, indent + 1);
writeTextRun(ts, text, *box);
}
}
for (RenderObject* child = o.firstChild(); child; child = child->nextSibling()) {
if (child->hasLayer())
continue;
write(ts, *child, indent + 1);
}
if (o.isWidget()) {
Widget* widget = toRenderWidget(&o)->widget();
if (widget && widget->isFrameView()) {
FrameView* view = static_cast<FrameView*>(widget);
RenderView* root = view->frame()->contentRenderer();
if (root) {
view->layout();
RenderLayer* l = root->layer();
if (l)
writeLayers(ts, l, l, IntRect(l->x(), l->y(), l->width(), l->height()), indent + 1);
}
}
}
}
示例9: GetEAWebKitMediaView
static EA::WebKit::View* GetEAWebKitMediaView(MediaPlayer* pPlayer)
{
EA::WebKit::View* pView = NULL;
if (pPlayer)
{
FrameView* pFV = pPlayer->frameView();
if (pFV)
{
const Frame* pFrame = pFV->frame();
const EA::WebKit::WebFrame* pWebFrame = EA::WebKit::WebFramePrivate::kit(pFrame);
if (pWebFrame)
{
pView = pWebFrame->page()->view();
}
}
// If we fail to get the view from the player (might not be set yet by WebKit), we can try to get it from the document directly.
if (!pView)
{
MediaPlayerClient* pMPClient = pPlayer->mediaPlayerClient();
if ( (pMPClient) && (pMPClient->mediaPlayerOwningDocument()) )
{
Document* pDoc = pMPClient->mediaPlayerOwningDocument();
const Frame* pFrame = pDoc->frame();
const EA::WebKit::WebFrame* pWebFrame = EA::WebKit::WebFramePrivate::kit(pFrame);
if (pWebFrame)
{
pView = pWebFrame->page()->view();
}
}
}
}
return pView;
}
示例10: updateWidgetPosition
// FIXME: This should not be necessary. Remove this once WebKit knows to properly schedule
// layouts using WebCore when objects resize.
void RenderPart::updateWidgetPosition()
{
if (!m_widget)
return;
int x, y, width, height;
absolutePosition(x, y);
x += borderLeft() + paddingLeft();
y += borderTop() + paddingTop();
width = m_width - borderLeft() - borderRight() - paddingLeft() - paddingRight();
height = m_height - borderTop() - borderBottom() - paddingTop() - paddingBottom();
IntRect newBounds(x,y,width,height);
if (newBounds != m_widget->frameGeometry()) {
// The widget changed positions. Update the frame geometry.
RenderArena *arena = ref();
element()->ref();
m_widget->setFrameGeometry(newBounds);
element()->deref();
deref(arena);
FrameView* frameView = m_widget->isFrameView() ? static_cast<FrameView*>(m_widget) : 0;
if (frameView && !frameView->frame()->settings()->flatFrameSetLayoutEnabled())
frameView->layout();
}
}
示例11: contentRootRenderer
RenderView* RenderIFrame::contentRootRenderer() const
{
// FIXME: Is this always a valid cast? What about plugins?
ASSERT(!widget() || widget()->isFrameView());
FrameView* childFrameView = toFrameView(widget());
return childFrameView ? childFrameView->frame()->contentRenderer() : 0;
}
示例12: if
WebRenderObject::WebRenderObject(RenderObject* renderer)
{
m_name = renderer->renderName();
// FIXME: broken with transforms
m_absolutePosition = flooredIntPoint(renderer->localToAbsolute(FloatPoint()));
if (renderer->isBox())
m_frameRect = toRenderBox(renderer)->frameRect();
else if (renderer->isText()) {
m_frameRect = toRenderText(renderer)->linesBoundingBox();
m_frameRect.setX(toRenderText(renderer)->firstRunX());
m_frameRect.setY(toRenderText(renderer)->firstRunY());
} else if (renderer->isRenderInline())
m_frameRect = toRenderBoxModelObject(renderer)->borderBoundingBox();
m_children = MutableArray::create();
for (RenderObject* coreChild = renderer->firstChild(); coreChild; coreChild = coreChild->nextSibling()) {
RefPtr<WebRenderObject> child = adoptRef(new WebRenderObject(coreChild));
m_children->append(child.get());
}
if (!renderer->isWidget())
return;
Widget* widget = toRenderWidget(renderer)->widget();
if (!widget || !widget->isFrameView())
return;
FrameView* frameView = static_cast<FrameView*>(widget);
if (RenderView* coreContentRenderer = frameView->frame()->contentRenderer()) {
RefPtr<WebRenderObject> contentRenderer = adoptRef(new WebRenderObject(coreContentRenderer));
m_children->append(contentRenderer.get());
}
}
示例13: scrollTo
void ScrollView::scrollTo(const IntSize& newOffset)
{
IntSize scrollDelta = newOffset - m_scrollOffset;
if (scrollDelta == IntSize())
return;
m_scrollOffset = newOffset;
#if PLATFORM(ANDROID)
if (parent()) {
FrameView* frameView = this->frameView();
// IFrames are composited on a layer, we do not need to repaint them
// when scrolling
if (frameView) {
RenderView* renderer = frameView->frame()->contentRenderer();
if (renderer) {
RenderLayer* layer = renderer->layer();
if (layer->backing()) {
GraphicsLayerAndroid* backing = static_cast<GraphicsLayerAndroid*>(
layer->backing()->graphicsLayer());
backing->updateScrollOffset();
}
}
return;
}
}
#endif
if (scrollbarsSuppressed())
return;
repaintFixedElementsAfterScrolling();
scrollContents(scrollDelta);
}
示例14: buildTreeRootNodes
void PaintPropertyTreeBuilder::buildTreeRootNodes(FrameView& rootFrame, PaintPropertyTreeBuilderContext& context)
{
// Only create extra root clip and transform nodes when RLS is enabled, because the main frame
// unconditionally create frame translation / clip nodes otherwise.
if (rootFrame.frame().settings() && rootFrame.frame().settings()->rootLayerScrolls()) {
transformRoot = TransformPaintPropertyNode::create(TransformationMatrix(), FloatPoint3D(), nullptr);
context.currentTransform = context.transformForAbsolutePosition = context.transformForFixedPosition = transformRoot.get();
clipRoot = ClipPaintPropertyNode::create(transformRoot, FloatRoundedRect(LayoutRect::infiniteIntRect()), nullptr);
context.currentClip = context.clipForAbsolutePosition = context.clipForFixedPosition = clipRoot.get();
}
// The root frame never creates effect node so we unconditionally create a root node here.
effectRoot = EffectPaintPropertyNode::create(1.0, nullptr);
context.currentEffect = effectRoot.get();
}
示例15: document
Document* AXObject::document() const
{
FrameView* frameView = documentFrameView();
if (!frameView)
return 0;
return frameView->frame().document();
}