summaryrefslogtreecommitdiffstats
path: root/WebCore/history/HistoryItem.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2009-08-11 17:01:47 +0100
committerBen Murdoch <benm@google.com>2009-08-11 18:21:02 +0100
commit0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5 (patch)
tree2943df35f62d885c89d01063cc528dd73b480fea /WebCore/history/HistoryItem.cpp
parent7e7a70bfa49a1122b2597a1e6367d89eb4035eca (diff)
downloadexternal_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.zip
external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.gz
external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.bz2
Merge in WebKit r47029.
Diffstat (limited to 'WebCore/history/HistoryItem.cpp')
-rw-r--r--WebCore/history/HistoryItem.cpp41
1 files changed, 29 insertions, 12 deletions
diff --git a/WebCore/history/HistoryItem.cpp b/WebCore/history/HistoryItem.cpp
index 7826eb8..08143e8 100644
--- a/WebCore/history/HistoryItem.cpp
+++ b/WebCore/history/HistoryItem.cpp
@@ -165,8 +165,8 @@ const String& HistoryItem::alternateTitle() const
Image* HistoryItem::icon() const
{
- Image* result = iconDatabase()->iconForPageURL(m_urlString, IntSize(16,16));
- return result ? result : iconDatabase()->defaultIcon(IntSize(16,16));
+ Image* result = iconDatabase()->iconForPageURL(m_urlString, IntSize(16, 16));
+ return result ? result : iconDatabase()->defaultIcon(IntSize(16, 16));
}
double HistoryItem::lastVisitedTime() const
@@ -313,14 +313,16 @@ void HistoryItem::collapseDailyVisitsToWeekly()
m_weeklyVisitCounts.shrink(maxWeeklyCounts);
}
-void HistoryItem::recordVisitAtTime(double time)
+void HistoryItem::recordVisitAtTime(double time, VisitCountBehavior visitCountBehavior)
{
padDailyCountsForNewVisit(time);
m_lastVisitedTime = time;
- m_visitCount++;
- m_dailyVisitCounts[0]++;
+ if (visitCountBehavior == IncreaseVisitCount) {
+ ++m_visitCount;
+ ++m_dailyVisitCounts[0];
+ }
collapseDailyVisitsToWeekly();
}
@@ -331,10 +333,10 @@ void HistoryItem::setLastVisitedTime(double time)
recordVisitAtTime(time);
}
-void HistoryItem::visited(const String& title, double time)
+void HistoryItem::visited(const String& title, double time, VisitCountBehavior visitCountBehavior)
{
m_title = title;
- recordVisitAtTime(time);
+ recordVisitAtTime(time, visitCountBehavior);
}
int HistoryItem::visitCount() const
@@ -355,10 +357,10 @@ void HistoryItem::setVisitCount(int count)
void HistoryItem::adoptVisitCounts(Vector<int>& dailyCounts, Vector<int>& weeklyCounts)
{
- m_dailyVisitCounts.clear();
- m_dailyVisitCounts.swap(dailyCounts);
- m_weeklyVisitCounts.clear();
- m_weeklyVisitCounts.swap(weeklyCounts);
+ m_dailyVisitCounts.clear();
+ m_dailyVisitCounts.swap(dailyCounts);
+ m_weeklyVisitCounts.clear();
+ m_weeklyVisitCounts.swap(weeklyCounts);
}
const IntPoint& HistoryItem::scrollPoint() const
@@ -473,6 +475,11 @@ bool HistoryItem::hasChildren() const
return !m_children.isEmpty();
}
+void HistoryItem::clearChildren()
+{
+ m_children.clear();
+}
+
String HistoryItem::formContentType() const
{
return m_formContentType;
@@ -496,6 +503,16 @@ void HistoryItem::setFormInfoFromRequest(const ResourceRequest& request)
#endif
}
+void HistoryItem::setFormData(PassRefPtr<FormData> formData)
+{
+ m_formData = formData;
+}
+
+void HistoryItem::setFormContentType(const String& formContentType)
+{
+ m_formContentType = formContentType;
+}
+
FormData* HistoryItem::formData()
{
return m_formData.get();
@@ -504,7 +521,7 @@ FormData* HistoryItem::formData()
bool HistoryItem::isCurrentDocument(Document* doc) const
{
// FIXME: We should find a better way to check if this is the current document.
- return urlString() == doc->url();
+ return equalIgnoringFragmentIdentifier(url(), doc->url());
}
void HistoryItem::mergeAutoCompleteHints(HistoryItem* otherItem)