当前位置: 首页>>代码示例>>C++>>正文


C++ HistoryItem类代码示例

本文整理汇总了C++中HistoryItem的典型用法代码示例。如果您正苦于以下问题:C++ HistoryItem类的具体用法?C++ HistoryItem怎么用?C++ HistoryItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了HistoryItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ASSERT

void CachedFrameBase::restore()
{
    ASSERT(m_document->view() == m_view);

    if (m_isMainFrame)
        m_view->setParentVisible(true);

    Frame& frame = m_view->frame();
    m_cachedFrameScriptData->restore(frame);

    if (m_document->svgExtensions())
        m_document->accessSVGExtensions().unpauseAnimations();

    frame.animation().resumeAnimationsForDocument(m_document.get());
    m_document->resumeActiveDOMObjects(ActiveDOMObject::PageCache);
    m_document->resumeScriptedAnimationControllerCallbacks();

    // It is necessary to update any platform script objects after restoring the
    // cached page.
    frame.script().updatePlatformScriptObjects();

    if (m_isComposited)
        frame.view()->restoreBackingStores();

    frame.loader().client().didRestoreFromPageCache();

    // Reconstruct the FrameTree. And open the child CachedFrames in their respective FrameLoaders.
    for (unsigned i = 0; i < m_childFrames.size(); ++i) {
        frame.tree().appendChild(&m_childFrames[i]->view()->frame());
        m_childFrames[i]->open();
    }

#if PLATFORM(IOS)
    if (m_isMainFrame) {
        frame.loader().client().didRestoreFrameHierarchyForCachedFrame();

        if (DOMWindow* domWindow = m_document->domWindow()) {
            // FIXME: Add SCROLL_LISTENER to the list of event types on Document, and use m_document->hasListenerType(). See <rdar://problem/9615482>.
            // FIXME: Can use Document::hasListenerType() now.
            if (domWindow->scrollEventListenerCount() && frame.page())
                frame.page()->chrome().client().setNeedsScrollNotifications(&frame, true);
        }
    }
#endif

    // FIXME: update Page Visibility state here.
    // https://bugs.webkit.org/show_bug.cgi?id=116770
    m_document->enqueuePageshowEvent(PageshowEventPersisted);

    HistoryItem* historyItem = frame.loader().history().currentItem();
    m_document->enqueuePopstateEvent(historyItem && historyItem->stateObject() ? historyItem->stateObject() : SerializedScriptValue::nullValue());

#if ENABLE(TOUCH_EVENTS) && !PLATFORM(IOS)
    if (m_document->hasTouchEventHandlers())
        m_document->page()->chrome().client().needTouchEvents(true);
#endif

    m_document->resume();
}
开发者ID:XPhoenixL,项目名称:webkit,代码行数:59,代码来源:CachedFrame.cpp

示例2: ASSERT

