| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_FULLSTREAM_UI_POLICY_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_FULLSTREAM_UI_POLICY_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_FULLSTREAM_UI_POLICY_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_FULLSTREAM_UI_POLICY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 #include "chrome/browser/extensions/activity_log/activity_database.h" | 10 #include "chrome/browser/extensions/activity_log/activity_database.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 const int day, | 38 const int day, |
| 39 const base::Callback | 39 const base::Callback |
| 40 <void(scoped_ptr<std::vector<scoped_refptr<Action> > >)>& callback) | 40 <void(scoped_ptr<std::vector<scoped_refptr<Action> > >)>& callback) |
| 41 const OVERRIDE; | 41 const OVERRIDE; |
| 42 | 42 |
| 43 // Returns the actual key for a given key type | 43 // Returns the actual key for a given key type |
| 44 virtual std::string GetKey(ActivityLogPolicy::KeyType key_id) const OVERRIDE; | 44 virtual std::string GetKey(ActivityLogPolicy::KeyType key_id) const OVERRIDE; |
| 45 | 45 |
| 46 virtual void Close() OVERRIDE; | 46 virtual void Close() OVERRIDE; |
| 47 | 47 |
| 48 // Database table schema. |
| 49 static const char* kTableName; |
| 50 static const char* kTableContentFields[]; |
| 51 static const char* kTableFieldTypes[]; |
| 52 static const int kTableFieldCount; |
| 53 |
| 48 protected: | 54 protected: |
| 49 // Only ever run by OnDatabaseClose() below; see the comments on the | 55 // Only ever run by OnDatabaseClose() below; see the comments on the |
| 50 // ActivityDatabase class for an overall discussion of how cleanup works. | 56 // ActivityDatabase class for an overall discussion of how cleanup works. |
| 51 virtual ~FullStreamUIPolicy() {} | 57 virtual ~FullStreamUIPolicy() {} |
| 52 | 58 |
| 53 // The ActivityDatabase::PolicyDelegate interface. These are always called | 59 // The ActivityDatabase::PolicyDelegate interface. These are always called |
| 54 // from the database thread. | 60 // from the database thread. |
| 55 virtual bool OnDatabaseInit(sql::Connection* db) OVERRIDE; | 61 virtual bool OnDatabaseInit(sql::Connection* db) OVERRIDE; |
| 56 virtual void OnDatabaseClose() OVERRIDE; | 62 virtual void OnDatabaseClose() OVERRIDE; |
| 57 | 63 |
| 58 // Concatenates arguments | 64 // Strips arguments if needed by policy. |
| 59 virtual std::string ProcessArguments(ActionType action_type, | 65 virtual scoped_ptr<base::ListValue> ProcessArguments( |
| 60 const std::string& name, | 66 ActionType action_type, |
| 61 const base::ListValue* args) const; | 67 const std::string& name, |
| 68 const base::ListValue* args) const; |
| 69 |
| 70 // Concatenates arguments. |
| 71 virtual std::string JoinArguments(ActionType action_type, |
| 72 const std::string& name, |
| 73 const base::ListValue* args) const; |
| 62 | 74 |
| 63 virtual void ProcessWebRequestModifications( | 75 virtual void ProcessWebRequestModifications( |
| 64 base::DictionaryValue& details, | 76 base::DictionaryValue& details, |
| 65 std::string& details_string) const; | 77 std::string& details_string) const; |
| 66 | 78 |
| 67 // See the comments for the ActivityDatabase class for a discussion of how | 79 // See the comments for the ActivityDatabase class for a discussion of how |
| 68 // cleanup runs. | 80 // cleanup runs. |
| 69 ActivityDatabase* db_; | 81 ActivityDatabase* db_; |
| 70 }; | 82 }; |
| 71 | 83 |
| 72 } // namespace extensions | 84 } // namespace extensions |
| 73 | 85 |
| 74 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_FULLSTREAM_UI_POLICY_H_ | 86 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_FULLSTREAM_UI_POLICY_H_ |
| OLD | NEW |