本文整理汇总了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();
}
示例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();
}
示例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;
}
}
示例4: itemFromIndex
int HistoryModel::rowCount(const QModelIndex &parent) const
{
if (parent.column() > 0) {
return 0;
}
HistoryItem* parentItem = itemFromIndex(parent);
return parentItem->childCount();
}
示例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();
}
示例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;
}
}
}
示例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;
}
示例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();
}
示例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);
}
示例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;
}
}
示例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;
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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;
}