diff options
Diffstat (limited to 'chrome/browser/extensions/api/history/history_api.cc')
-rw-r--r-- | chrome/browser/extensions/api/history/history_api.cc | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/chrome/browser/extensions/api/history/history_api.cc b/chrome/browser/extensions/api/history/history_api.cc index 37ca08e..ec1c748 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( |