| 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_ACTIVITY_LOG_POLICY_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_POLICY_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_POLICY_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_POLICY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 explicit ActivityLogPolicy(Profile* profile); | 73 explicit ActivityLogPolicy(Profile* profile); |
| 74 | 74 |
| 75 // Instead of a public destructor, ActivityLogPolicy objects have a Close() | 75 // Instead of a public destructor, ActivityLogPolicy objects have a Close() |
| 76 // method which will cause the object to be deleted (but may do so on another | 76 // method which will cause the object to be deleted (but may do so on another |
| 77 // thread or in a deferred fashion). | 77 // thread or in a deferred fashion). |
| 78 virtual void Close() = 0; | 78 virtual void Close() = 0; |
| 79 | 79 |
| 80 // Updates the internal state of the model summarizing actions and possibly | 80 // Updates the internal state of the model summarizing actions and possibly |
| 81 // writes to the database. Implements the default policy storing internal | 81 // writes to the database. Implements the default policy storing internal |
| 82 // state to memory every 5 min. | 82 // state to memory every 5 min. |
| 83 virtual void ProcessAction( | 83 virtual void ProcessAction(scoped_refptr<Action> action) = 0; |
| 84 ActionType action_type, | |
| 85 const std::string& extension_id, | |
| 86 const std::string& name, // action name | |
| 87 const GURL& gurl, // target URL | |
| 88 const base::ListValue* args, // arguments | |
| 89 const base::DictionaryValue* details) = 0; // details | |
| 90 | 84 |
| 91 // Pass the parameters as a set of key-value pairs and return data back via | 85 // Pass the parameters as a set of key-value pairs and return data back via |
| 92 // a callback passing results as a set of key-value pairs. The keys are | 86 // a callback passing results as a set of key-value pairs. The keys are |
| 93 // policy-specific. | 87 // policy-specific. |
| 94 virtual void ReadData( | 88 virtual void ReadData( |
| 95 const base::DictionaryValue& parameters, | 89 const base::DictionaryValue& parameters, |
| 96 const base::Callback | 90 const base::Callback |
| 97 <void(scoped_ptr<base::DictionaryValue>)>& callback) const {} | 91 <void(scoped_ptr<base::DictionaryValue>)>& callback) const {} |
| 98 | 92 |
| 99 // TODO(felt,dbabic) This is overly specific to the current implementation | 93 // TODO(felt,dbabic) This is overly specific to the current implementation |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 137 |
| 144 base::FilePath profile_base_path_; | 138 base::FilePath profile_base_path_; |
| 145 | 139 |
| 146 private: | 140 private: |
| 147 DISALLOW_COPY_AND_ASSIGN(ActivityLogPolicy); | 141 DISALLOW_COPY_AND_ASSIGN(ActivityLogPolicy); |
| 148 }; | 142 }; |
| 149 | 143 |
| 150 } // namespace extensions | 144 } // namespace extensions |
| 151 | 145 |
| 152 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_POLICY_H_ | 146 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_POLICY_H_ |
| OLD | NEW |