Chromium Code Reviews| Index: chrome/browser/extensions/activity_log/fullstream_ui_policy.h |
| diff --git a/chrome/browser/extensions/activity_log/fullstream_ui_policy.h b/chrome/browser/extensions/activity_log/fullstream_ui_policy.h |
| index 88bb0293fac04489739abc5a751a9aed63e855b7..9c5fefe66406418757195d591e29eed5c6a3a72e 100644 |
| --- a/chrome/browser/extensions/activity_log/fullstream_ui_policy.h |
| +++ b/chrome/browser/extensions/activity_log/fullstream_ui_policy.h |
| @@ -7,23 +7,21 @@ |
| #include <string> |
| #include <vector> |
| +#include "chrome/browser/extensions/activity_log/activity_database.h" |
| #include "chrome/browser/extensions/activity_log/activity_log_policy.h" |
| class GURL; |
| namespace extensions { |
| -class ActivityDatabase; |
| - |
| // A policy for logging the full stream of actions, including all arguments. |
| // It's mostly intended to be used in testing and analysis. |
| -class FullStreamUIPolicy : public ActivityLogPolicy { |
| +class FullStreamUIPolicy : public ActivityLogPolicy, |
| + public ActivityPolicyCallbacks { |
|
felt
2013/07/09 22:14:51
Maybe the name should have both Database and Polic
mvrable
2013/07/09 23:03:22
ActivityLogPolicyDatabaseCallbacks? That's gettin
felt
2013/07/10 00:14:36
ActivityDatabasePolicyCallback? 3 characters short
mvrable
2013/07/10 17:49:17
I'm going to change this to ActivityDatabaseCallba
felt
2013/07/10 18:35:17
Thanks, sorry to be picky on this. :)
mvrable
2013/07/10 20:48:41
Not a problem, coming up with good names is import
|
| public: |
| // For more info about these member functions, see the super class. |
| explicit FullStreamUIPolicy(Profile* profile); |
| - virtual ~FullStreamUIPolicy(); |
| - |
| virtual void ProcessAction(ActionType action_type, |
| const std::string& extension_id, |
| const std::string& name, const GURL& gurl, |
| @@ -49,7 +47,15 @@ class FullStreamUIPolicy : public ActivityLogPolicy { |
| // Returns the actual key for a given key type |
| virtual std::string GetKey(ActivityLogPolicy::KeyType key_id) const OVERRIDE; |
| + virtual void Close() OVERRIDE; |
| + |
| protected: |
| + virtual ~FullStreamUIPolicy() {} |
| + |
| + // The ActivityPolicyCallbacks interface. |
| + virtual bool DatabaseInitCallback(sql::Connection* db) OVERRIDE; |
| + virtual void DatabaseCloseCallback() OVERRIDE; |
| + |
| // Concatenates arguments |
| virtual std::string ProcessArguments(ActionType action_type, |
| const std::string& name, |
| @@ -64,6 +70,14 @@ class FullStreamUIPolicy : public ActivityLogPolicy { |
| // the ActivityDatabase, we call its Close() method on the DB thread and it |
| // commits suicide. |
| ActivityDatabase* db_; |
| + |
| + private: |
| + friend class ActivityDatabaseTest; |
| + |
| + // Initializes the database tables. This is called by the ActivityDatabase, |
| + // on the database thread, after opening the database. Returns true on |
| + // success. |
| + static bool InitializeTables(sql::Connection* db); |
| }; |
| } // namespace extensions |