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

Unified Diff: chrome/browser/safe_browsing/ping_manager.cc

Issue 2624193004: Submit a sample of notification images to Safe Browsing (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/ping_manager.cc
diff --git a/chrome/browser/safe_browsing/ping_manager.cc b/chrome/browser/safe_browsing/ping_manager.cc
index 2a42e9bbafbfa975000b387d50374c3bff5832dc..f98cc5cfef176cd50d357382f69d3e1f04aa5c17 100644
--- a/chrome/browser/safe_browsing/ping_manager.cc
+++ b/chrome/browser/safe_browsing/ping_manager.cc
@@ -12,6 +12,7 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
+#include "chrome/browser/safe_browsing/notification_image_reporter.h"
#include "chrome/browser/safe_browsing/permission_reporter.h"
#include "components/data_use_measurement/core/data_use_user_data.h"
#include "content/public/browser/browser_thread.h"
@@ -24,6 +25,7 @@
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "url/gurl.h"
using content::BrowserThread;
@@ -84,6 +86,8 @@ SafeBrowsingPingManager::SafeBrowsingPingManager(
if (request_context_getter) {
permission_reporter_.reset(
new PermissionReporter(request_context_getter->GetURLRequestContext()));
+ notification_image_reporter_ = new NotificationImageReporter(
+ request_context_getter->GetURLRequestContext());
net_log_ = net::NetLogWithSource::Make(
request_context_getter->GetURLRequestContext()->net_log(),
@@ -170,6 +174,15 @@ void SafeBrowsingPingManager::ReportPermissionAction(
permission_reporter_->SendReport(report_info);
}
+void SafeBrowsingPingManager::ReportNotificationImage(Profile* profile,
+ const GURL& origin,
+ const SkBitmap& image) {
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
johnme 2017/01/11 17:50:53 It's a shame that the PlatformNotificationServiceI
+ base::Bind(&NotificationImageReporter::ReportNotificationImageOnUI,
+ notification_image_reporter_, profile, origin, image));
+}
+
GURL SafeBrowsingPingManager::SafeBrowsingHitUrl(
const safe_browsing::HitReport& hit_report) const {
DCHECK(hit_report.threat_type == SB_THREAT_TYPE_URL_MALWARE ||

Powered by Google App Engine
This is Rietveld 408576698