Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: chrome/browser/android/history_report/data_observer.h

Issue 1141283003: Upstream oodles of Chrome for Android code into Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: final patch? Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_ANDROID_HISTORY_REPORT_DATA_OBSERVER_H_
6 #define CHROME_BROWSER_ANDROID_HISTORY_REPORT_DATA_OBSERVER_H_
7
8 #include <string>
9
10 #include "base/callback.h"
11 #include "base/time/time.h"
12 #include "components/bookmarks/browser/bookmark_model_observer.h"
13 #include "components/history/core/browser/history_service_observer.h"
14 #include "components/history/core/browser/history_types.h"
15 #include "components/history/core/browser/url_row.h"
16
17 namespace history {
18
19 class HistoryService;
20 }
21
22 namespace history_report {
23
24 class DeltaFileService;
25 class UsageReportsBufferService;
26
27 // Observes history data for changes and updates delta file accordingly.
28 class DataObserver : public bookmarks::BookmarkModelObserver,
29 public history::HistoryServiceObserver {
30 public:
31 DataObserver(base::Callback<void(void)> data_changed_callback,
32 base::Callback<void(void)> data_cleared_callback,
33 base::Callback<void(void)> stop_reporting_callback,
34 DeltaFileService* delta_file_service,
35 UsageReportsBufferService* usage_reports_buffer_service,
36 bookmarks::BookmarkModel* bookmark_model,
37 history::HistoryService* history_service);
38 ~DataObserver() override;
39
40 // BookmarkModelObserver implementation.
41 void BookmarkModelLoaded(bookmarks::BookmarkModel* model,
42 bool ids_reassigned) override;
43 void BookmarkModelBeingDeleted(bookmarks::BookmarkModel* model) override;
44 void BookmarkNodeMoved(bookmarks::BookmarkModel* model,
45 const bookmarks::BookmarkNode* old_parent,
46 int old_index,
47 const bookmarks::BookmarkNode* new_parent,
48 int new_index) override;
49 void BookmarkNodeAdded(bookmarks::BookmarkModel* model,
50 const bookmarks::BookmarkNode* parent,
51 int index) override;
52 void BookmarkNodeRemoved(bookmarks::BookmarkModel* model,
53 const bookmarks::BookmarkNode* parent,
54 int old_index,
55 const bookmarks::BookmarkNode* node,
56 const std::set<GURL>& removed_urls) override;
57 void BookmarkAllUserNodesRemoved(
58 bookmarks::BookmarkModel* model,
59 const std::set<GURL>& removed_urls) override;
60 void BookmarkNodeChanged(bookmarks::BookmarkModel* model,
61 const bookmarks::BookmarkNode* node) override;
62 void BookmarkNodeFaviconChanged(bookmarks::BookmarkModel* model,
63 const bookmarks::BookmarkNode* node) override;
64 void BookmarkNodeChildrenReordered(
65 bookmarks::BookmarkModel* model,
66 const bookmarks::BookmarkNode* node) override;
67
68 // HistoryServiceObserver implementation.
69 void OnURLVisited(history::HistoryService* history_service,
70 ui::PageTransition transition,
71 const history::URLRow& row,
72 const history::RedirectList& redirects,
73 base::Time visit_time) override;
74 void OnURLsModified(history::HistoryService* history_service,
75 const history::URLRows& changed_urls) override;
76 void OnURLsDeleted(history::HistoryService* history_service,
77 bool all_history,
78 bool expired,
79 const history::URLRows& deleted_rows,
80 const std::set<GURL>& favicon_urls) override;
81
82 private:
83 void DeleteBookmarks(const std::set<GURL>& removed_urls);
84
85 base::Callback<void(void)> data_changed_callback_;
86 base::Callback<void(void)> data_cleared_callback_;
87 base::Callback<void(void)> stop_reporting_callback_;
88 DeltaFileService* delta_file_service_;
89 UsageReportsBufferService* usage_reports_buffer_service_;
90
91 DISALLOW_COPY_AND_ASSIGN(DataObserver);
92 };
93
94 } // namespace history_report
95
96 #endif // CHROME_BROWSER_ANDROID_HISTORY_REPORT_DATA_OBSERVER_H_
OLDNEW
« no previous file with comments | « chrome/browser/android/history_report/OWNERS ('k') | chrome/browser/android/history_report/data_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698