Index: chrome/browser/safe_browsing/android_safe_browsing_api_handler.h |
diff --git a/chrome/browser/safe_browsing/android_safe_browsing_api_handler.h b/chrome/browser/safe_browsing/android_safe_browsing_api_handler.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d7fb7785acc3c11ed2f2e30c3c6c7b7f1a89715f |
--- /dev/null |
+++ b/chrome/browser/safe_browsing/android_safe_browsing_api_handler.h |
@@ -0,0 +1,39 @@ |
+// Copyright (c) 2012 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. |
+// |
+// Glue to pass Safe Browsing API requests between |
+// RemoteSafeBrowsingDatabaseManager and Java-based API to check URLs. |
+ |
+#ifndef CHROME_BROWSER_SAFE_BROWSING_ANDROID_SAFE_BROWSING_API_HANDLER_H_ |
+#define CHROME_BROWSER_SAFE_BROWSING_ANDROID_SAFE_BROWSING_API_HANDLER_H_ |
+ |
+#include <string> |
+ |
+#include "base/android/jni_android.h" |
+#include "base/macros.h" |
+#include "chrome/browser/safe_browsing/remote_database_manager.h" |
+ |
+class AndroidSafeBrowsingAPIHandler { |
+ public: |
+ AndroidSafeBrowsingAPIHandler(); |
+ |
+ // Makes Native->Java call. Takes ownership of client_request |
+ // Returns false if it fails to start and doesn't take ownership. |
+ bool StartRequest( |
+ RemoteSafeBrowsingDatabaseManager::ClientRequest* client_request); |
+ |
+ // Java->Native call, invoked when a request is done. Must be static. |
+ static void OnRequestDone(jlong client_req_id, |
+ jboolean isSuccessful, |
+ jstring metadata); |
+ |
+ protected: |
+ jobject j_context_; |
+ std::string api_key_; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(AndroidSafeBrowsingAPIHandler); |
+}; |
+ |
+#endif // CHROME_BROWSER_SAFE_BROWSING_ANDROID_SAFE_BROWSING_API_HANDLER_H_ |