| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_VISITSEGMENT_DATABASE_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_VISITSEGMENT_DATABASE_H_ |
| 6 #define CHROME_BROWSER_HISTORY_VISITSEGMENT_DATABASE_H_ | 6 #define CHROME_BROWSER_HISTORY_VISITSEGMENT_DATABASE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "chrome/browser/history/history_types.h" | 10 #include "chrome/browser/history/history_types.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 // Compute the segment usage since |from_time| using the provided aggregator. | 54 // Compute the segment usage since |from_time| using the provided aggregator. |
| 55 // A PageUsageData is added in |result| for the highest-scored segments up to | 55 // A PageUsageData is added in |result| for the highest-scored segments up to |
| 56 // |max_result_count|. | 56 // |max_result_count|. |
| 57 void QuerySegmentUsage(base::Time from_time, | 57 void QuerySegmentUsage(base::Time from_time, |
| 58 int max_result_count, | 58 int max_result_count, |
| 59 std::vector<PageUsageData*>* result); | 59 std::vector<PageUsageData*>* result); |
| 60 | 60 |
| 61 // Delete all the segment usage data which is older than the provided time | 61 // Delete all the segment usage data which is older than the provided time |
| 62 // stamp. | 62 // stamp. |
| 63 void DeleteSegmentData(base::Time older_than); | 63 bool DeleteSegmentData(base::Time older_than); |
| 64 | 64 |
| 65 // Change the presentation id for the segment identified by |segment_id| | 65 // Change the presentation id for the segment identified by |segment_id| |
| 66 void SetSegmentPresentationIndex(SegmentID segment_id, int index); | 66 bool SetSegmentPresentationIndex(SegmentID segment_id, int index); |
| 67 | 67 |
| 68 // Delete the segment currently using the provided url for representation. | 68 // Delete the segment currently using the provided url for representation. |
| 69 // This will also delete any associated segment usage data. | 69 // This will also delete any associated segment usage data. |
| 70 bool DeleteSegmentForURL(URLID url_id); | 70 bool DeleteSegmentForURL(URLID url_id); |
| 71 | 71 |
| 72 protected: | 72 protected: |
| 73 // Returns the database for the functions in this interface. | 73 // Returns the database for the functions in this interface. |
| 74 virtual sql::Connection& GetDB() = 0; | 74 virtual sql::Connection& GetDB() = 0; |
| 75 | 75 |
| 76 // Creates the tables used by this class if necessary. Returns true on | 76 // Creates the tables used by this class if necessary. Returns true on |
| 77 // success. | 77 // success. |
| 78 bool InitSegmentTables(); | 78 bool InitSegmentTables(); |
| 79 | 79 |
| 80 // Deletes all the segment tables, returning true on success. | 80 // Deletes all the segment tables, returning true on success. |
| 81 bool DropSegmentTables(); | 81 bool DropSegmentTables(); |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 DISALLOW_COPY_AND_ASSIGN(VisitSegmentDatabase); | 84 DISALLOW_COPY_AND_ASSIGN(VisitSegmentDatabase); |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 } // namespace history | 87 } // namespace history |
| 88 | 88 |
| 89 #endif // CHROME_BROWSER_HISTORY_VISITSEGMENT_DATABASE_H_ | 89 #endif // CHROME_BROWSER_HISTORY_VISITSEGMENT_DATABASE_H_ |
| OLD | NEW |