1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_HISTORY_PAGE_USAGE_DATA_H__
6 #define CHROME_BROWSER_HISTORY_PAGE_USAGE_DATA_H__
8 #include "base/strings/string16.h"
9 #include "base/time/time.h"
10 #include "chrome/browser/history/history_types.h"
15 /////////////////////////////////////////////////////////////////////////////
19 // A per domain usage data structure to compute and manage most visited
22 // See History::QueryPageUsageSince()
24 /////////////////////////////////////////////////////////////////////////////
27 explicit PageUsageData(history::SegmentID id);
29 virtual ~PageUsageData();
32 history::SegmentID GetID() const {
36 void SetURL(const GURL& url) {
40 const GURL& GetURL() const {
44 void SetTitle(const string16& s) {
48 const string16& GetTitle() const {
52 void SetScore(double v) {
56 double GetScore() const {
60 void SetDuration(base::TimeDelta duration) {
64 base::TimeDelta duration() const {
68 // Sort predicate to sort instances by score (high to low)
69 static bool Predicate(const PageUsageData* dud1, const PageUsageData* dud2);
72 history::SegmentID id_;
78 // Duration is only set by QuerySegmentDurationSince().
79 base::TimeDelta duration_;
82 #endif // CHROME_BROWSER_HISTORY_PAGE_USAGE_DATA_H__