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

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

Issue 2601303002: Wireup SafeBrowsingNavigationObserverManager to help PPAPI download attribution (Closed)
Patch Set: nit Created 3 years, 11 months 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 (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 // Helper class which handles communication with the SafeBrowsing servers for 5 // Helper class which handles communication with the SafeBrowsing servers for
6 // improved binary download protection. 6 // improved binary download protection.
7 7
8 #ifndef CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_ 8 #ifndef CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_
9 #define CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_ 9 #define CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_
10 10
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 const CheckDownloadCallback& callback); 122 const CheckDownloadCallback& callback);
123 123
124 // Returns true iff the download specified by |info| should be scanned by 124 // Returns true iff the download specified by |info| should be scanned by
125 // CheckClientDownload() for malicious content. 125 // CheckClientDownload() for malicious content.
126 virtual bool IsSupportedDownload( 126 virtual bool IsSupportedDownload(
127 const content::DownloadItem& item, 127 const content::DownloadItem& item,
128 const base::FilePath& target_path) const; 128 const base::FilePath& target_path) const;
129 129
130 virtual void CheckPPAPIDownloadRequest( 130 virtual void CheckPPAPIDownloadRequest(
131 const GURL& requestor_url, 131 const GURL& requestor_url,
132 const GURL& initiating_frame_url,
133 content::WebContents* web_contents,
132 const base::FilePath& default_file_path, 134 const base::FilePath& default_file_path,
133 const std::vector<base::FilePath::StringType>& alternate_extensions, 135 const std::vector<base::FilePath::StringType>& alternate_extensions,
134 Profile* profile, 136 Profile* profile,
135 const CheckDownloadCallback& callback); 137 const CheckDownloadCallback& callback);
136 138
137 // Display more information to the user regarding the download specified by 139 // Display more information to the user regarding the download specified by
138 // |info|. This method is invoked when the user requests more information 140 // |info|. This method is invoked when the user requests more information
139 // about a download that was marked as malicious. 141 // about a download that was marked as malicious.
140 void ShowDetailsForDownload(const content::DownloadItem& item, 142 void ShowDetailsForDownload(const content::DownloadItem& item,
141 content::PageNavigator* navigator); 143 content::PageNavigator* navigator);
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 static GURL GetDownloadRequestUrl(); 291 static GURL GetDownloadRequestUrl();
290 292
291 // If kDownloadAttribution feature is enabled, identify and add referrer chain 293 // If kDownloadAttribution feature is enabled, identify and add referrer chain
292 // info of a download to ClientDownloadRequest proto. This function also 294 // info of a download to ClientDownloadRequest proto. This function also
293 // records UMA stats of download attribution result. 295 // records UMA stats of download attribution result.
294 void AddReferrerChainToClientDownloadRequest( 296 void AddReferrerChainToClientDownloadRequest(
295 const GURL& download_url, 297 const GURL& download_url,
296 content::WebContents* web_contents, 298 content::WebContents* web_contents,
297 ClientDownloadRequest* out_request); 299 ClientDownloadRequest* out_request);
298 300
301 // If kDownloadAttribution feature is enabled, identify referrer chain of the
302 // PPAPI download based on the frame URL where the download is initiated.
303 // Then add referrer chain info of to ClientDownloadRequest proto. This
Nathan Parker 2017/01/04 19:49:12 s/ of//
Jialiu Lin 2017/01/04 21:53:35 Done.
304 // function also records UMA stats of download attribution result.
305 void AddReferrerChainToPPAPIClientDownloadRequest(
306 const GURL& initiating_frame_url,
307 content::WebContents* web_contents,
308 ClientDownloadRequest* out_request);
309
299 // These pointers may be NULL if SafeBrowsing is disabled. 310 // These pointers may be NULL if SafeBrowsing is disabled.
300 scoped_refptr<SafeBrowsingUIManager> ui_manager_; 311 scoped_refptr<SafeBrowsingUIManager> ui_manager_;
301 scoped_refptr<SafeBrowsingDatabaseManager> database_manager_; 312 scoped_refptr<SafeBrowsingDatabaseManager> database_manager_;
302 scoped_refptr<SafeBrowsingNavigationObserverManager> 313 scoped_refptr<SafeBrowsingNavigationObserverManager>
303 navigation_observer_manager_; 314 navigation_observer_manager_;
304 315
305 // The context we use to issue network requests. 316 // The context we use to issue network requests.
306 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; 317 scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
307 318
308 // Set of pending server requests for DownloadManager mediated downloads. 319 // Set of pending server requests for DownloadManager mediated downloads.
(...skipping 28 matching lines...) Expand all
337 std::set<std::string> manual_blacklist_hashes_; 348 std::set<std::string> manual_blacklist_hashes_;
338 349
339 // Rate of whitelisted downloads we sample to send out download ping. 350 // Rate of whitelisted downloads we sample to send out download ping.
340 double whitelist_sample_rate_; 351 double whitelist_sample_rate_;
341 352
342 DISALLOW_COPY_AND_ASSIGN(DownloadProtectionService); 353 DISALLOW_COPY_AND_ASSIGN(DownloadProtectionService);
343 }; 354 };
344 } // namespace safe_browsing 355 } // namespace safe_browsing
345 356
346 #endif // CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_ 357 #endif // CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698