OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CHROME_BROWSER_SAFE_BROWSING_SRT_FETCHER_WIN_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_SRT_FETCHER_WIN_H_ |
6 #define CHROME_BROWSER_SAFE_BROWSING_SRT_FETCHER_WIN_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_SRT_FETCHER_WIN_H_ |
7 | 7 |
8 #include <limits.h> | 8 #include <limits.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 | 52 |
53 // Parameters used to invoke the sw_reporter component. | 53 // Parameters used to invoke the sw_reporter component. |
54 struct SwReporterInvocation { | 54 struct SwReporterInvocation { |
55 base::CommandLine command_line; | 55 base::CommandLine command_line; |
56 | 56 |
57 // Experimental versions of the reporter will write metrics to registry keys | 57 // Experimental versions of the reporter will write metrics to registry keys |
58 // ending in |suffix|. Those metrics should be copied to UMA histograms also | 58 // ending in |suffix|. Those metrics should be copied to UMA histograms also |
59 // ending in |suffix|. For the canonical version, |suffix| will be empty. | 59 // ending in |suffix|. For the canonical version, |suffix| will be empty. |
60 std::string suffix; | 60 std::string suffix; |
61 | 61 |
62 // Flags to control optional behaviours. By default all are enabled; | 62 // Flags to control behaviours the Software Reporter should support by |
63 // experimental versions of the reporter will turn off the behaviours that | 63 // default. These flags are set in the Reporter installer, and experimental |
64 // are not yet supported. | 64 // versions of the reporter will turn off the behaviours that are not yet |
65 using Flags = uint32_t; | 65 // supported. |
66 enum : Flags { | 66 using ReporterBehaviours = uint32_t; |
Joe Mason
2016/09/16 14:57:13
This could just be called "Behaviours" and the fla
ftirelo
2016/09/16 15:34:42
Done.
| |
67 FLAG_LOG_TO_RAPPOR = 0x1, | 67 enum : ReporterBehaviours { |
68 FLAG_LOG_EXIT_CODE_TO_PREFS = 0x2, | 68 REPORTER_BEHAVIOUR_LOG_TO_RAPPOR = 0x1, |
69 FLAG_TRIGGER_PROMPT = 0x4, | 69 REPORTER_BEHAVIOUR_LOG_EXIT_CODE_TO_PREFS = 0x2, |
70 FLAG_SEND_REPORTER_LOGS = 0x8, | 70 REPORTER_BEHAVIOUR_TRIGGER_PROMPT = 0x4, |
71 REPORTER_BEHAVIOUR_SEND_REPORTER_LOGS = 0x8, | |
71 }; | 72 }; |
72 Flags flags = 0; | 73 ReporterBehaviours supported_behaviours = 0; |
74 | |
75 // Whether logs upload was enabled in this invocation. | |
76 bool logs_upload_enabled = false; | |
73 | 77 |
74 SwReporterInvocation(); | 78 SwReporterInvocation(); |
75 | 79 |
76 static SwReporterInvocation FromFilePath(const base::FilePath& exe_path); | 80 static SwReporterInvocation FromFilePath(const base::FilePath& exe_path); |
77 static SwReporterInvocation FromCommandLine( | 81 static SwReporterInvocation FromCommandLine( |
78 const base::CommandLine& command_line); | 82 const base::CommandLine& command_line); |
79 | 83 |
80 bool operator==(const SwReporterInvocation& other) const; | 84 bool operator==(const SwReporterInvocation& other) const; |
81 }; | 85 }; |
82 | 86 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
132 | 136 |
133 // Set a delegate for testing. The implementation will not take ownership of | 137 // Set a delegate for testing. The implementation will not take ownership of |
134 // |delegate| - it must remain valid until this function is called again to | 138 // |delegate| - it must remain valid until this function is called again to |
135 // reset the delegate. If |delegate| is nullptr, any previous delegate is | 139 // reset the delegate. If |delegate| is nullptr, any previous delegate is |
136 // cleared. | 140 // cleared. |
137 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate); | 141 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate); |
138 | 142 |
139 } // namespace safe_browsing | 143 } // namespace safe_browsing |
140 | 144 |
141 #endif // CHROME_BROWSER_SAFE_BROWSING_SRT_FETCHER_WIN_H_ | 145 #endif // CHROME_BROWSER_SAFE_BROWSING_SRT_FETCHER_WIN_H_ |
OLD | NEW |