void CachedFrameBase::restore()
{
    ASSERT(m_document->view() == m_view);

    if (m_isMainFrame)
        m_view->setParentVisible(true);

    Frame* frame = m_view->frame();
    m_cachedFrameScriptData->restore(frame);

#if ENABLE(SVG)
    if (m_document->svgExtensions())
        m_document->accessSVGExtensions()->unpauseAnimations();
#endif

    frame->animation()->resumeAnimationsForDocument(m_document.get());
    frame->eventHandler()->setMousePressNode(m_mousePressNode.get());
    m_document->resumeActiveDOMObjects();
    m_document->resumeScriptedAnimationControllerCallbacks();

    // It is necessary to update any platform script objects after restoring the
    // cached page.
    frame->script()->updatePlatformScriptObjects();

#if USE(ACCELERATED_COMPOSITING)
    if (m_isComposited)
        frame->view()->restoreBackingStores();
#endif

    frame->loader()->client()->didRestoreFromPageCache();

    // Reconstruct the FrameTree
    for (unsigned i = 0; i < m_childFrames.size(); ++i)
        frame->tree()->appendChild(m_childFrames[i]->view()->frame());

    // Open the child CachedFrames in their respective FrameLoaders.
    for (unsigned i = 0; i < m_childFrames.size(); ++i)
        m_childFrames[i]->open();

    if (m_isMainFrame) {
        frame->loader()->client()->didRestoreFrameHierarchyForCachedFrame();

        if (DOMWindow* domWindow = m_document->domWindow()) {
            // FIXME: add SCROLL_LISTENER to the list of event types on Document, and use m_document->hasListenerType() <rdar://problem/9615482>
            if (domWindow->scrollEventListenerCount() > 0 && frame->page())
                frame->page()->chrome()->client()->setNeedsScrollNotifications(frame, true);
        }
    }

    m_document->enqueuePageshowEvent(PageshowEventPersisted);
    
    HistoryItem* historyItem = frame->loader()->history()->currentItem();
    m_document->enqueuePopstateEvent(historyItem && historyItem->stateObject() ? historyItem->stateObject() : SerializedScriptValue::nullValue());
    

    m_document->documentDidBecomeActive();
}
开发者ID:ricardo-quesada,项目名称:Webkit-Projects,代码行数:57,代码来源:CachedFrame.cpp

示例3: Java_com_sun_webkit_BackForwardList_bflItemGetTarget

// entry.getTarget()
JNIEXPORT jstring JNICALL Java_com_sun_webkit_BackForwardList_bflItemGetTarget(JNIEnv* env, jclass z, jlong jitem)
{
    HistoryItem* item = getItem(jitem);
    String target = item->target();
    if (!target.isEmpty()) {
        return target.toJavaString(env).releaseLocal();
    } else {
        return NULL;
    }
}
开发者ID:166MMX,项目名称:openjdk.java.net-openjfx-8u40-rt,代码行数:11,代码来源:BackForwardListJava.cpp

示例4: itemFromIndex

int HistoryModel::rowCount(const QModelIndex &parent) const
{
    if (parent.column() > 0) {
        return 0;
    }

    HistoryItem* parentItem = itemFromIndex(parent);

    return parentItem->childCount();
}
开发者ID:Haommin,项目名称:qupzilla,代码行数:10,代码来源:historymodel.cpp

示例5: QModelIndex

QModelIndex HistoryModel::index(int row, int column, const QModelIndex &parent) const
{
    if (!hasIndex(row, column, parent)) {
        return QModelIndex();
    }

    HistoryItem* parentItem = itemFromIndex(parent);
    HistoryItem* childItem = parentItem->child(row);

    return childItem ? createIndex(row, column, childItem) : QModelIndex();
}
开发者ID:Haommin,项目名称:qupzilla,代码行数:11,代码来源:historymodel.cpp

示例6: switch

