Chromium Code Reviews| Index: chrome/browser/renderer_host/chrome_render_message_filter.cc |
| diff --git a/chrome/browser/renderer_host/chrome_render_message_filter.cc b/chrome/browser/renderer_host/chrome_render_message_filter.cc |
| index 56806a6a125c8688c275ed17da0686f9eab6b429..a6382fbdd26606449d5c59459fa70be8cd8efbb7 100644 |
| --- a/chrome/browser/renderer_host/chrome_render_message_filter.cc |
| +++ b/chrome/browser/renderer_host/chrome_render_message_filter.cc |
| @@ -58,6 +58,11 @@ void AddActionToExtensionActivityLog( |
| BrowserThread::UI, FROM_HERE, |
| base::Bind(&AddActionToExtensionActivityLog, profile, action)); |
| } else { |
| + // If the action included a URL, check whether it for an incognito profile. |
|
James Hawkins
2013/08/02 19:19:10
nit: "it is for"
mvrable
2013/08/02 19:57:09
Done.
|
| + // The check is performed here so that it can safely be done from the UI |
| + // thread. |
| + if (action->page_url().is_valid() || !action->page_title().empty()) |
| + action->set_page_incognito(profile->IsOffTheRecord()); |
| extensions::ActivityLog* activity_log = |
| extensions::ActivityLog::GetInstance(profile); |
| activity_log->LogAction(action); |
| @@ -517,23 +522,12 @@ void ChromeRenderMessageFilter::OnAddAPIActionToExtensionActivityLog( |
| void ChromeRenderMessageFilter::OnAddDOMActionToExtensionActivityLog( |
| const std::string& extension_id, |
| const ExtensionHostMsg_DOMAction_Params& params) { |
| - extensions::Action::ActionType type; |
| - switch (params.call_type) { |
| - case extensions::DomActionType::INSERTED: |
| - type = extensions::Action::ACTION_CONTENT_SCRIPT; |
| - break; |
| - case extensions::DomActionType::XHR: |
| - type = extensions::Action::ACTION_DOM_XHR; |
| - break; |
| - default: |
| - type = extensions::Action::ACTION_DOM_ACCESS; |
| - break; |
| - } |
| - |
| scoped_refptr<extensions::Action> action = new extensions::Action( |
| - extension_id, base::Time::Now(), type, params.api_call); |
| + extension_id, base::Time::Now(), extensions::Action::ACTION_DOM_ACCESS, |
| + params.api_call); |
| action->set_args(make_scoped_ptr(params.arguments.DeepCopy())); |
| - // TODO(mvrable): Check for incognito pages |
| + // Whether the URLs are incognito is checked in |
|
James Hawkins
2013/08/02 19:19:10
Optional nit: Remove this comment, since it can ea
mvrable
2013/08/02 19:57:09
Done.
|
| + // AddActionToExtensionActivityLog by inspecting the profile. |
| action->set_page_url(params.url); |
| action->set_page_title(base::UTF16ToUTF8(params.url_title)); |
| action->mutable_other()->SetInteger(activity_log_constants::kActionDomVerb, |