OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_HISTORY_CONTENT_VISIT_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_HISTORY_CONTENT_VISIT_DELEGATE_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/task/cancelable_task_tracker.h" |
| 13 #include "components/history/core/browser/visit_delegate.h" |
| 14 #include "components/visitedlink/browser/visitedlink_delegate.h" |
| 15 |
| 16 namespace content { |
| 17 class BrowserContext; |
| 18 } |
| 19 |
| 20 namespace visitedlink { |
| 21 class VisitedLinkMaster; |
| 22 } |
| 23 |
| 24 // ContentVisitDelegate bridge history::VisitDelegate events to |
| 25 // visitedlink::VisitedLinkMaster. |
| 26 class ContentVisitDelegate : public history::VisitDelegate, |
| 27 public visitedlink::VisitedLinkDelegate { |
| 28 public: |
| 29 explicit ContentVisitDelegate(content::BrowserContext* browser_context); |
| 30 ~ContentVisitDelegate() override; |
| 31 |
| 32 private: |
| 33 // Implementation of history::VisitDelegate. |
| 34 bool Init(HistoryService* history_service) override; |
| 35 void AddURL(const GURL& url) override; |
| 36 void AddURLs(const std::vector<GURL>& urls) override; |
| 37 void DeleteURLs(const std::vector<GURL>& urls) override; |
| 38 void DeleteAllURLs() override; |
| 39 |
| 40 // Implementation of visitedlink::VisitedLinkDelegate. |
| 41 void RebuildTable(const scoped_refptr< |
| 42 visitedlink::VisitedLinkDelegate::URLEnumerator>& enumerator) override; |
| 43 |
| 44 HistoryService* history_service_; // Weak. |
| 45 scoped_ptr<visitedlink::VisitedLinkMaster> visitedlink_master_; |
| 46 base::CancelableTaskTracker task_tracker_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(ContentVisitDelegate); |
| 49 }; |
| 50 |
| 51 #endif // CHROME_BROWSER_HISTORY_CONTENT_VISIT_DELEGATE_H_ |
OLD | NEW |