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

Side by Side Diff: chrome/browser/safe_browsing/android_safe_browsing_api_handler.h

Issue 1110723002: Split to SafeBrowsingDatabaseManager into Local* and Remote*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to review. Tweak comments and list initializer. 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 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
6 // RemoteSafeBrowsingDatabaseManager and Java-based API to check URLs.
7
8 #ifndef CHROME_BROWSER_SAFE_BROWSING_ANDROID_SAFE_BROWSING_API_HANDLER_H_
9 #define CHROME_BROWSER_SAFE_BROWSING_ANDROID_SAFE_BROWSING_API_HANDLER_H_
10
11 #include <string>
12 #include <vector>
13
14 #include "base/android/jni_android.h"
15 #include "base/callback.h"
16 #include "base/macros.h"
17 #include "chrome/browser/safe_browsing/safe_browsing_util.h"
18 #include "url/gurl.h"
19
20 typedef base::Callback<void(SBThreatType sb_threat_type,
21 const std::string& metadata)> URLCheckCallback;
22
23 class AndroidSafeBrowsingAPIHandler {
24 public:
25 AndroidSafeBrowsingAPIHandler();
26
27 // Makes Native->Java call and invokes callback when check is done.
28 // Returns false if it fails to start.
29 bool StartURLCheck(
30 const URLCheckCallback& callback,
31 const GURL& url,
32 const std::vector<SBThreatType>& threat_types);
33
34 // Java->Native call, invoked when a check is done. |callback_id| is an
35 // int form of pointer to a URLCheckCallback that will be called and then
36 // deleted here.
37 static void OnURLCheckDone(jlong callback_id,
38 jboolean isSuccessful,
39 jstring metadata);
40
41 protected:
42 jobject j_context_;
43 std::string api_key_;
44
45 private:
46 DISALLOW_COPY_AND_ASSIGN(AndroidSafeBrowsingAPIHandler);
47 };
48 #endif // CHROME_BROWSER_SAFE_BROWSING_ANDROID_SAFE_BROWSING_API_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698