| Index: chrome/browser/history/history_service.cc
|
| diff --git a/chrome/browser/history/history_service.cc b/chrome/browser/history/history_service.cc
|
| index 97142cf029e48095117553e0f85b24b7b32e2d25..5ff36437ebfc32d5c4512d4155ba5bd98130c74f 100644
|
| --- a/chrome/browser/history/history_service.cc
|
| +++ b/chrome/browser/history/history_service.cc
|
| @@ -50,7 +50,6 @@
|
| #include "chrome/common/url_constants.h"
|
| #include "components/dom_distiller/core/url_constants.h"
|
| #include "components/history/core/browser/history_client.h"
|
| -#include "components/history/core/browser/history_service_observer.h"
|
| #include "components/history/core/browser/history_types.h"
|
| #include "components/history/core/browser/in_memory_database.h"
|
| #include "components/history/core/browser/keyword_search_term.h"
|
| @@ -180,6 +179,12 @@ class HistoryService::BackendDelegate : public HistoryBackend::Delegate {
|
| visit_time));
|
| }
|
|
|
| + virtual void NotifyAddVisit(const history::BriefVisitInfo& info) OVERRIDE {
|
| + service_task_runner_->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(&HistoryService::NotifyAddVisit, history_service_, info));
|
| + }
|
| +
|
| virtual void BroadcastNotifications(
|
| int type,
|
| scoped_ptr<history::HistoryDetails> details) OVERRIDE {
|
| @@ -202,14 +207,6 @@ class HistoryService::BackendDelegate : public HistoryBackend::Delegate {
|
| base::Bind(&HistoryService::OnDBLoaded, history_service_));
|
| }
|
|
|
| - virtual void NotifyVisitDBObserversOnAddVisit(
|
| - const history::BriefVisitInfo& info) OVERRIDE {
|
| - service_task_runner_->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(&HistoryService::NotifyVisitDBObserversOnAddVisit,
|
| - history_service_, info));
|
| - }
|
| -
|
| private:
|
| const base::WeakPtr<HistoryService> history_service_;
|
| const scoped_refptr<base::SequencedTaskRunner> service_task_runner_;
|
| @@ -348,14 +345,12 @@ void HistoryService::URLsNoLongerBookmarked(const std::set<GURL>& urls) {
|
| urls);
|
| }
|
|
|
| -void HistoryService::AddHistoryServiceObserver(
|
| - history::HistoryServiceObserver* observer) {
|
| - history_service_observers_.AddObserver(observer);
|
| +void HistoryService::AddObserver(Observer* observer) {
|
| + observers_.AddObserver(observer);
|
| }
|
|
|
| -void HistoryService::RemoveHistoryServiceObserver(
|
| - history::HistoryServiceObserver* observer) {
|
| - history_service_observers_.RemoveObserver(observer);
|
| +void HistoryService::RemoveObserver(Observer* observer) {
|
| + observers_.RemoveObserver(observer);
|
| }
|
|
|
| void HistoryService::ScheduleDBTask(scoped_ptr<history::HistoryDBTask> task,
|
| @@ -1250,28 +1245,14 @@ void HistoryService::NotifyURLVisited(ui::PageTransition transition,
|
| const history::RedirectList& redirects,
|
| base::Time visit_time) {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| - FOR_EACH_OBSERVER(history::HistoryServiceObserver,
|
| - history_service_observers_,
|
| + FOR_EACH_OBSERVER(HistoryService::Observer,
|
| + observers_,
|
| OnURLVisited(transition, row, redirects, visit_time));
|
| }
|
|
|
| -void HistoryService::AddVisitDatabaseObserver(
|
| - history::VisitDatabaseObserver* observer) {
|
| - DCHECK(thread_checker_.CalledOnValidThread());
|
| - visit_database_observers_.AddObserver(observer);
|
| -}
|
| -
|
| -void HistoryService::RemoveVisitDatabaseObserver(
|
| - history::VisitDatabaseObserver* observer) {
|
| - DCHECK(thread_checker_.CalledOnValidThread());
|
| - visit_database_observers_.RemoveObserver(observer);
|
| -}
|
| -
|
| -void HistoryService::NotifyVisitDBObserversOnAddVisit(
|
| - const history::BriefVisitInfo& info) {
|
| +void HistoryService::NotifyAddVisit(const history::BriefVisitInfo& info) {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| - FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_,
|
| - OnAddVisit(info));
|
| + FOR_EACH_OBSERVER(HistoryService::Observer, observers_, OnAddVisit(info));
|
| }
|
|
|
| scoped_ptr<base::CallbackList<void(const std::set<GURL>&)>::Subscription>
|
|
|