OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_SAFE_BROWSING_PERMISSION_REPORTER_H_ | |
6 #define CHROME_BROWSER_SAFE_BROWSING_PERMISSION_REPORTER_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "chrome/browser/permissions/permission_uma_util.h" | |
11 #include "chrome/common/safe_browsing/permission_report.pb.h" | |
12 #include "net/url_request/certificate_report_sender.h" | |
13 #include "url/gurl.h" | |
14 | |
15 namespace net { | |
16 class URLRequestContext; | |
17 } // namespace net | |
18 | |
19 namespace safe_browsing { | |
20 | |
21 // Provides functionality for building and serializing reports about permission | |
kcarattini
2016/05/31 03:13:38
s/permission/permissions/
stefanocs
2016/05/31 03:34:22
Done.
| |
22 // to a report collection server. | |
23 class PermissionReporter { | |
24 public: | |
25 // Creates a permission reporter that will send permission reports to | |
26 // |upload_url|, using |request_context| as the context for the reports. | |
27 PermissionReporter( | |
28 net::URLRequestContext* request_context, | |
kcarattini
2016/05/31 03:13:38
You can move this up to the previous line.
stefanocs
2016/05/31 03:34:23
Done.
| |
29 const GURL& upload_url); | |
30 | |
31 virtual ~PermissionReporter(); | |
32 | |
33 // Sends a permission report to the report collection server. The | |
34 // |serialized_report| is expected to be a serialized protobuf implemented in | |
kcarattini
2016/05/31 03:13:38
"A serialized protobuf of type PermissionReport de
stefanocs
2016/05/31 03:34:22
Done.
| |
35 // //src/chrome/common/safe_browsing/permission_report.proto | |
36 virtual void SendReport(const std::string& serialized_report); | |
37 | |
38 // Builds a permission report with |origin| as the origin of the site | |
39 // requesting permission, |permission| as the type of permission requested, | |
40 // and |action| as the action taken. | |
41 static PermissionReport BuildReport( | |
kcarattini
2016/05/31 03:13:38
This is fine for now, though if the list of argume
stefanocs
2016/05/31 03:34:22
Can the other required information obtained within
kcarattini
2016/05/31 03:53:36
I'm not certain yet but some of it definitely will
stefanocs
2016/05/31 04:04:12
Acknowledged.
| |
42 const GURL& origin, | |
kcarattini
2016/05/31 03:13:38
Can move this up a line too.
stefanocs
2016/05/31 03:34:23
Done.
| |
43 content::PermissionType permission, | |
44 PermissionAction action); | |
45 | |
46 private: | |
47 // TODO(stefanocs): Refactor permission report sender to use the more generic | |
48 // report sender class when it has been implemented. | |
kcarattini
2016/05/31 03:13:38
Isn't it CertificateReportSender that you want to
stefanocs
2016/05/31 03:34:23
What I meant is that since we are probably going t
kcarattini
2016/05/31 03:53:36
Ah, I see. i don't think you need a todo for that
stefanocs
2016/05/31 04:04:12
Done.
| |
49 std::unique_ptr<net::CertificateReportSender> permission_report_sender_; | |
50 | |
51 const GURL upload_url_; | |
52 | |
53 DISALLOW_COPY_AND_ASSIGN(PermissionReporter); | |
54 }; | |
55 | |
56 } // namespace safe_browsing | |
57 | |
58 #endif // CHROME_BROWSER_SAFE_BROWSING_PERMISSION_REPORTER_H_ | |
OLD | NEW |