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.
5 #ifndef CHROME_BROWSER_PREDICTORS_LOGGED_IN_PREDICTOR_TABLE_H_
6 #define CHROME_BROWSER_PREDICTORS_LOGGED_IN_PREDICTOR_TABLE_H_
10 #include "base/time.h"
11 #include "chrome/browser/predictors/predictor_table_base.h"
12 #include "googleurl/src/gurl.h"
18 namespace predictors
{
20 // Interface for database table to keep track of what sites a user is logged
22 // All methods except the constructor and destructor need to be called on the DB
24 // Manages one table { domain (primary key), added_timestamp }.
25 class LoggedInPredictorTable
: public PredictorTableBase
{
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
);
38 friend class PredictorDatabaseInternal
;
40 LoggedInPredictorTable();
41 virtual ~LoggedInPredictorTable();
43 // PredictorTableBase methods.
44 virtual void CreateTableIfNonExistent() OVERRIDE
;
45 virtual void LogDatabaseStats() OVERRIDE
;
47 std::string
GetKey(const GURL
& url
) const;
49 DISALLOW_COPY_AND_ASSIGN(LoggedInPredictorTable
);
52 } // namespace predictors
54 #endif // CHROME_BROWSER_PREDICTORS_LOGGED_IN_PREDICTOR_TABLE_H_