void ApiWrap::gotWebPages(const MTPmessages_Messages &msgs, mtpRequestId req) {
	const QVector<MTPMessage> *v = 0;
	switch (msgs.type()) {
	case mtpc_messages_messages:
		App::feedUsers(msgs.c_messages_messages().vusers);
		App::feedChats(msgs.c_messages_messages().vchats);
		v = &msgs.c_messages_messages().vmessages.c_vector().v;
		break;

	case mtpc_messages_messagesSlice:
		App::feedUsers(msgs.c_messages_messagesSlice().vusers);
		App::feedChats(msgs.c_messages_messagesSlice().vchats);
		v = &msgs.c_messages_messagesSlice().vmessages.c_vector().v;
		break;
	}

	QMap<int32, int32> msgsIds; // copied from feedMsgs
	for (int32 i = 0, l = v->size(); i < l; ++i) {
		const MTPMessage &msg(v->at(i));
		switch (msg.type()) {
		case mtpc_message: msgsIds.insert(msg.c_message().vid.v, i); break;
		case mtpc_messageEmpty: msgsIds.insert(msg.c_messageEmpty().vid.v, i); break;
		case mtpc_messageService: msgsIds.insert(msg.c_messageService().vid.v, i); break;
		}
	}

	MainWidget *m = App::main();
	for (QMap<int32, int32>::const_iterator i = msgsIds.cbegin(), e = msgsIds.cend(); i != e; ++i) {
		HistoryItem *item = App::histories().addToBack(v->at(*i), -1);
		if (item) {
			item->initDimensions();
			if (m) m->itemResized(item);
		}
	}

	const WebPageItems &items(App::webPageItems());
	for (WebPagesPending::iterator i = _webPagesPending.begin(); i != _webPagesPending.cend();) {
		if (i.value() == req) {
			if (i.key()->pendingTill > 0) {
				i.key()->pendingTill = -1;
				WebPageItems::const_iterator j = items.constFind(i.key());
				if (j != items.cend()) {
					for (HistoryItemsMap::const_iterator k = j.value().cbegin(), e = j.value().cend(); k != e; ++k) {
						k.key()->initDimensions();
						if (m) m->itemResized(k.key());
					}
				}
			}
			i = _webPagesPending.erase(i);
		} else {
			++i;
		}
	}
}
开发者ID:behnaaz,项目名称:tdesktop,代码行数:54,代码来源:apiwrap.cpp

示例7: isAncestorOf

bool HistoryItem::isAncestorOf(const HistoryItem* item) const
{
    for (size_t i = 0; i < m_children.size(); ++i) {
        HistoryItem* child = m_children[i].get();
        if (child == item)
            return true;
        if (child->isAncestorOf(item))
            return true;
    }
    return false;
}
开发者ID:Channely,项目名称:know-your-chrome,代码行数:11,代码来源:HistoryItem.cpp

示例8: Java_com_sun_webkit_BackForwardList_bflGet

// BackForwardList.get()
JNIEXPORT jobject JNICALL Java_com_sun_webkit_BackForwardList_bflGet(JNIEnv* env, jclass z, jlong jpage, jint index)
{
    BackForwardList* bfl = getBfl(jpage);
    HistoryItem* item = itemAtIndex(bfl, index);
    if (!item)
        return 0;
    JLObject host(item->hostObject());
    if (!host) {
        host = createEntry(item, jpage);
    }
    return host.releaseLocal();
}
开发者ID:166MMX,项目名称:openjdk.java.net-openjfx-8u40-rt,代码行数:13,代码来源:BackForwardListJava.cpp

示例9: ASSERT

void HistoryController::replaceState(PassRefPtr<SerializedScriptValue> stateObject, const String& title, const String& urlString)
{
    Page* page = m_frame->page();
    ASSERT(page);
    HistoryItem* current = page->backForwardList()->currentItem();
    ASSERT(current);

    if (!urlString.isEmpty())
        current->setURLString(urlString);
    current->setTitle(title);
    current->setStateObject(stateObject);
}
开发者ID:matthiasbock,项目名称:Samsung-GT-S6102-platform,代码行数:12,代码来源:HistoryController.cpp

示例10: addEntry

void History::addEntry(const HistoryItem &item, int oldest)
{
    std::lock_guard<std::mutex> lock(historyItemsMutex_);
    if (item.hasPeerNumber() and item.youngerThan(oldest)) {
        items_.push_back(item);
        auto im = item.toMap();
        string name(im["display_name"]);
        string account(im["accountid"]);
        string number(im["peer_number"]);
        if (nameCache_[account][number].empty() and not name.empty() and not number.empty())
            nameCache_[account][number] = name;
    }
}
开发者ID:dot-Sean,项目名称:telephony,代码行数:13,代码来源:history.cpp

示例11: clearAllPageCaches

