| Index: chrome/browser/sync/glue/typed_url_change_processor.h
|
| diff --git a/chrome/browser/sync/glue/typed_url_change_processor.h b/chrome/browser/sync/glue/typed_url_change_processor.h
|
| index 46cdf5fc38491f557214779c213a9c66ae0994ae..f77294bbb98e27f984750f50658cb8138369cbe0 100644
|
| --- a/chrome/browser/sync/glue/typed_url_change_processor.h
|
| +++ b/chrome/browser/sync/glue/typed_url_change_processor.h
|
| @@ -12,6 +12,7 @@
|
| #include "base/memory/scoped_ptr.h"
|
| #include "chrome/browser/sync/glue/sync_backend_host.h"
|
| #include "chrome/browser/sync/glue/typed_url_model_associator.h"
|
| +#include "components/history/core/browser/history_backend_observer.h"
|
| #include "components/sync_driver/data_type_error_handler.h"
|
| #include "content/public/browser/notification_observer.h"
|
| #include "content/public/browser/notification_registrar.h"
|
| @@ -43,7 +44,8 @@ class DataTypeErrorHandler;
|
| // applying them to the sync API 'syncable' model, and vice versa. All
|
| // operations and use of this class are from the UI thread.
|
| class TypedUrlChangeProcessor : public sync_driver::ChangeProcessor,
|
| - public content::NotificationObserver {
|
| + public content::NotificationObserver,
|
| + public history::HistoryBackendObserver {
|
| public:
|
| TypedUrlChangeProcessor(Profile* profile,
|
| TypedUrlModelAssociator* model_associator,
|
| @@ -57,6 +59,13 @@ class TypedUrlChangeProcessor : public sync_driver::ChangeProcessor,
|
| const content::NotificationSource& source,
|
| const content::NotificationDetails& details) override;
|
|
|
| + // history::HistoryBackendObserver:
|
| + virtual void OnURLVisited(history::HistoryBackend* history_backend,
|
| + ui::PageTransition transition,
|
| + const history::URLRow& row,
|
| + const history::RedirectList& redirects,
|
| + base::Time visit_time) override;
|
| +
|
| // sync API model -> WebDataService change application.
|
| virtual void ApplyChangesFromSyncModel(
|
| const syncer::BaseTransaction* trans,
|
| @@ -80,13 +89,12 @@ class TypedUrlChangeProcessor : public sync_driver::ChangeProcessor,
|
|
|
| void HandleURLsModified(history::URLsModifiedDetails* details);
|
| void HandleURLsDeleted(history::URLsDeletedDetails* details);
|
| - void HandleURLsVisited(history::URLVisitedDetails* details);
|
|
|
| // Returns true if the caller should sync as a result of the passed visit
|
| // notification. We use this to throttle the number of sync changes we send
|
| // to the server so we don't hit the server for every
|
| // single typed URL visit.
|
| - bool ShouldSyncVisit(history::URLVisitedDetails* details);
|
| + bool ShouldSyncVisit(int typed_count, ui::PageTransition transition);
|
|
|
| // Utility routine that either updates an existing sync node or creates a
|
| // new one for the passed |typed_url| if one does not already exist. Returns
|
|
|