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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/history_report/data_observer.h
diff --git a/chrome/browser/android/history_report/data_observer.h b/chrome/browser/android/history_report/data_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..37863357dce440c12f86e2453aff67c323696349
--- /dev/null
+++ b/chrome/browser/android/history_report/data_observer.h
@@ -0,0 +1,96 @@
+// Copyright 2015 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 CHROME_BROWSER_ANDROID_HISTORY_REPORT_DATA_OBSERVER_H_
+#define CHROME_BROWSER_ANDROID_HISTORY_REPORT_DATA_OBSERVER_H_
+
+#include <string>
+
+#include "base/callback.h"
+#include "base/time/time.h"
+#include "components/bookmarks/browser/bookmark_model_observer.h"
+#include "components/history/core/browser/history_service_observer.h"
+#include "components/history/core/browser/history_types.h"
+#include "components/history/core/browser/url_row.h"
+
+namespace history {
+
+class HistoryService;
+}
+
+namespace history_report {
+
+class DeltaFileService;
+class UsageReportsBufferService;
+
+// Observes history data for changes and updates delta file accordingly.
+class DataObserver : public bookmarks::BookmarkModelObserver,
+ public history::HistoryServiceObserver {
+ public:
+ DataObserver(base::Callback<void(void)> data_changed_callback,
+ base::Callback<void(void)> data_cleared_callback,
+ base::Callback<void(void)> stop_reporting_callback,
+ DeltaFileService* delta_file_service,
+ UsageReportsBufferService* usage_reports_buffer_service,
+ bookmarks::BookmarkModel* bookmark_model,
+ history::HistoryService* history_service);
+ ~DataObserver() override;
+
+ // BookmarkModelObserver implementation.
+ void BookmarkModelLoaded(bookmarks::BookmarkModel* model,
+ bool ids_reassigned) override;
+ void BookmarkModelBeingDeleted(bookmarks::BookmarkModel* model) override;
+ void BookmarkNodeMoved(bookmarks::BookmarkModel* model,
+ const bookmarks::BookmarkNode* old_parent,
+ int old_index,
+ const bookmarks::BookmarkNode* new_parent,
+ int new_index) override;
+ void BookmarkNodeAdded(bookmarks::BookmarkModel* model,
+ const bookmarks::BookmarkNode* parent,
+ int index) override;
+ void BookmarkNodeRemoved(bookmarks::BookmarkModel* model,
+ const bookmarks::BookmarkNode* parent,
+ int old_index,
+ const bookmarks::BookmarkNode* node,
+ const std::set<GURL>& removed_urls) override;
+ void BookmarkAllUserNodesRemoved(
+ bookmarks::BookmarkModel* model,
+ const std::set<GURL>& removed_urls) override;
+ void BookmarkNodeChanged(bookmarks::BookmarkModel* model,
+ const bookmarks::BookmarkNode* node) override;
+ void BookmarkNodeFaviconChanged(bookmarks::BookmarkModel* model,
+ const bookmarks::BookmarkNode* node) override;
+ void BookmarkNodeChildrenReordered(
+ bookmarks::BookmarkModel* model,
+ const bookmarks::BookmarkNode* node) override;
+
+ // HistoryServiceObserver implementation.
+ void OnURLVisited(history::HistoryService* history_service,
+ ui::PageTransition transition,
+ const history::URLRow& row,
+ const history::RedirectList& redirects,
+ base::Time visit_time) override;
+ void OnURLsModified(history::HistoryService* history_service,
+ const history::URLRows& changed_urls) override;
+ void OnURLsDeleted(history::HistoryService* history_service,
+ bool all_history,
+ bool expired,
+ const history::URLRows& deleted_rows,
+ const std::set<GURL>& favicon_urls) override;
+
+ private:
+ void DeleteBookmarks(const std::set<GURL>& removed_urls);
+
+ base::Callback<void(void)> data_changed_callback_;
+ base::Callback<void(void)> data_cleared_callback_;
+ base::Callback<void(void)> stop_reporting_callback_;
+ DeltaFileService* delta_file_service_;
+ UsageReportsBufferService* usage_reports_buffer_service_;
+
+ DISALLOW_COPY_AND_ASSIGN(DataObserver);
+};
+
+} // namespace history_report
+
+#endif // CHROME_BROWSER_ANDROID_HISTORY_REPORT_DATA_OBSERVER_H_
« 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