Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3327)

Unified Diff: chrome/browser/extensions/activity_log/activity_log.cc

Issue 21653002: Cleanups to the refactored extension activity log code (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix end-to-end test Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 e57a192fe5e62bbabaf6557b05dd9bb6b9f53615..717af5fa9ef048a41b4f7558967cf4e2776b589a 100644
--- a/chrome/browser/extensions/activity_log/activity_log.cc
+++ b/chrome/browser/extensions/activity_log/activity_log.cc
@@ -152,13 +152,22 @@ void LookupTabIds(scoped_refptr<extensions::Action> action, Profile* profile) {
}
} else if ((api_call == "tabs.move" || api_call == "tabs.remove") &&
args->GetList(0, &id_list)) {
+ // For APIs that take a list of tab IDs: translate all tab IDs into URLs
+ // in-place within the argument list, so all URLs are available when full
+ // logging is turned on. We can only extract one of the URLs into
+ // arg_url; arbitrarily take the first one.
for (int i = 0; i < static_cast<int>(id_list->GetSize()); ++i) {
if (id_list->GetInteger(i, &tab_id)) {
GURL url;
bool is_incognito;
if (GetUrlForTabId(tab_id, profile, &url, &is_incognito) &&
- !is_incognito)
+ !is_incognito) {
id_list->Set(i, new base::StringValue(url.spec()));
+ if (i == 0) {
+ action->set_arg_url(url);
+ action->set_arg_incognito(is_incognito);
+ }
+ }
} else {
LOG(ERROR) << "The tab ID array is malformed at index " << i;
}

Powered by Google App Engine
This is Rietveld 408576698