Chromium Code Reviews| Index: components/history/core/browser/history_service_observer.h |
| diff --git a/components/history/core/browser/history_service_observer.h b/components/history/core/browser/history_service_observer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f19d6651e752520e66ac95b85fbddd8081611d7e |
| --- /dev/null |
| +++ b/components/history/core/browser/history_service_observer.h |
| @@ -0,0 +1,37 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_OBSERVER_H_ |
| +#define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_OBSERVER_H_ |
| + |
| +#include "components/history/core/browser/history_types.h" |
| +#include "ui/base/page_transition_types.h" |
| + |
| +namespace base { |
| +class Time; |
| +} |
| + |
| +namespace history { |
| + |
| +class HistoryServiceObserver { |
|
blundell
2014/10/08 09:59:13
Nit: I prefer the pattern of HistoryService::Obser
sdefresne
2014/10/09 09:38:15
As discussed offline, will do this in a followup C
|
| + public: |
| + HistoryServiceObserver(); |
| + virtual ~HistoryServiceObserver(); |
| + |
| + // Called when user visits an URL. |
| + // |
| + // The |row| ID will be set to the value that is currently in effect in the |
| + // main history database. |redirects| is the list of redirects leading up to |
| + // the URL. If we have a redirect chain A -> B -> C and user is visiting C, |
| + // then |redirects[0]=B| and |redirects[1]=A|. If there are no redirects, |
| + // |redirects| is an empty vector. |
| + virtual void OnURLVisited(ui::PageTransition transition, |
| + const URLRow& row, |
| + const RedirectList& redirects, |
| + const base::Time& visit_time) = 0; |
| +}; |
| + |
| +} // namespace history |
| + |
| +#endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_OBSERVER_H_ |