Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1684)

Unified Diff: chrome/browser/predictors/logged_in_predictor_table.h

Issue 13903018: Add the LoggedIn Predictor, to detect which websites a user is likely (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: line break Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/predictors/logged_in_predictor_table.h
===================================================================
--- chrome/browser/predictors/logged_in_predictor_table.h (revision 0)
+++ chrome/browser/predictors/logged_in_predictor_table.h (revision 0)
@@ -0,0 +1,54 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_PREDICTORS_LOGGED_IN_PREDICTOR_TABLE_H_
+#define CHROME_BROWSER_PREDICTORS_LOGGED_IN_PREDICTOR_TABLE_H_
+
+#include <string>
+
+#include "base/time.h"
+#include "chrome/browser/predictors/predictor_table_base.h"
+#include "googleurl/src/gurl.h"
+
+namespace sql {
+class Statement;
+}
+
+namespace predictors {
+
+// Interface for database table to keep track of what sites a user is logged
+// in to.
+// All methods except the constructor and destructor need to be called on the DB
+// thread.
+// Manages one table { domain (primary key), added_timestamp }.
+class LoggedInPredictorTable : public PredictorTableBase {
+ public:
+ // Adds the relevant part of the domain of the URL provided to the database
+ // as the user having performed a login action.
+ void Add(const GURL& url);
+ // Checks whether for the relevant part of the domain of the URL provided,
+ // the user has performed a login action in the past.
+ void HasUserLoggedIn(const GURL& url, bool* is_present,
+ bool* lookup_succeeded);
+ void DeleteAllCreatedBetween(const base::Time& delete_begin,
+ const base::Time& delete_end);
+
+ private:
+ friend class PredictorDatabaseInternal;
+
+ LoggedInPredictorTable();
+ virtual ~LoggedInPredictorTable();
+
+ // PredictorTableBase methods.
+ virtual void CreateTableIfNonExistent() OVERRIDE;
+ virtual void LogDatabaseStats() OVERRIDE;
+
+ std::string GetKey(const GURL& url) const;
+
+ DISALLOW_COPY_AND_ASSIGN(LoggedInPredictorTable);
+};
+
+} // namespace predictors
+
+#endif // CHROME_BROWSER_PREDICTORS_LOGGED_IN_PREDICTOR_TABLE_H_
Property changes on: chrome/browser/predictors/logged_in_predictor_table.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover.cc ('k') | chrome/browser/predictors/logged_in_predictor_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698