Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Side by Side Diff: chrome/browser/history/page_usage_data.h

Issue 439713004: Partially move history_types.{cc,h} to //components/history (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #ifndef CHROME_BROWSER_HISTORY_PAGE_USAGE_DATA_H__
6 #define CHROME_BROWSER_HISTORY_PAGE_USAGE_DATA_H__
7
8 #include "base/strings/string16.h"
9 #include "chrome/browser/history/history_types.h"
10 #include "url/gurl.h"
11
12 class SkBitmap;
13
14 /////////////////////////////////////////////////////////////////////////////
15 //
16 // PageUsageData
17 //
18 // A per domain usage data structure to compute and manage most visited
19 // pages.
20 //
21 // See History::QueryPageUsageSince()
22 //
23 /////////////////////////////////////////////////////////////////////////////
24 class PageUsageData {
25 public:
26 explicit PageUsageData(history::SegmentID id);
27
28 virtual ~PageUsageData();
29
30 // Return the url ID
31 history::SegmentID GetID() const {
32 return id_;
33 }
34
35 void SetURL(const GURL& url) {
36 url_ = url;
37 }
38
39 const GURL& GetURL() const {
40 return url_;
41 }
42
43 void SetTitle(const base::string16& s) {
44 title_ = s;
45 }
46
47 const base::string16& GetTitle() const {
48 return title_;
49 }
50
51 void SetScore(double v) {
52 score_ = v;
53 }
54
55 double GetScore() const {
56 return score_;
57 }
58
59 // Sort predicate to sort instances by score (high to low)
60 static bool Predicate(const PageUsageData* dud1, const PageUsageData* dud2);
61
62 private:
63 history::SegmentID id_;
64 GURL url_;
65 base::string16 title_;
66
67 double score_;
68 };
69
70 #endif // CHROME_BROWSER_HISTORY_PAGE_USAGE_DATA_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698