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

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

Issue 773103004: Remove NOTIFICATION_HISTORY_URLS_DELETED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to tip Created 5 years, 11 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
« no previous file with comments | « chrome/browser/extensions/api/history/history_api.h ('k') | chrome/browser/favicon/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 37ca08ed639d707322bd19121b27153073e4989d..ec1c74876b7ace5978972f3e574891097ca2efc8 100644
--- a/chrome/browser/extensions/api/history/history_api.cc
+++ b/chrome/browser/extensions/api/history/history_api.cc
@@ -18,7 +18,6 @@
#include "base/task/cancelable_task_tracker.h"
#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/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
@@ -27,8 +26,6 @@
#include "chrome/common/extensions/api/history.h"
#include "chrome/common/pref_names.h"
#include "components/history/core/browser/history_types.h"
-#include "content/public/browser/notification_details.h"
-#include "content/public/browser/notification_source.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_system_provider.h"
#include "extensions/browser/extensions_browser_client.h"
@@ -135,24 +132,12 @@ HistoryEventRouter::HistoryEventRouter(Profile* profile,
HistoryService* history_service)
: profile_(profile), history_service_observer_(this) {
DCHECK(profile);
- registrar_.Add(this,
- chrome::NOTIFICATION_HISTORY_URLS_DELETED,
- content::Source<Profile>(profile));
history_service_observer_.Add(history_service);
}
HistoryEventRouter::~HistoryEventRouter() {
}
-void HistoryEventRouter::Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- DCHECK_EQ(type, chrome::NOTIFICATION_HISTORY_URLS_DELETED);
- HistoryUrlsRemoved(
- content::Source<Profile>(source).ptr(),
- content::Details<const history::URLsDeletedDetails>(details).ptr());
-}
-
void HistoryEventRouter::OnURLVisited(HistoryService* history_service,
ui::PageTransition transition,
const history::URLRow& row,
@@ -163,21 +148,22 @@ void HistoryEventRouter::OnURLVisited(HistoryService* history_service,
DispatchEvent(profile_, api::history::OnVisited::kEventName, args.Pass());
}
-void HistoryEventRouter::HistoryUrlsRemoved(
- Profile* profile,
- const history::URLsDeletedDetails* details) {
+void HistoryEventRouter::OnURLsDeleted(HistoryService* history_service,
+ bool all_history,
+ bool expired,
+ const history::URLRows& deleted_rows,
+ const std::set<GURL>& favicon_urls) {
OnVisitRemoved::Removed removed;
- removed.all_history = details->all_history;
+ removed.all_history = all_history;
std::vector<std::string>* urls = new std::vector<std::string>();
- for (history::URLRows::const_iterator iterator = details->rows.begin();
- iterator != details->rows.end(); ++iterator) {
- urls->push_back(iterator->url().spec());
- }
+ for (const auto& row : deleted_rows)
+ urls->push_back(row.url().spec());
removed.urls.reset(urls);
scoped_ptr<base::ListValue> args = OnVisitRemoved::Create(removed);
- DispatchEvent(profile, api::history::OnVisitRemoved::kEventName, args.Pass());
+ DispatchEvent(profile_, api::history::OnVisitRemoved::kEventName,
+ args.Pass());
}
void HistoryEventRouter::DispatchEvent(
« no previous file with comments | « chrome/browser/extensions/api/history/history_api.h ('k') | chrome/browser/favicon/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698