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

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

Issue 1420053005: Move code in components/safe_browsing_db and chrome/browser/s_b/ under the safe_browsing namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@02_components_move
Patch Set: Remove '// namespace safe_browsing' for a small fwd decl block. Created 5 years, 1 month 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Glue to pass Safe Browsing API requests between 5 // Glue to pass Safe Browsing API requests between
6 // RemoteSafeBrowsingDatabaseManager and Java-based API to check URLs. 6 // RemoteSafeBrowsingDatabaseManager and Java-based API to check URLs.
7 7
8 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_API_HANDLER_H_ 8 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_API_HANDLER_H_
9 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_API_HANDLER_H_ 9 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_API_HANDLER_H_
10 10
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/callback.h" 14 #include "base/callback.h"
15 #include "chrome/browser/safe_browsing/safe_browsing_util.h" 15 #include "chrome/browser/safe_browsing/safe_browsing_util.h"
16 #include "url/gurl.h" 16 #include "url/gurl.h"
17 17
18 namespace safe_browsing {
19
18 class SafeBrowsingApiHandler { 20 class SafeBrowsingApiHandler {
19 public: 21 public:
20 // Singleton interface. 22 // Singleton interface.
21 static void SetInstance(SafeBrowsingApiHandler* instance); 23 static void SetInstance(SafeBrowsingApiHandler* instance);
22 static SafeBrowsingApiHandler* GetInstance(); 24 static SafeBrowsingApiHandler* GetInstance();
23 25
24 typedef base::Callback<void(SBThreatType sb_threat_type, 26 typedef base::Callback<void(SBThreatType sb_threat_type,
25 const std::string& metadata)> URLCheckCallback; 27 const std::string& metadata)> URLCheckCallback;
26 28
27 // Makes Native->Java call and invokes callback when check is done. 29 // Makes Native->Java call and invokes callback when check is done.
28 virtual void StartURLCheck(const URLCheckCallback& callback, 30 virtual void StartURLCheck(const URLCheckCallback& callback,
29 const GURL& url, 31 const GURL& url,
30 const std::vector<SBThreatType>& threat_types) = 0; 32 const std::vector<SBThreatType>& threat_types) = 0;
31 33
32 virtual ~SafeBrowsingApiHandler() {} 34 virtual ~SafeBrowsingApiHandler() {}
33 35
34 private: 36 private:
35 // Pointer not owned. 37 // Pointer not owned.
36 static SafeBrowsingApiHandler* instance_; 38 static SafeBrowsingApiHandler* instance_;
37 }; 39 };
40
41 } // namespace safe_browsing
42
38 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_API_HANDLER_H_ 43 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_API_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698