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_ANDROID_VISIT_SQL_HANDLER_H_
6 #define CHROME_BROWSER_HISTORY_ANDROID_VISIT_SQL_HANDLER_H_
8 #include "chrome/browser/history/android/sql_handler.h"
16 class HistoryDatabase;
18 // This class is the SQLHandler for visits table.
19 class VisitSQLHandler : public SQLHandler {
21 explicit VisitSQLHandler(HistoryDatabase* history_db);
22 virtual ~VisitSQLHandler();
24 // Overriden from SQLHandler.
25 virtual bool Update(const HistoryAndBookmarkRow& row,
26 const TableIDRows& ids_set) override;
27 virtual bool Insert(HistoryAndBookmarkRow* row) override;
28 virtual bool Delete(const TableIDRows& ids_set) override;
31 // Add a row in visit table with the given |url_id| and |visit_time|.
32 bool AddVisit(URLID url_id, const base::Time& visit_time);
34 // Add the given |visit_count| rows for |url_id|. The visit time of each row
35 // has minium difference and ends with the |last_visit_time|.
36 bool AddVisitRows(URLID url_id,
38 const base::Time& last_visit_time);
40 // Delete the visits of the given |url_id|.
41 bool DeleteVisitsForURL(URLID url_id);
43 HistoryDatabase* history_db_;
45 DISALLOW_COPY_AND_ASSIGN(VisitSQLHandler);
48 } // namespace history.
50 #endif // CHROME_BROWSER_HISTORY_ANDROID_VISIT_SQL_HANDLER_H_