blob: b229a3af59193a3f8748c44632098df50b1cdc35 [file] [log] [blame]
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_SAFE_BROWSING_PING_MANAGER_H_
#define CHROME_BROWSER_SAFE_BROWSING_PING_MANAGER_H_
#include "components/safe_browsing/base_ping_manager.h"
class Profile;
class SkBitmap;
namespace net {
class URLRequestContextGetter;
} // namespace net
namespace safe_browsing {
class NotificationImageReporter;
class SafeBrowsingDatabaseManager;
class SafeBrowsingPingManager : public BasePingManager {
public:
~SafeBrowsingPingManager() override;
// Create an instance of the safe browsing ping manager.
static std::unique_ptr<SafeBrowsingPingManager> Create(
net::URLRequestContextGetter* request_context_getter,
const SafeBrowsingProtocolConfig& config);
// Report notification content image to SafeBrowsing CSD server if necessary.
void ReportNotificationImage(
Profile* profile,
const scoped_refptr<SafeBrowsingDatabaseManager>& database_manager,
const GURL& origin,
const SkBitmap& image);
private:
friend class NotificationImageReporterTest;
FRIEND_TEST_ALL_PREFIXES(SafeBrowsingPingManagerCertReportingTest,
UMAOnFailure);
// Constructs a SafeBrowsingPingManager that issues network requests
// using |request_context_getter|.
SafeBrowsingPingManager(
net::URLRequestContextGetter* request_context_getter,
const SafeBrowsingProtocolConfig& config);
// Sends reports of notification content images.
std::unique_ptr<NotificationImageReporter> notification_image_reporter_;
DISALLOW_COPY_AND_ASSIGN(SafeBrowsingPingManager);
};
} // namespace safe_browsing
#endif // CHROME_BROWSER_SAFE_BROWSING_PING_MANAGER_H_