OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "base/logging.h" | 5 #include "base/logging.h" |
6 #include "base/stringprintf.h" | 6 #include "base/stringprintf.h" |
7 #include "chrome/browser/extensions/api_actions.h" | 7 #include "chrome/browser/extensions/api_actions.h" |
8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
9 | 9 |
10 using content::BrowserThread; | 10 using content::BrowserThread; |
11 | 11 |
12 namespace extensions { | 12 namespace extensions { |
13 | 13 |
14 const char* APIAction::kTableName = "activitylog_apis"; | 14 const char* APIAction::kTableName = "activitylog_apis"; |
15 const char* APIAction::kTableContentFields[] = | 15 const char* APIAction::kTableContentFields[] = |
16 {"api_type", "api_action_type", "target_type", "api_call", "args", "extra"}; | 16 {"api_type", "api_action_type", "target_type", "api_call", "args", "extra"}; |
17 | 17 |
| 18 // We should log the arguments to these API calls, even if argument logging is |
| 19 // disabled by default. |
| 20 const char* APIAction::kAlwaysLog[] = |
| 21 {"extension.connect", "extension.sendMessage", |
| 22 "tabs.executeScript", "tabs.insertCSS" }; |
| 23 const int APIAction::kSizeAlwaysLog = arraysize(kAlwaysLog); |
| 24 |
18 APIAction::APIAction(const std::string& extension_id, | 25 APIAction::APIAction(const std::string& extension_id, |
19 const base::Time& time, | 26 const base::Time& time, |
20 const Type type, | 27 const Type type, |
21 const Verb verb, | 28 const Verb verb, |
22 const Target target, | 29 const Target target, |
23 const std::string& api_call, | 30 const std::string& api_call, |
24 const std::string& args, | 31 const std::string& args, |
25 const std::string& extra) | 32 const std::string& extra) |
26 : Action(extension_id, time), | 33 : Action(extension_id, time), |
27 type_(type), | 34 type_(type), |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 } else if (str == "NOTIFICATION" || str == "notification") { | 191 } else if (str == "NOTIFICATION" || str == "notification") { |
185 return NOTIFICATION; | 192 return NOTIFICATION; |
186 } else if (str == "OMNIBOX" || str == "omnibox") { | 193 } else if (str == "OMNIBOX" || str == "omnibox") { |
187 return OMNIBOX; | 194 return OMNIBOX; |
188 } else { | 195 } else { |
189 return UNKNOWN_TARGET; | 196 return UNKNOWN_TARGET; |
190 } | 197 } |
191 } | 198 } |
192 | 199 |
193 } // namespace extensions | 200 } // namespace extensions |
OLD | NEW |