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

Unified Diff: chrome/browser/android/history/browsing_history_bridge.h

Issue 2542203002: [Android History] Add Android history manager UI and bridge (Closed)
Patch Set: Rebase, drop changes to time.* Created 4 years 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
« no previous file with comments | « chrome/browser/android/history/OWNERS ('k') | chrome/browser/android/history/browsing_history_bridge.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/history/browsing_history_bridge.h
diff --git a/chrome/browser/android/history/browsing_history_bridge.h b/chrome/browser/android/history/browsing_history_bridge.h
new file mode 100644
index 0000000000000000000000000000000000000000..d94a063dd22eaf776af3410dafe81ff3962d5e4d
--- /dev/null
+++ b/chrome/browser/android/history/browsing_history_bridge.h
@@ -0,0 +1,57 @@
+// Copyright 2016 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_BROWSING_HISTORY_BRIDGE_H_
+#define CHROME_BROWSER_ANDROID_HISTORY_BROWSING_HISTORY_BRIDGE_H_
+
+#include <jni.h>
+#include <vector>
+
+#include "base/android/jni_android.h"
+#include "base/android/scoped_java_ref.h"
+#include "base/macros.h"
+#include "chrome/browser/history/browsing_history_service_handler.h"
+
+using base::android::JavaParamRef;
+
+// The bridge for fetching browsing history information for the Android
+// history UI. This queries the BrowsingHistoryService and listens
+// for callbacks.
+class BrowsingHistoryBridge : public BrowsingHistoryServiceHandler {
+
+ public:
+ explicit BrowsingHistoryBridge(JNIEnv* env,
+ const JavaParamRef<jobject>& obj,
+ jobject j_profile);
+ void Destroy(JNIEnv*, const JavaParamRef<jobject>&);
+
+ void QueryHistory(JNIEnv* env,
+ const JavaParamRef<jobject>& obj,
+ const JavaParamRef<jobject>& j_result_obj,
+ jstring j_query,
+ int64_t j_query_end_time);
+
+ // BrowsingHistoryServiceHandler implementation
+ void OnQueryComplete(
+ std::vector<BrowsingHistoryService::HistoryEntry>* results,
+ BrowsingHistoryService::QueryResultsInfo* query_results_info) override;
+ void OnRemoveVisitsComplete() override;
+ void OnRemoveVisitsFailed() override;
+ void HistoryDeleted() override;
+ void HasOtherFormsOfBrowsingHistory(
+ bool has_other_forms, bool has_synced_results) override;
+
+ private:
+ ~BrowsingHistoryBridge() override;
+
+ std::unique_ptr<BrowsingHistoryService> browsing_history_service_;
+ base::android::ScopedJavaGlobalRef<jobject> j_history_service_obj_;
+ base::android::ScopedJavaGlobalRef<jobject> j_query_result_obj_;
+
+ DISALLOW_COPY_AND_ASSIGN(BrowsingHistoryBridge);
+};
+
+bool RegisterBrowsingHistoryBridge(JNIEnv* env);
+
+#endif // CHROME_BROWSER_ANDROID_HISTORY_BROWSING_HISTORY_BRIDGE_H_
« no previous file with comments | « chrome/browser/android/history/OWNERS ('k') | chrome/browser/android/history/browsing_history_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698