OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // User 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_EXTENSIONS_ACTIVITY_DATABASE_H_ | |
6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_DATABASE_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/file_path.h" | |
10 #include "base/logging.h" | |
11 #include "chrome/browser/extensions/manager_actions.h" | |
12 #include "chrome/browser/extensions/url_actions.h" | |
13 #include "sql/connection.h" | |
14 #include "sql/init_status.h" | |
15 #include "sql/meta_table.h" | |
16 #include "sql/transaction.h" | |
17 | |
18 class FilePath; | |
19 | |
20 namespace activity { | |
21 | |
22 // Encapsulates the SQL connection for the activity log database. | |
23 // This class holds the database connection and has methods for writing. | |
24 class ActivityDatabase { | |
25 public: | |
26 // Need to call Init to actually use the ActivityDatabase. | |
27 ActivityDatabase(); | |
28 | |
29 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.
| |
30 | |
31 // Opens the DB and creates tables as necessary. | |
32 sql::InitStatus Init(const FilePath& db_name, | |
33 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.
| |
34 | |
35 // 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.
| |
36 bool RecordAction(const UrlAction& action); | |
37 | |
38 // Record a ManagerAction in the database. | |
39 bool RecordAction(const ManagerAction& action); | |
40 | |
41 private: | |
42 sql::Connection db_; | |
43 }; | |
44 } | |
45 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_DATABASE_H_ | |
OLD | NEW |