OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_HELPER_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_HELPER_H_ |
6 #define CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_HELPER_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_HELPER_H_ |
7 | 7 |
8 // A class that provides common functionality for safebrowsing protocol managers | 8 // A class that provides common functionality for safebrowsing protocol managers |
9 // that communicate with Google servers. | 9 // that communicate with Google servers. |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 | 15 |
16 | 16 |
17 struct SafeBrowsingProtocolConfig { | 17 struct SafeBrowsingProtocolConfig { |
18 SafeBrowsingProtocolConfig(); | 18 SafeBrowsingProtocolConfig(); |
19 ~SafeBrowsingProtocolConfig(); | 19 ~SafeBrowsingProtocolConfig(); |
20 std::string client_name; | 20 std::string client_name; |
21 std::string url_prefix; | 21 std::string url_prefix; |
22 std::string backup_connect_error_url_prefix; | 22 std::string backup_connect_error_url_prefix; |
23 std::string backup_http_error_url_prefix; | 23 std::string backup_http_error_url_prefix; |
24 std::string backup_network_error_url_prefix; | 24 std::string backup_network_error_url_prefix; |
25 std::string version; | 25 std::string version; |
26 bool disable_auto_update; | 26 bool disable_auto_update; |
27 #if defined(OS_ANDROID) | |
28 bool disable_connection_check; | |
29 #endif | |
30 }; | 27 }; |
31 | 28 |
32 class SafeBrowsingProtocolManagerHelper { | 29 class SafeBrowsingProtocolManagerHelper { |
33 public: | 30 public: |
34 // returns version | 31 // returns version |
35 static std::string Version(); | 32 static std::string Version(); |
36 | 33 |
37 // Composes a URL using |prefix|, |method| (e.g.: gethash, download, report). | 34 // Composes a URL using |prefix|, |method| (e.g.: gethash, download, report). |
38 // |client_name| and |version|. When not empty, |additional_query| is | 35 // |client_name| and |version|. When not empty, |additional_query| is |
39 // appended to the URL with an additional "&" in the front. | 36 // appended to the URL with an additional "&" in the front. |
(...skipping 10 matching lines...) Expand all Loading... |
50 const std::string& client_name, | 47 const std::string& client_name, |
51 const std::string& version, | 48 const std::string& version, |
52 const std::string& additional_query, | 49 const std::string& additional_query, |
53 bool is_extended_reporting); | 50 bool is_extended_reporting); |
54 | 51 |
55 private: | 52 private: |
56 DISALLOW_IMPLICIT_CONSTRUCTORS(SafeBrowsingProtocolManagerHelper); | 53 DISALLOW_IMPLICIT_CONSTRUCTORS(SafeBrowsingProtocolManagerHelper); |
57 }; | 54 }; |
58 | 55 |
59 #endif // CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_HELPER_H_ | 56 #endif // CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_HELPER_H_ |
OLD | NEW |