| 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_THREAT_DETAILS_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_THREAT_DETAILS_H_ |
| 6 #define CHROME_BROWSER_SAFE_BROWSING_THREAT_DETAILS_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_THREAT_DETAILS_H_ |
| 7 | 7 |
| 8 // A class that encapsulates the detailed threat reports sent when | 8 // A class that encapsulates the detailed threat reports sent when |
| 9 // users opt-in to do so from the safe browsing warning page. | 9 // users opt-in to do so from the safe browsing warning page. |
| 10 | 10 |
| 11 // An instance of this class is generated when a safe browsing warning page | 11 // An instance of this class is generated when a safe browsing warning page |
| 12 // is shown (SafeBrowsingBlockingPage). | 12 // is shown (SafeBrowsingBlockingPage). |
| 13 | 13 |
| 14 #include <memory> |
| 14 #include <string> | 15 #include <string> |
| 15 #include <vector> | 16 #include <vector> |
| 16 | 17 |
| 17 #include "base/containers/hash_tables.h" | 18 #include "base/containers/hash_tables.h" |
| 18 #include "base/gtest_prod_util.h" | 19 #include "base/gtest_prod_util.h" |
| 19 #include "base/macros.h" | 20 #include "base/macros.h" |
| 20 #include "base/memory/linked_ptr.h" | 21 #include "base/memory/linked_ptr.h" |
| 21 #include "base/memory/ref_counted.h" | 22 #include "base/memory/ref_counted.h" |
| 22 #include "base/memory/scoped_ptr.h" | |
| 23 #include "chrome/browser/safe_browsing/ui_manager.h" | 23 #include "chrome/browser/safe_browsing/ui_manager.h" |
| 24 #include "chrome/common/safe_browsing/csd.pb.h" | 24 #include "chrome/common/safe_browsing/csd.pb.h" |
| 25 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
| 26 #include "content/public/browser/web_contents_observer.h" | 26 #include "content/public/browser/web_contents_observer.h" |
| 27 #include "net/base/completion_callback.h" | 27 #include "net/base/completion_callback.h" |
| 28 | 28 |
| 29 namespace net { | 29 namespace net { |
| 30 class URLRequestContextGetter; | 30 class URLRequestContextGetter; |
| 31 } | 31 } |
| 32 | 32 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 ~ThreatDetails() override; | 90 ~ThreatDetails() override; |
| 91 | 91 |
| 92 // Called on the IO thread with the DOM details. | 92 // Called on the IO thread with the DOM details. |
| 93 virtual void AddDOMDetails( | 93 virtual void AddDOMDetails( |
| 94 const std::vector<SafeBrowsingHostMsg_ThreatDOMDetails_Node>& params); | 94 const std::vector<SafeBrowsingHostMsg_ThreatDOMDetails_Node>& params); |
| 95 | 95 |
| 96 Profile* profile_; | 96 Profile* profile_; |
| 97 | 97 |
| 98 // The report protocol buffer. | 98 // The report protocol buffer. |
| 99 scoped_ptr<ClientSafeBrowsingReportRequest> report_; | 99 std::unique_ptr<ClientSafeBrowsingReportRequest> report_; |
| 100 | 100 |
| 101 // Used to get a pointer to the HTTP cache. | 101 // Used to get a pointer to the HTTP cache. |
| 102 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; | 102 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; |
| 103 | 103 |
| 104 private: | 104 private: |
| 105 friend class base::RefCountedThreadSafe<ThreatDetails>; | 105 friend class base::RefCountedThreadSafe<ThreatDetails>; |
| 106 friend struct content::BrowserThread::DeleteOnThread< | 106 friend struct content::BrowserThread::DeleteOnThread< |
| 107 content::BrowserThread::UI>; | 107 content::BrowserThread::UI>; |
| 108 friend class base::DeleteHelper<ThreatDetails>; | 108 friend class base::DeleteHelper<ThreatDetails>; |
| 109 | 109 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 176 |
| 177 virtual ThreatDetails* CreateThreatDetails( | 177 virtual ThreatDetails* CreateThreatDetails( |
| 178 SafeBrowsingUIManager* ui_manager, | 178 SafeBrowsingUIManager* ui_manager, |
| 179 content::WebContents* web_contents, | 179 content::WebContents* web_contents, |
| 180 const SafeBrowsingUIManager::UnsafeResource& unsafe_resource) = 0; | 180 const SafeBrowsingUIManager::UnsafeResource& unsafe_resource) = 0; |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 } // namespace safe_browsing | 183 } // namespace safe_browsing |
| 184 | 184 |
| 185 #endif // CHROME_BROWSER_SAFE_BROWSING_THREAT_DETAILS_H_ | 185 #endif // CHROME_BROWSER_SAFE_BROWSING_THREAT_DETAILS_H_ |
| OLD | NEW |