bool BackForwardList::clearAllPageCaches()
{
    bool didRemoveAtLeastOneItem = false;
    unsigned length = m_entries.size();
    for (unsigned i = 0; i < length; ++i) {
        HistoryItem* item = m_entries[i].get();
        if (item->isInPageCache()) {
            didRemoveAtLeastOneItem = true;
            pageCache()->remove(item);
        }
    }
    return didRemoveAtLeastOneItem;
}
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:13,代码来源:BackForwardList.cpp

示例12: restoreViewState

void FrameLoaderClientAndroid::restoreViewState() {
    WebViewCore* webViewCore = WebViewCore::getWebViewCore(m_frame->view());
    HistoryItem* item = m_frame->loader()->history()->currentItem();
    AndroidWebHistoryBridge* bridge = item->bridge();
    // restore the scale (only) for the top frame
    if (!m_frame->tree()->parent()) {
        int scale = bridge->scale();
        webViewCore->restoreScale(scale);
        int screenWidthScale = bridge->screenWidthScale();
        if (screenWidthScale != scale)
            webViewCore->restoreScreenWidthScale(screenWidthScale);
    }
}
开发者ID:federivas,项目名称:s6500d_official_platform,代码行数:13,代码来源:FrameLoaderClientAndroid.cpp

示例13: shouldDoSameDocumentNavigationTo

// We do same-document navigation if going to a different item and if either of the following is true:
// - The other item corresponds to the same document (for history entries created via pushState or fragment changes).
// - The other item corresponds to the same set of documents, including frames (for history entries created via regular navigation)
bool HistoryItem::shouldDoSameDocumentNavigationTo(HistoryItem& otherItem) const
{
    if (this == &otherItem)
        return false;

    if (stateObject() || otherItem.stateObject())
        return documentSequenceNumber() == otherItem.documentSequenceNumber();
    
    if ((url().hasFragmentIdentifier() || otherItem.url().hasFragmentIdentifier()) && equalIgnoringFragmentIdentifier(url(), otherItem.url()))
        return documentSequenceNumber() == otherItem.documentSequenceNumber();
    
    return hasSameDocumentTree(otherItem);
}
开发者ID:rhythmkay,项目名称:webkit,代码行数:16,代码来源:HistoryItem.cpp

示例14: createNewBackForwardItem

void HistoryController::createNewBackForwardItem(LocalFrame* targetFrame, HistoryItem* item, bool clipAtTarget)
{
    RefPtr<HistoryItem> newItem = item;
    if (!m_currentEntry) {
        m_currentEntry = HistoryEntry::create(newItem.get(), targetFrame->frameID());
    } else {
        HistoryItem* oldItem = m_currentEntry->itemForFrame(targetFrame);
        if (!clipAtTarget && oldItem)
            newItem->setDocumentSequenceNumber(oldItem->documentSequenceNumber());
        m_previousEntry = m_currentEntry.release();
        m_currentEntry = m_previousEntry->cloneAndReplace(newItem.get(), clipAtTarget, targetFrame, m_page);
    }
}
开发者ID:jeremyroman,项目名称:blink,代码行数:13,代码来源:HistoryController.cpp

示例15: kid

QMap<QString, QWebHistoryItem> DumpRenderTreeSupportQt::getChildHistoryItems(const QWebHistoryItem& historyItem)
{
    QWebHistoryItem it = historyItem;
    HistoryItem* item = QWebHistoryItemPrivate::core(&it);
    const WebCore::HistoryItemVector& children = item->children();

    unsigned size = children.size();
    QMap<QString, QWebHistoryItem> kids;
    for (unsigned i = 0; i < size; ++i) {
        QWebHistoryItem kid(new QWebHistoryItemPrivate(children[i].get()));
        kids.insert(DumpRenderTreeSupportQt::historyItemTarget(kid), kid);
    }
    return kids;
}
开发者ID:jbat100,项目名称:webkit,代码行数:14,代码来源:DumpRenderTreeSupportQt.cpp


注:本文中的HistoryItem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。