本文整理汇总了C++中FrameView类的典型用法代码示例。如果您正苦于以下问题:C++ FrameView类的具体用法?C++ FrameView怎么用?C++ FrameView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FrameView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildNodeHighlight
void InspectorOverlay::drawNodeHighlight()
{
if (!m_highlightNode)
return;
Highlight highlight;
buildNodeHighlight(m_highlightNode.get(), m_nodeHighlightConfig, &highlight);
RefPtr<InspectorObject> highlightObject = buildObjectForHighlight(m_page->mainFrame()->view(), highlight);
Node* node = m_highlightNode.get();
if (node->isElementNode() && m_nodeHighlightConfig.showInfo && node->renderer() && node->document()->frame()) {
RefPtr<InspectorObject> elementInfo = InspectorObject::create();
Element* element = toElement(node);
bool isXHTML = element->document()->isXHTMLDocument();
elementInfo->setString("tagName", isXHTML ? element->nodeName() : element->nodeName().lower());
elementInfo->setString("idValue", element->getIdAttribute());
HashSet<AtomicString> usedClassNames;
if (element->hasClass() && element->isStyledElement()) {
StringBuilder classNames;
const SpaceSplitString& classNamesString = static_cast<StyledElement*>(element)->classNames();
size_t classNameCount = classNamesString.size();
for (size_t i = 0; i < classNameCount; ++i) {
const AtomicString& className = classNamesString[i];
if (usedClassNames.contains(className))
continue;
usedClassNames.add(className);
classNames.append('.');
classNames.append(className);
}
elementInfo->setString("className", classNames.toString());
}
RenderObject* renderer = node->renderer();
Frame* containingFrame = node->document()->frame();
FrameView* containingView = containingFrame->view();
IntRect boundingBox = pixelSnappedIntRect(containingView->contentsToRootView(renderer->absoluteBoundingBoxRect()));
RenderBoxModelObject* modelObject = renderer->isBoxModelObject() ? toRenderBoxModelObject(renderer) : 0;
elementInfo->setString("nodeWidth", String::number(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnappedOffsetWidth(), modelObject) : boundingBox.width()));
elementInfo->setString("nodeHeight", String::number(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnappedOffsetHeight(), modelObject) : boundingBox.height()));
highlightObject->setObject("elementInfo", elementInfo.release());
}
evaluateInOverlay("drawNodeHighlight", highlightObject);
}
示例2: ASSERT
void EventTargetNode::dispatchWheelEvent(PlatformWheelEvent& e)
{
ASSERT(!eventDispatchForbidden());
if (e.deltaX() == 0 && e.deltaY() == 0)
return;
FrameView* view = document()->view();
if (!view)
return;
IntPoint pos = view->windowToContents(e.pos());
RefPtr<WheelEvent> we = WheelEvent::create(e.deltaX(), e.deltaY(),
document()->defaultView(), e.globalX(), e.globalY(), pos.x(), pos.y(),
e.ctrlKey(), e.altKey(), e.shiftKey(), e.metaKey());
ExceptionCode ec = 0;
if (!dispatchEvent(we.release(), ec, true))
e.accept();
}
示例3: ASSERT
HRESULT DOMHTMLInputElement::rectOnScreen(_Out_ LPRECT rect)
{
if (!rect)
return E_POINTER;
ASSERT(is<HTMLInputElement>(m_element));
rect->left = rect->top = rect->right = rect->bottom = 0;
RenderObject* renderer = m_element->renderer();
FrameView* view = m_element->document().view();
if (!renderer || !view)
return E_FAIL;
IntRect coreRect = view->contentsToScreen(renderer->absoluteBoundingBoxRect());
rect->left = coreRect.x();
rect->top = coreRect.y();
rect->right = coreRect.maxX();
rect->bottom = coreRect.maxY();
return S_OK;
}
示例4: ASSERT
void ChromeClientImpl::scheduleAnimation(Widget* widget)
{
ASSERT(widget->isFrameView());
FrameView* view = toFrameView(widget);
LocalFrame* frame = view->frame().localFrameRoot();
// If the frame is still being created, it might not yet have a WebWidget.
// FIXME: Is this the right thing to do? Is there a way to avoid having
// a local frame root that doesn't have a WebWidget? During initialization
// there is no content to draw so this call serves no purpose.
if (WebLocalFrameImpl::fromFrame(frame) && WebLocalFrameImpl::fromFrame(frame)->frameWidget()) {
WebLocalFrameImpl::fromFrame(frame)->frameWidget()->scheduleAnimation();
} else {
// TODO(lfg): We need to keep this for now because we still have some
// WebViews who don't have a WebViewFrameWidget. This should be
// removed once the WebViewFrameWidget refactor is complete.
m_webView->scheduleAnimation();
}
}
示例5: ASSERT
HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::rectOnScreen(
/* [retval][out] */ LPRECT rect)
{
ASSERT(m_element);
ASSERT(isHTMLInputElement(m_element));
rect->left = rect->top = rect->right = rect->bottom = 0;
RenderObject* renderer = m_element->renderer();
FrameView* view = m_element->document().view();
if (!renderer || !view)
return E_FAIL;
IntRect coreRect = view->contentsToScreen(renderer->absoluteBoundingBoxRect());
rect->left = coreRect.x();
rect->top = coreRect.y();
rect->right = coreRect.maxX();
rect->bottom = coreRect.maxY();
return S_OK;
}
示例6: hitTestInDocument
HitTestResult hitTestInDocument(const Document* document, int x, int y)
{
LocalFrame* frame = document->frame();
if (!frame)
return HitTestResult();
FrameView* frameView = frame->view();
if (!frameView)
return HitTestResult();
IntPoint point(x, y);
if (!frameView->visibleContentRect().contains(point))
return HitTestResult();
HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active);
HitTestResult result(point);
document->renderView()->hitTest(request, result);
return result;
}
示例7: TEST_F
TEST_F(ScrollingCoordinatorTest, iframeScrolling)
{
registerMockedHttpURLLoad("iframe-scrolling.html");
registerMockedHttpURLLoad("iframe-scrolling-inner.html");
navigateTo(m_baseURL + "iframe-scrolling.html");
forceFullCompositingUpdate();
// Verify the properties of the accelerated scrolling element starting from the LayoutObject
// all the way to the WebLayer.
Element* scrollableFrame = frame()->document()->getElementById("scrollable");
ASSERT_TRUE(scrollableFrame);
LayoutObject* layoutObject = scrollableFrame->layoutObject();
ASSERT_TRUE(layoutObject);
ASSERT_TRUE(layoutObject->isLayoutPart());
LayoutPart* layoutPart = toLayoutPart(layoutObject);
ASSERT_TRUE(layoutPart);
ASSERT_TRUE(layoutPart->widget());
ASSERT_TRUE(layoutPart->widget()->isFrameView());
FrameView* innerFrameView = toFrameView(layoutPart->widget());
LayoutView* innerLayoutView = innerFrameView->layoutView();
ASSERT_TRUE(innerLayoutView);
PaintLayerCompositor* innerCompositor = innerLayoutView->compositor();
ASSERT_TRUE(innerCompositor->inCompositingMode());
ASSERT_TRUE(innerCompositor->scrollLayer());
GraphicsLayer* scrollLayer = innerCompositor->scrollLayer();
ASSERT_EQ(innerFrameView, scrollLayer->scrollableArea());
WebLayer* webScrollLayer = scrollLayer->platformLayer();
ASSERT_TRUE(webScrollLayer->scrollable());
#if OS(ANDROID)
// Now verify we've attached impl-side scrollbars onto the scrollbar layers
ASSERT_TRUE(innerCompositor->layerForHorizontalScrollbar());
ASSERT_TRUE(innerCompositor->layerForHorizontalScrollbar()->hasContentsLayer());
ASSERT_TRUE(innerCompositor->layerForVerticalScrollbar());
ASSERT_TRUE(innerCompositor->layerForVerticalScrollbar()->hasContentsLayer());
#endif
}
示例8: webkit_web_frame_get_vertical_scrollbar_policy
GtkPolicyType webkit_web_frame_get_vertical_scrollbar_policy(WebKitWebFrame* frame)
{
g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), GTK_POLICY_AUTOMATIC);
Frame* coreFrame = core(frame);
FrameView* view = coreFrame->view();
if (!view)
return GTK_POLICY_AUTOMATIC;
ScrollbarMode vMode = view->verticalScrollbarMode();
if (vMode == ScrollbarAlwaysOn)
return GTK_POLICY_ALWAYS;
if (vMode == ScrollbarAlwaysOff)
return GTK_POLICY_NEVER;
return GTK_POLICY_AUTOMATIC;
}
示例9: createWeakPtr
void RenderWidget::updateWidgetPosition()
{
if (!m_widget)
return;
WeakPtr<RenderWidget> weakThis = createWeakPtr();
bool widgetSizeChanged = updateWidgetGeometry();
if (!weakThis)
return;
// if the frame size got changed, or if view needs layout (possibly indicating
// content size is wrong) we have to do a layout to set the right widget size.
if (m_widget->isFrameView()) {
FrameView* frameView = toFrameView(m_widget.get());
// Check the frame's page to make sure that the frame isn't in the process of being destroyed.
if ((widgetSizeChanged || frameView->needsLayout()) && frameView->frame().page())
frameView->layout();
}
}
示例10: m_webPage
InRegionScrollableArea::InRegionScrollableArea(WebPagePrivate* webPage, RenderLayer* layer)
: m_webPage(webPage)
, m_layer(layer)
, m_hasWindowVisibleRectCalculated(false)
{
ASSERT(webPage);
ASSERT(layer);
m_isNull = false;
// FIXME: Add an ASSERT here as the 'layer' must be scrollable.
RenderObject* layerRenderer = layer->renderer();
ASSERT(layerRenderer);
if (layerRenderer->isRenderView()) { // #document case
FrameView* view = toRenderView(layerRenderer)->frameView();
ASSERT(view);
Frame* frame = view->frame();
ASSERT_UNUSED(frame, frame);
m_scrollPosition = m_webPage->mapToTransformed(view->scrollPosition());
m_contentsSize = m_webPage->mapToTransformed(view->contentsSize());
m_viewportSize = m_webPage->mapToTransformed(view->visibleContentRect(false /*includeScrollbars*/)).size();
m_scrollsHorizontally = view->contentsWidth() > view->visibleWidth();
m_scrollsVertically = view->contentsHeight() > view->visibleHeight();
m_overscrollLimitFactor = 0.0; // FIXME eventually support overscroll
} else { // RenderBox-based elements case (scrollable boxes (div's, p's, textarea's, etc)).
RenderBox* box = m_layer->renderBox();
ASSERT(box);
ASSERT(box->canBeScrolledAndHasScrollableArea());
ScrollableArea* scrollableArea = static_cast<ScrollableArea*>(m_layer);
m_scrollPosition = m_webPage->mapToTransformed(scrollableArea->scrollPosition());
m_contentsSize = m_webPage->mapToTransformed(scrollableArea->contentsSize());
m_viewportSize = m_webPage->mapToTransformed(scrollableArea->visibleContentRect(false /*includeScrollbars*/)).size();
m_scrollsHorizontally = box->scrollWidth() != box->clientWidth() && box->scrollsOverflowX();
m_scrollsVertically = box->scrollHeight() != box->clientHeight() && box->scrollsOverflowY();
m_overscrollLimitFactor = 0.0; // FIXME eventually support overscroll
}
}
示例11: ASSERT
void EmbeddedWidget::frameRectsChanged()
{
if (!parent())
return;
ASSERT(parent()->isFrameView());
FrameView* frameView = toFrameView(parent());
IntRect oldWindowRect = m_windowRect;
IntRect oldClipRect = m_clipRect;
m_windowRect = IntRect(frameView->contentsToWindow(frameRect().location()), frameRect().size());
m_clipRect = windowClipRect();
m_clipRect.move(-m_windowRect.x(), -m_windowRect.y());
if (!m_window)
return;
if (m_windowRect == oldWindowRect && m_clipRect == oldClipRect)
return;
// To prevent flashes while scrolling, we disable drawing during the window
// update process by clipping the window to the zero rect.
bool clipToZeroRect = true;
if (clipToZeroRect) {
auto rgn = adoptGDIObject(::CreateRectRgn(0, 0, 0, 0));
::SetWindowRgn(m_window, rgn.leak(), FALSE);
} else {
auto rgn = adoptGDIObject(::CreateRectRgn(m_clipRect.x(), m_clipRect.y(), m_clipRect.maxX(), m_clipRect.maxY()));
::SetWindowRgn(m_window, rgn.leak(), TRUE);
}
if (m_windowRect != oldWindowRect)
::MoveWindow(m_window, m_windowRect.x(), m_windowRect.y(), m_windowRect.width(), m_windowRect.height(), TRUE);
if (clipToZeroRect) {
auto rgn = adoptGDIObject(::CreateRectRgn(m_clipRect.x(), m_clipRect.y(), m_clipRect.maxX(), m_clipRect.maxY()));
::SetWindowRgn(m_window, rgn.leak(), TRUE);
}
}
示例12: keyboardEvent
void WebViewPrivate::onKeyDown(BalEventKey eventKey)
{
using namespace EA::WebKit;
// 7/20/09 CSidhall -Added for crash fix
if(!m_webView || !m_webView->page() || !m_webView->page()->focusController() )
return;
Frame* frame = m_webView->page()->focusController()->focusedOrMainFrame();
if (!frame)
return;
PlatformKeyboardEvent keyboardEvent(&eventKey);
if (frame->eventHandler()->keyEvent(keyboardEvent))
return;
FrameView* view = frame->view();
SelectionController::EAlteration alteration;
if (eventKey.mId == kShift)
alteration = SelectionController::EXTEND;
else
alteration = SelectionController::MOVE;
switch (eventKey.mId) {
case kArrowDown:
view->scrollBy(0, LINE_STEP);
break;
case kArrowUp:
view->scrollBy(0, -LINE_STEP);
break;
case kArrowRight:
view->scrollBy(LINE_STEP, 0);
break;
case kArrowLeft:
view->scrollBy(-LINE_STEP, 0);
break;
case kHome:
frame->selection()->modify(alteration, SelectionController::BACKWARD, DocumentBoundary, true);
break;
case kEnd:
frame->selection()->modify(alteration, SelectionController::FORWARD, DocumentBoundary, true);
break;
case kEscape:
// On FireFox, esc causes animations to stop.
break;
case kF1:
m_webView->goBack();
view->update();
break;
case kF2:
m_webView->goForward();
view->update();
break;
default:
break;
}
}
示例13: core
void WebFrameLoaderClient::transitionToCommittedForNewPage()
{
Frame* frame = core(m_webFrame);
ASSERT(frame);
Page* page = frame->page();
ASSERT(page);
bool isMainFrame = frame == page->mainFrame();
/* if (isMainFrame && frame->view())
frame->view()->detachFromWindow();*/
frame->setView(0);
m_webFrame->updateBackground();
WebView* webView = m_webFrame->webView();
FrameView* frameView;
if (isMainFrame) {
IntRect rect = webView->frameRect();
frameView = new FrameView(frame, rect.size());
} else
frameView = new FrameView(frame);
frame->setView(frameView);
frameView->deref(); // FrameViews are created with a ref count of 1. Release this ref since we've assigned it to frame.
BalWidget* viewWindow = webView->viewWindow();
if (viewWindow)
frameView->setContainingWindow(viewWindow);
/*if (isMainFrame)
frameView->attachToWindow();*/
if (frame->ownerRenderer())
frame->ownerRenderer()->setWidget(frameView);
if (HTMLFrameOwnerElement* owner = frame->ownerElement())
frame->view()->setScrollbarsMode(owner->scrollingMode());
}
示例14: updatePluginWidget
void PluginView::updatePluginWidget()
{
FrameView* frameView = static_cast<FrameView*>(parent());
PLUGIN_LOG("--%p UpdatePluginWidget frame=[%p] \n", instance(), frameView);
if (frameView) {
m_windowRect = frameView->contentsToWindow(frameRect());
IntRect oldPageRect = m_pageRect;
// only the top ScrollView can have the offset
m_pageRect = m_windowRect;
ScrollView* top = parent();
while (top->parent())
top = top->parent();
m_pageRect.move(top->scrollOffset());
if (m_pageRect != oldPageRect)
setNPWindowIfNeeded();
}
}
示例15: cancelDrag
// Manual drag caret manipulation
void DragController::placeDragCaret(const IntPoint& windowPoint)
{
Frame* mainFrame = m_page->mainFrame();
Document* newDraggingDoc = mainFrame->documentAtPoint(windowPoint);
if (m_document != newDraggingDoc) {
if (m_document)
cancelDrag();
m_document = newDraggingDoc;
}
if (!m_document)
return;
Frame* frame = m_document->frame();
ASSERT(frame);
FrameView* frameView = frame->view();
if (!frameView)
return;
IntPoint framePoint = frameView->windowToContents(windowPoint);
Selection dragCaret(frame->visiblePositionForPoint(framePoint));
m_page->dragCaretController()->setSelection(dragCaret);
}