Index: chrome/browser/history/history_service.cc |
diff --git a/chrome/browser/history/history_service.cc b/chrome/browser/history/history_service.cc |
index 0ad19e33dbde2a2bb9479b118d0eef2d10e42b77..f6af36a22c6a66da88b96c9794c1070a2a5aa53b 100644 |
--- a/chrome/browser/history/history_service.cc |
+++ b/chrome/browser/history/history_service.cc |
@@ -37,6 +37,7 @@ |
#include "chrome/browser/bookmarks/bookmark_model_factory.h" |
#include "chrome/browser/browser_process.h" |
#include "chrome/browser/chrome_notification_types.h" |
+#include "chrome/browser/extensions/activity_log/activity_log.h" |
#include "chrome/browser/history/download_row.h" |
#include "chrome/browser/history/history_backend.h" |
#include "chrome/browser/history/history_notifications.h" |
@@ -67,6 +68,7 @@ |
#include "third_party/skia/include/core/SkBitmap.h" |
using base::Time; |
+using extensions::ActivityLog; |
using history::HistoryBackend; |
namespace { |
@@ -1075,6 +1077,12 @@ void HistoryService::DeleteURL(const GURL& url) { |
DCHECK(thread_checker_.CalledOnValidThread()); |
// We will update the visited links when we observe the delete notifications. |
ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::DeleteURL, url); |
+ |
+ // Also clean up this url from the activity log database. |
+ ActivityLog* activity_log = ActivityLog::GetInstance(profile_); |
+ if (activity_log) { |
+ activity_log->RemoveURL(url); |
+ } |
} |
void HistoryService::DeleteURLsForTest(const std::vector<GURL>& urls) { |
@@ -1082,6 +1090,12 @@ void HistoryService::DeleteURLsForTest(const std::vector<GURL>& urls) { |
// We will update the visited links when we observe the delete |
// notifications. |
ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::DeleteURLs, urls); |
+ |
+ // Also clean up these urls from the activity log database. |
+ ActivityLog* activity_log = ActivityLog::GetInstance(profile_); |
+ if (activity_log) { |
+ activity_log->RemoveURLs(urls); |
+ } |
} |
void HistoryService::ExpireHistoryBetween( |
@@ -1101,6 +1115,12 @@ void HistoryService::ExpireHistoryBetween( |
begin_time, |
end_time), |
callback); |
+ |
+ // Also clean up these urls from the activity log database. |
+ ActivityLog* activity_log = ActivityLog::GetInstance(profile_); |
+ if (activity_log) { |
+ activity_log->RemoveURLs(restrict_urls); |
+ } |
} |
void HistoryService::ExpireHistory( |
@@ -1115,6 +1135,15 @@ void HistoryService::ExpireHistory( |
FROM_HERE, |
base::Bind(&HistoryBackend::ExpireHistory, history_backend_, expire_list), |
callback); |
+ |
+ // Also remove the URLs from the activity log database. |
+ ActivityLog* activity_log = ActivityLog::GetInstance(profile_); |
+ if (activity_log) { |
+ for (std::vector<history::ExpireHistoryArgs>::const_iterator it = |
+ expire_list.begin(); it != expire_list.end(); ++it) { |
+ activity_log->RemoveURLs(it->urls); |
+ } |
+ } |
} |
void HistoryService::ExpireLocalAndRemoteHistoryBetween( |