Roll src/third_party/WebKit f298044:aa8346d (svn 202628:202629)
[chromium-blink-merge.git] / chrome / browser / safe_browsing / safe_browsing_api_handler.h
blob90d43144137727b04e1231c702987249aa988570
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.
8 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_API_HANDLER_H_
9 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_API_HANDLER_H_
11 #include <string>
12 #include <vector>
14 #include "base/callback.h"
15 #include "chrome/browser/safe_browsing/safe_browsing_util.h"
16 #include "url/gurl.h"
18 class SafeBrowsingApiHandler {
19 public:
20 // Singleton interface.
21 static void SetInstance(SafeBrowsingApiHandler* instance);
22 static SafeBrowsingApiHandler* GetInstance();
24 typedef base::Callback<void(SBThreatType sb_threat_type,
25 const std::string& metadata)> URLCheckCallback;
27 // Makes Native->Java call and invokes callback when check is done.
28 virtual void StartURLCheck(const URLCheckCallback& callback,
29 const GURL& url,
30 const std::vector<SBThreatType>& threat_types) = 0;
32 virtual ~SafeBrowsingApiHandler() {}
34 private:
35 // Pointer not owned.
36 static SafeBrowsingApiHandler* instance_;
38 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_API_HANDLER_H_