OLD | NEW |
| (Empty) |
1 // Copyright (c) 2013 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_PREDICTORS_LOGGED_IN_PREDICTOR_TABLE_H_ | |
6 #define CHROME_BROWSER_PREDICTORS_LOGGED_IN_PREDICTOR_TABLE_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/time.h" | |
11 #include "chrome/browser/predictors/predictor_table_base.h" | |
12 #include "googleurl/src/gurl.h" | |
13 | |
14 namespace sql { | |
15 class Statement; | |
16 } | |
17 | |
18 namespace predictors { | |
19 | |
20 // Interface for database table to keep track of what sites a user is logged | |
21 // in to. | |
22 // All methods except the constructor and destructor need to be called on the DB | |
23 // thread. | |
24 // Manages one table { domain (primary key), added_timestamp }. | |
25 class LoggedInPredictorTable : public PredictorTableBase { | |
26 public: | |
27 // Adds the relevant part of the domain of the URL provided to the database | |
28 // as the user having performed a login action. | |
29 void Add(const GURL& url); | |
30 // Checks whether for the relevant part of the domain of the URL provided, | |
31 // the user has performed a login action in the past. | |
32 void HasUserLoggedIn(const GURL& url, bool* is_present, | |
33 bool* lookup_succeeded); | |
34 void DeleteAllCreatedBetween(const base::Time& delete_begin, | |
35 const base::Time& delete_end); | |
36 | |
37 private: | |
38 friend class PredictorDatabaseInternal; | |
39 | |
40 LoggedInPredictorTable(); | |
41 virtual ~LoggedInPredictorTable(); | |
42 | |
43 // PredictorTableBase methods. | |
44 virtual void CreateTableIfNonExistent() OVERRIDE; | |
45 virtual void LogDatabaseStats() OVERRIDE; | |
46 | |
47 std::string GetKey(const GURL& url) const; | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(LoggedInPredictorTable); | |
50 }; | |
51 | |
52 } // namespace predictors | |
53 | |
54 #endif // CHROME_BROWSER_PREDICTORS_LOGGED_IN_PREDICTOR_TABLE_H_ | |
OLD | NEW |