| 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 |
| 11 #include <queue> | 11 #include <queue> |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/feature_list.h" | 15 #include "base/feature_list.h" |
| 16 #include "base/process/launch.h" | 16 #include "base/process/launch.h" |
| 17 #include "base/process/process.h" | 17 #include "base/process/process.h" |
| 18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 class FilePath; | 21 class FilePath; |
| 22 class TaskRunner; | 22 class TaskRunner; |
| 23 class Version; | 23 class Version; |
| 24 } | 24 } |
| 25 | 25 |
| 26 class Browser; | 26 class Browser; |
| 27 | 27 |
| 28 namespace safe_browsing { | 28 namespace safe_browsing { |
| 29 | 29 |
| 30 // SRT registry keys and value names. | |
| 31 extern const wchar_t kSoftwareRemovalToolRegistryKey[]; | |
| 32 extern const wchar_t kEndTimeValueName[]; | |
| 33 extern const wchar_t kStartTimeValueName[]; | |
| 34 | |
| 35 // Reporter exit codes. | |
| 36 const int kSwReporterCleanupNeeded = 0; | |
| 37 const int kSwReporterNothingFound = 2; | |
| 38 const int kSwReporterPostRebootCleanupNeeded = 4; | |
| 39 const int kSwReporterDelayedPostRebootCleanupNeeded = 15; | |
| 40 | |
| 41 // A special exit code identifying a failure to run the reporter. | 30 // A special exit code identifying a failure to run the reporter. |
| 42 const int kReporterFailureExitCode = INT_MAX; | 31 const int kReporterFailureExitCode = INT_MAX; |
| 43 | 32 |
| 44 // The number of days to wait before triggering another reporter run. | 33 // The number of days to wait before triggering another reporter run. |
| 45 const int kDaysBetweenSuccessfulSwReporterRuns = 7; | 34 const int kDaysBetweenSuccessfulSwReporterRuns = 7; |
| 46 const int kDaysBetweenSwReporterRunsForPendingPrompt = 1; | 35 const int kDaysBetweenSwReporterRunsForPendingPrompt = 1; |
| 47 // The number of days to wait before sending out reporter logs. | 36 // The number of days to wait before sending out reporter logs. |
| 48 const int kDaysBetweenReporterLogsSent = 7; | 37 const int kDaysBetweenReporterLogsSent = 7; |
| 49 | 38 |
| 50 // When enabled, moves all user interaction with the Software Reporter and the | 39 // When enabled, moves all user interaction with the Software Reporter and the |
| 51 // Chrome Cleanup tool to Chrome. | 40 // Chrome Cleanup tool to Chrome. |
| 52 extern const base::Feature kInBrowserCleanerUIFeature; | 41 extern const base::Feature kInBrowserCleanerUIFeature; |
| 53 | 42 |
| 54 // The switch to be passed to the Software Reporter process with the Mojo pipe | |
| 55 // token for the IPC communication with Chrome. | |
| 56 // TODO(crbug/709035) Move this to //components/chrome_cleaner. | |
| 57 extern const char kChromeMojoPipeTokenSwitch[]; | |
| 58 | |
| 59 // Parameters used to invoke the sw_reporter component. | 43 // Parameters used to invoke the sw_reporter component. |
| 60 struct SwReporterInvocation { | 44 struct SwReporterInvocation { |
| 61 base::CommandLine command_line; | 45 base::CommandLine command_line; |
| 62 | 46 |
| 63 // Experimental versions of the reporter will write metrics to registry keys | 47 // Experimental versions of the reporter will write metrics to registry keys |
| 64 // ending in |suffix|. Those metrics should be copied to UMA histograms also | 48 // ending in |suffix|. Those metrics should be copied to UMA histograms also |
| 65 // ending in |suffix|. For the canonical version, |suffix| will be empty. | 49 // ending in |suffix|. For the canonical version, |suffix| will be empty. |
| 66 std::string suffix; | 50 std::string suffix; |
| 67 | 51 |
| 68 // Flags to control behaviours the Software Reporter should support by | 52 // Flags to control behaviours the Software Reporter should support by |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // |delegate| - it must remain valid until this function is called again to | 128 // |delegate| - it must remain valid until this function is called again to |
| 145 // reset the delegate. If |delegate| is nullptr, any previous delegate is | 129 // reset the delegate. If |delegate| is nullptr, any previous delegate is |
| 146 // cleared. | 130 // cleared. |
| 147 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate); | 131 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate); |
| 148 | 132 |
| 149 void DisplaySRTPromptForTesting(const base::FilePath& download_path); | 133 void DisplaySRTPromptForTesting(const base::FilePath& download_path); |
| 150 | 134 |
| 151 } // namespace safe_browsing | 135 } // namespace safe_browsing |
| 152 | 136 |
| 153 #endif // CHROME_BROWSER_SAFE_BROWSING_SRT_FETCHER_WIN_H_ | 137 #endif // CHROME_BROWSER_SAFE_BROWSING_SRT_FETCHER_WIN_H_ |
| OLD | NEW |