| Index: chrome/browser/extensions/activity_log/activity_log.cc
|
| diff --git a/chrome/browser/extensions/activity_log/activity_log.cc b/chrome/browser/extensions/activity_log/activity_log.cc
|
| index 994d3e20263170e0f3f3cad13a76d9eb4a3dc78c..3331c61a627ffe5caea0e9dc69030bc7170396cb 100644
|
| --- a/chrome/browser/extensions/activity_log/activity_log.cc
|
| +++ b/chrome/browser/extensions/activity_log/activity_log.cc
|
| @@ -317,17 +317,20 @@ void ActivityLog::LogBlockedAction(const Extension* extension,
|
| LOG(INFO) << action->PrintForDebug();
|
| }
|
|
|
| -void ActivityLog::LogDOMActionInternal(const Extension* extension,
|
| - const GURL& url,
|
| - const string16& url_title,
|
| - const std::string& api_call,
|
| - const ListValue* args,
|
| - const std::string& extra,
|
| - DOMAction::DOMActionType verb) {
|
| +void ActivityLog::LogDOMAction(const Extension* extension,
|
| + const GURL& url,
|
| + const string16& url_title,
|
| + const std::string& api_call,
|
| + const ListValue* args,
|
| + DOMAction::DOMActionType call_type,
|
| + const std::string& extra) {
|
| + if (!IsLogEnabled()) return;
|
| + if (call_type == DOMAction::METHOD && api_call == "XMLHttpRequest.open")
|
| + call_type = DOMAction::XHR;
|
| scoped_refptr<DOMAction> action = new DOMAction(
|
| extension->id(),
|
| base::Time::Now(),
|
| - verb,
|
| + call_type,
|
| url,
|
| url_title,
|
| api_call,
|
| @@ -340,7 +343,7 @@ void ActivityLog::LogDOMActionInternal(const Extension* extension,
|
| if (iter != observers_.end()) {
|
| // TODO(felt): This is a kludge, planning to update this when new
|
| // UI is in place.
|
| - if (verb == DOMAction::INSERTED) {
|
| + if (call_type == DOMAction::INSERTED) {
|
| iter->second->Notify(&Observer::OnExtensionActivity,
|
| extension,
|
| ActivityLog::ACTIVITY_CONTENT_SCRIPT,
|
| @@ -356,33 +359,6 @@ void ActivityLog::LogDOMActionInternal(const Extension* extension,
|
| LOG(INFO) << action->PrintForDebug();
|
| }
|
|
|
| -void ActivityLog::LogDOMAction(const Extension* extension,
|
| - const GURL& url,
|
| - const string16& url_title,
|
| - const std::string& api_call,
|
| - const ListValue* args,
|
| - const std::string& extra) {
|
| - if (!IsLogEnabled()) return;
|
| - DOMAction::DOMActionType action = DOMAction::MODIFIED;
|
| - if (extra == "Getter") {
|
| - action = DOMAction::GETTER;
|
| - } else if (extra == "Setter") {
|
| - action = DOMAction::SETTER;
|
| - } else if (api_call == "XMLHttpRequest.open") {
|
| - // Has to come before the Method check because XHR is also a Method.
|
| - action = DOMAction::XHR;
|
| - } else if (extra == "Method") {
|
| - action = DOMAction::METHOD;
|
| - }
|
| - LogDOMActionInternal(extension,
|
| - url,
|
| - url_title,
|
| - api_call,
|
| - args,
|
| - extra,
|
| - action);
|
| -}
|
| -
|
| void ActivityLog::LogWebRequestAction(const Extension* extension,
|
| const GURL& url,
|
| const std::string& api_call,
|
| @@ -473,13 +449,13 @@ void ActivityLog::OnScriptsExecuted(
|
| }
|
| scoped_ptr<ListValue> script_names(new ListValue());
|
| script_names->Set(0, new StringValue(ext_scripts_str));
|
| - LogDOMActionInternal(extension,
|
| - on_url,
|
| - web_contents->GetTitle(),
|
| - std::string(), // no api call here
|
| - script_names.get(),
|
| - std::string(), // no extras either
|
| - DOMAction::INSERTED);
|
| + LogDOMAction(extension,
|
| + on_url,
|
| + web_contents->GetTitle(),
|
| + std::string(), // no api call here
|
| + script_names.get(),
|
| + DOMAction::INSERTED,
|
| + std::string()); // no extras either
|
| }
|
| }
|
| }
|
|
|