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

Unified Diff: chrome/browser/history/history_service.cc

Issue 18878009: Add functions to clean URLs from the activity log (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added counting policy Created 7 years, 4 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/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(
« chrome/browser/extensions/activity_log/fullstream_ui_policy.cc ('K') | « chrome/browser/history/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698