Index: chrome/browser/extensions/activity_database.h |
=================================================================== |
--- chrome/browser/extensions/activity_database.h (revision 0) |
+++ chrome/browser/extensions/activity_database.h (revision 0) |
@@ -0,0 +1,45 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// User of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_DATABASE_H_ |
+#define CHROME_BROWSER_EXTENSIONS_ACTIVITY_DATABASE_H_ |
+ |
+#include "base/basictypes.h" |
+#include "base/file_path.h" |
+#include "base/logging.h" |
+#include "chrome/browser/extensions/manager_actions.h" |
+#include "chrome/browser/extensions/url_actions.h" |
+#include "sql/connection.h" |
+#include "sql/init_status.h" |
+#include "sql/meta_table.h" |
+#include "sql/transaction.h" |
+ |
+class FilePath; |
+ |
+namespace activity { |
+ |
+// Encapsulates the SQL connection for the activity log database. |
+// This class holds the database connection and has methods for writing. |
+class ActivityDatabase { |
+ public: |
+ // Need to call Init to actually use the ActivityDatabase. |
+ ActivityDatabase(); |
+ |
+ virtual ~ActivityDatabase(); |
mvrable
2012/12/04 01:00:13
If ActivityDatabase will not be extended it is not
felt
2012/12/07 19:27:45
Done.
|
+ |
+ // Opens the DB and creates tables as necessary. |
+ sql::InitStatus Init(const FilePath& db_name, |
+ sql::ErrorDelegate* error_delegate); |
mvrable
2012/12/04 01:00:13
Arguments in continuation lines should all line up
felt
2012/12/07 19:27:45
Done.
|
+ |
+ // Record a UrlAction in the database. |
mvrable
2012/12/04 01:00:13
Describe the meaning of the return value.
felt
2012/12/07 19:27:45
Done.
|
+ bool RecordAction(const UrlAction& action); |
+ |
+ // Record a ManagerAction in the database. |
+ bool RecordAction(const ManagerAction& action); |
+ |
+ private: |
+ sql::Connection db_; |
+}; |
+} |
+#endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_DATABASE_H_ |