| 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 | |
| 25 APIAction::APIAction(const std::string& extension_id, | 18 APIAction::APIAction(const std::string& extension_id, |
| 26 const base::Time& time, | 19 const base::Time& time, |
| 27 const Type type, | 20 const Type type, |
| 28 const Verb verb, | 21 const Verb verb, |
| 29 const Target target, | 22 const Target target, |
| 30 const std::string& api_call, | 23 const std::string& api_call, |
| 31 const std::string& args, | 24 const std::string& args, |
| 32 const std::string& extra) | 25 const std::string& extra) |
| 33 : Action(extension_id, time), | 26 : Action(extension_id, time), |
| 34 type_(type), | 27 type_(type), |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 } else if (str == "NOTIFICATION" || str == "notification") { | 184 } else if (str == "NOTIFICATION" || str == "notification") { |
| 192 return NOTIFICATION; | 185 return NOTIFICATION; |
| 193 } else if (str == "OMNIBOX" || str == "omnibox") { | 186 } else if (str == "OMNIBOX" || str == "omnibox") { |
| 194 return OMNIBOX; | 187 return OMNIBOX; |
| 195 } else { | 188 } else { |
| 196 return UNKNOWN_TARGET; | 189 return UNKNOWN_TARGET; |
| 197 } | 190 } |
| 198 } | 191 } |
| 199 | 192 |
| 200 } // namespace extensions | 193 } // namespace extensions |
| OLD | NEW |