Chromium Code Reviews| 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..2823606bf83ffcf31a2102d5ac43e204cfad276d |
| --- /dev/null |
| +++ b/chrome/browser/android/history/browsing_history_bridge.h |
| @@ -0,0 +1,58 @@ |
| +// 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; |
| + |
| + BrowsingHistoryService* browsing_history_service_; |
| + base::android::ScopedJavaGlobalRef<jobject> j_history_service_obj_; |
| + base::android::ScopedJavaGlobalRef<jobject> j_query_result_obj_; |
| + JNIEnv* env_; |
|
gone
2016/12/02 19:34:37
Should just call AttachCurrentThread() instead of
Theresa
2016/12/02 20:49:33
Done.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(BrowsingHistoryBridge); |
| +}; |
| + |
| +bool RegisterBrowsingHistoryBridge(JNIEnv* env); |
| + |
| +#endif // CHROME_BROWSER_ANDROID_HISTORY_BROWSING_HISTORY_BRIDGE_H_ |