| Index: chrome/browser/extensions/activity_log.cc
|
| diff --git a/chrome/browser/extensions/activity_log.cc b/chrome/browser/extensions/activity_log.cc
|
| index afdaa83dae8bfee8917fcbd6bada01b53f920c0c..5d806d1897aa21855d73717f2eff8a0b5d13088f 100644
|
| --- a/chrome/browser/extensions/activity_log.cc
|
| +++ b/chrome/browser/extensions/activity_log.cc
|
| @@ -161,6 +161,7 @@ void ActivityLog::LogAPIAction(const Extension* extension,
|
| scoped_refptr<APIAction> action = new APIAction(
|
| extension->id(),
|
| base::Time::Now(),
|
| + APIAction::CALL,
|
| APIAction::StringAsActionType(verb),
|
| APIAction::StringAsTargetType(manager),
|
| call_signature,
|
| @@ -175,6 +176,40 @@ void ActivityLog::LogAPIAction(const Extension* extension,
|
| ActivityLog::ACTIVITY_EXTENSION_API_CALL,
|
| call_signature);
|
| }
|
| + if (log_activity_to_stdout_) {
|
| + LOG(INFO) << action->PrettyPrintForDebug();
|
| + }
|
| + } else {
|
| + LOG(ERROR) << "Unknown API call! " << name;
|
| + }
|
| +}
|
| +
|
| +void ActivityLog::LogEventAction(const Extension* extension,
|
| + const std::string& name,
|
| + const ListValue* args,
|
| + const std::string& extra) {
|
| + std::string verb, manager;
|
| + bool matches = RE2::FullMatch(name, "(.*?)\\.(.*)", &manager, &verb);
|
| + if (matches) {
|
| + std::string call_signature = MakeCallSignature(name, args);
|
| + scoped_refptr<APIAction> action = new APIAction(
|
| + extension->id(),
|
| + base::Time::Now(),
|
| + APIAction::EVENT_CALLBACK,
|
| + APIAction::StringAsActionType(verb),
|
| + APIAction::StringAsTargetType(manager),
|
| + call_signature,
|
| + extra);
|
| + ScheduleAndForget(&ActivityDatabase::RecordAction, action);
|
| +
|
| + // Display the action.
|
| + ObserverMap::const_iterator iter = observers_.find(extension);
|
| + if (iter != observers_.end()) {
|
| + iter->second->Notify(&Observer::OnExtensionActivity,
|
| + extension,
|
| + ActivityLog::ACTIVITY_EVENT_DISPATCH,
|
| + call_signature);
|
| + }
|
| if (log_activity_to_stdout_)
|
| LOG(INFO) << action->PrettyPrintForDebug();
|
| } else {
|
| @@ -289,6 +324,8 @@ const char* ActivityLog::ActivityToString(Activity activity) {
|
| return "api_block";
|
| case ActivityLog::ACTIVITY_CONTENT_SCRIPT:
|
| return "content_script";
|
| + case ActivityLog::ACTIVITY_EVENT_DISPATCH:
|
| + return "event_dispatch";
|
| default:
|
| NOTREACHED();
|
| return "";
|
|
|