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

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

Issue 2047253002: Add hooks to permission layer for permission action reporting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permission-reporter-implementation
Patch Set: Small comment change Created 4 years, 6 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.h
diff --git a/chrome/browser/safe_browsing/ping_manager.h b/chrome/browser/safe_browsing/ping_manager.h
index f8730ba19357cd672b8a3a9272280e87f802b7f9..b76fe6de615fe52efe2b5e8316a97f6013654005 100644
--- a/chrome/browser/safe_browsing/ping_manager.h
+++ b/chrome/browser/safe_browsing/ping_manager.h
@@ -12,9 +12,17 @@
#include <string>
#include <vector>
+#include "base/command_line.h"
raymes 2016/06/16 01:10:22 nit: is this needed here?
stefanocs 2016/06/16 01:52:20 Done.
#include "base/gtest_prod_util.h"
#include "base/macros.h"
+#include "chrome/browser/permissions/permission_uma_util.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/safe_browsing/protocol_manager_helper.h"
+#include "chrome/browser/sync/profile_sync_service_factory.h"
+#include "chrome/common/chrome_switches.h"
+#include "chrome/common/pref_names.h"
+#include "components/browser_sync/browser/profile_sync_service.h"
+#include "components/prefs/pref_service.h"
raymes 2016/06/16 01:10:22 Same with most of these?
stefanocs 2016/06/16 01:52:19 Done.
#include "components/safe_browsing_db/hit_report.h"
#include "components/safe_browsing_db/util.h"
#include "net/url_request/url_fetcher_delegate.h"
@@ -31,6 +39,8 @@ class URLRequestContextGetter;
namespace safe_browsing {
+class PermissionReporter;
+
class SafeBrowsingPingManager : public net::URLFetcherDelegate {
public:
~SafeBrowsingPingManager() override;
@@ -60,6 +70,11 @@ class SafeBrowsingPingManager : public net::URLFetcherDelegate {
std::unique_ptr<certificate_reporting::ErrorReporter>
certificate_error_reporter);
+ // Report permission action to SafeBrowsing servers.
+ void ReportPermissionAction(const GURL& origin,
+ content::PermissionType permission,
raymes 2016/06/16 01:10:22 nit: we should include permission_type.h
stefanocs 2016/06/16 01:52:20 Do we still need to include that even though it wa
raymes 2016/06/20 02:46:33 Yes - you either need to forward declare or #inclu
+ PermissionAction action);
+
private:
FRIEND_TEST_ALL_PREFIXES(SafeBrowsingPingManagerTest,
TestSafeBrowsingHitUrl);
@@ -100,6 +115,9 @@ class SafeBrowsingPingManager : public net::URLFetcherDelegate {
std::unique_ptr<certificate_reporting::ErrorReporter>
certificate_error_reporter_;
+ // Sends reports of permission actions.
+ std::unique_ptr<PermissionReporter> permission_reporter_;
+
DISALLOW_COPY_AND_ASSIGN(SafeBrowsingPingManager);
};

Powered by Google App Engine
This is Rietveld 408576698