Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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 // Glue to pass Safe Browsing API requests between Chrome and GMSCore | |
| 6 | |
| 7 #ifndef CHROME_BROWSER_ANDROID_SAFE_BROWSING_SAFE_BROWSING_API_HANDLER_BRIDGE_H_ | |
| 8 #define CHROME_BROWSER_ANDROID_SAFE_BROWSING_SAFE_BROWSING_API_HANDLER_BRIDGE_H_ | |
| 9 | |
| 10 #include <jni.h> | |
| 11 | |
| 12 #include <string> | |
| 13 #include <vector> | |
| 14 | |
| 15 #include "base/android/jni_android.h" | |
| 16 #include "base/macros.h" | |
| 17 #include "components/safe_browsing_db/safe_browsing_api_handler.h" | |
| 18 #include "url/gurl.h" | |
| 19 | |
| 20 namespace safe_browsing { | |
| 21 bool RegisterSafeBrowsingApiBridge(JNIEnv* env); | |
| 22 | |
| 23 class SafeBrowsingApiHandlerBridge : public SafeBrowsingApiHandler { | |
| 24 public: | |
| 25 SafeBrowsingApiHandlerBridge(); | |
| 26 ~SafeBrowsingApiHandlerBridge() override; | |
| 27 | |
| 28 // Makes Native->Java call to check the URL against Safe Browsing lists. | |
| 29 // |threat_types| is currently ignored. | |
|
Nathan Parker
2016/04/29 20:42:04
rm second line of comment (since threat_types is n
Yaron
2016/05/02 13:25:07
Done.
| |
| 30 void StartURLCheck(const URLCheckCallbackMeta& callback, | |
| 31 const GURL& url, | |
| 32 const std::vector<SBThreatType>& threat_types) override; | |
| 33 | |
| 34 private: | |
| 35 | |
|
nyquist
2016/04/29 20:01:34
Nit: remove empty line?
Yaron
2016/05/02 13:25:07
Done.
| |
| 36 // Creates the j_api_handler_ if it hasn't been already. If the API is not | |
| 37 // supported, this will return false and j_api_handler_ will remain NULL. | |
| 38 bool CheckApiIsSupported(); | |
| 39 | |
| 40 // The Java-side SafeBrowsingApiHandler. Must call CheckApiIsSupported first. | |
| 41 base::android::ScopedJavaLocalRef<jobject> j_api_handler_; | |
| 42 | |
| 43 // True if we've once tried to create the above object. | |
| 44 bool checked_api_support_; | |
| 45 | |
| 46 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingApiHandlerBridge); | |
| 47 }; | |
| 48 | |
| 49 } // namespace safe_browsing | |
| 50 #endif // CHROME_BROWSER_ANDROID_SAFE_BROWSING_SAFE_BROWSING_API_HANDLER_BRIDGE _H_ | |
| OLD | NEW |