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

Unified Diff: chrome/browser/extensions/api/history/history_api.cc

Issue 23785002: Clean up activity log URLs when history is cleaned. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix line Created 7 years, 3 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/api/history/history_api.cc
diff --git a/chrome/browser/extensions/api/history/history_api.cc b/chrome/browser/extensions/api/history/history_api.cc
index e387b4f417935db2918ece5a031a515c18ea3788..4c74878696595817ce397e7a3412764ae37f69ad 100644
--- a/chrome/browser/extensions/api/history/history_api.cc
+++ b/chrome/browser/extensions/api/history/history_api.cc
@@ -17,6 +17,7 @@
#include "base/time/time.h"
#include "base/values.h"
#include "chrome/browser/chrome_notification_types.h"
+#include "chrome/browser/extensions/activity_log/activity_log.h"
#include "chrome/browser/extensions/event_router.h"
#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/history/history_service.h"
@@ -36,6 +37,7 @@ namespace extensions {
using api::experimental_history::MostVisitedItem;
using api::history::HistoryItem;
using api::history::VisitItem;
+using extensions::ActivityLog;
typedef std::vector<linked_ptr<api::history::HistoryItem> >
HistoryItemList;
@@ -444,6 +446,12 @@ bool HistoryDeleteUrlFunction::RunImpl() {
Profile::EXPLICIT_ACCESS);
hs->DeleteURL(url);
+ // Also clean out from the activity log.
felt 2013/09/03 23:03:46 the activity log api needed to declare its depende
+ ActivityLog* activity_log = ActivityLog::GetInstance(profile_);
+ if (activity_log) {
+ activity_log->RemoveURL(url);
+ }
+
SendResponse(true);
return true;
}
@@ -470,6 +478,12 @@ bool HistoryDeleteRangeFunction::RunAsyncImpl() {
base::Unretained(this)),
&task_tracker_);
+ // Also clean from the activity log.
+ ActivityLog* activity_log = ActivityLog::GetInstance(profile());
+ if (activity_log) {
+ activity_log->RemoveURLs(restrict_urls);
+ }
+
return true;
}
@@ -493,6 +507,11 @@ bool HistoryDeleteAllFunction::RunAsyncImpl() {
base::Unretained(this)),
&task_tracker_);
+ // Also clean up from the activity log.
+ ActivityLog* activity_log = ActivityLog::GetInstance(profile());
+ if (activity_log) {
+ activity_log->RemoveURLs(restrict_urls);
+ }
return true;
}

Powered by Google App Engine
This is Rietveld 408576698