| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_MALWARE_DETAILS_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_MALWARE_DETAILS_H_ |
| 6 #define CHROME_BROWSER_SAFE_BROWSING_MALWARE_DETAILS_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_MALWARE_DETAILS_H_ |
| 7 | 7 |
| 8 // A class that encapsulates the detailed malware reports sent when | 8 // A class that encapsulates the detailed malware reports sent when |
| 9 // users opt-in to do so from the malware warning page. | 9 // users opt-in to do so from the malware warning page. |
| 10 | 10 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // Used to get a pointer to the HTTP cache. | 93 // Used to get a pointer to the HTTP cache. |
| 94 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; | 94 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; |
| 95 | 95 |
| 96 private: | 96 private: |
| 97 friend class base::RefCountedThreadSafe<MalwareDetails>; | 97 friend class base::RefCountedThreadSafe<MalwareDetails>; |
| 98 | 98 |
| 99 // Starts the collection of the report. | 99 // Starts the collection of the report. |
| 100 void StartCollection(); | 100 void StartCollection(); |
| 101 | 101 |
| 102 // Whether the url is "public" so we can add it to the report. | 102 // Whether the url is "public" so we can add it to the report. |
| 103 bool IsPublicUrl(const GURL& url) const; | 103 bool IsReportableUrl(const GURL& url) const; |
| 104 | 104 |
| 105 // Finds an existing Resource for the given url, or creates a new | 105 // Finds an existing Resource for the given url, or creates a new |
| 106 // one if not found, and adds it to |resources_|. Returns the | 106 // one if not found, and adds it to |resources_|. Returns the |
| 107 // found/created resource. | 107 // found/created resource. |
| 108 safe_browsing::ClientMalwareReportRequest::Resource* FindOrCreateResource( | 108 safe_browsing::ClientMalwareReportRequest::Resource* FindOrCreateResource( |
| 109 const GURL& url); | 109 const GURL& url); |
| 110 | 110 |
| 111 // Adds a Resource to resources_ with the given parent-child | 111 // Adds a Resource to resources_ with the given parent-child |
| 112 // relationship. |parent| and |tagname| can be empty, |children| can be NULL. | 112 // relationship. |parent| and |tagname| can be empty, |children| can be NULL. |
| 113 void AddUrl(const GURL& url, | 113 void AddUrl(const GURL& url, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 public: | 156 public: |
| 157 virtual ~MalwareDetailsFactory() { } | 157 virtual ~MalwareDetailsFactory() { } |
| 158 | 158 |
| 159 virtual MalwareDetails* CreateMalwareDetails( | 159 virtual MalwareDetails* CreateMalwareDetails( |
| 160 SafeBrowsingUIManager* ui_manager, | 160 SafeBrowsingUIManager* ui_manager, |
| 161 content::WebContents* web_contents, | 161 content::WebContents* web_contents, |
| 162 const SafeBrowsingUIManager::UnsafeResource& unsafe_resource) = 0; | 162 const SafeBrowsingUIManager::UnsafeResource& unsafe_resource) = 0; |
| 163 }; | 163 }; |
| 164 | 164 |
| 165 #endif // CHROME_BROWSER_SAFE_BROWSING_MALWARE_DETAILS_H_ | 165 #endif // CHROME_BROWSER_SAFE_BROWSING_MALWARE_DETAILS_H_ |
| OLD | NEW |