| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_HISTORY_PAGE_USAGE_DATA_H__ | 5 #ifndef CHROME_BROWSER_HISTORY_PAGE_USAGE_DATA_H__ |
| 6 #define CHROME_BROWSER_HISTORY_PAGE_USAGE_DATA_H__ | 6 #define CHROME_BROWSER_HISTORY_PAGE_USAGE_DATA_H__ |
| 7 | 7 |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "base/time/time.h" | |
| 10 #include "chrome/browser/history/history_types.h" | 9 #include "chrome/browser/history/history_types.h" |
| 11 #include "url/gurl.h" | 10 #include "url/gurl.h" |
| 12 | 11 |
| 13 class SkBitmap; | 12 class SkBitmap; |
| 14 | 13 |
| 15 ///////////////////////////////////////////////////////////////////////////// | 14 ///////////////////////////////////////////////////////////////////////////// |
| 16 // | 15 // |
| 17 // PageUsageData | 16 // PageUsageData |
| 18 // | 17 // |
| 19 // A per domain usage data structure to compute and manage most visited | 18 // A per domain usage data structure to compute and manage most visited |
| (...skipping 30 matching lines...) Expand all Loading... |
| 50 } | 49 } |
| 51 | 50 |
| 52 void SetScore(double v) { | 51 void SetScore(double v) { |
| 53 score_ = v; | 52 score_ = v; |
| 54 } | 53 } |
| 55 | 54 |
| 56 double GetScore() const { | 55 double GetScore() const { |
| 57 return score_; | 56 return score_; |
| 58 } | 57 } |
| 59 | 58 |
| 60 void SetDuration(base::TimeDelta duration) { | |
| 61 duration_ = duration; | |
| 62 } | |
| 63 | |
| 64 base::TimeDelta duration() const { | |
| 65 return duration_; | |
| 66 } | |
| 67 | |
| 68 // Sort predicate to sort instances by score (high to low) | 59 // Sort predicate to sort instances by score (high to low) |
| 69 static bool Predicate(const PageUsageData* dud1, const PageUsageData* dud2); | 60 static bool Predicate(const PageUsageData* dud1, const PageUsageData* dud2); |
| 70 | 61 |
| 71 private: | 62 private: |
| 72 history::SegmentID id_; | 63 history::SegmentID id_; |
| 73 GURL url_; | 64 GURL url_; |
| 74 base::string16 title_; | 65 base::string16 title_; |
| 75 | 66 |
| 76 double score_; | 67 double score_; |
| 77 | |
| 78 // Duration is only set by QuerySegmentDurationSince(). | |
| 79 base::TimeDelta duration_; | |
| 80 }; | 68 }; |
| 81 | 69 |
| 82 #endif // CHROME_BROWSER_HISTORY_PAGE_USAGE_DATA_H__ | 70 #endif // CHROME_BROWSER_HISTORY_PAGE_USAGE_DATA_H__ |
| OLD | NEW |