| 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 #include "chrome/browser/safe_browsing/srt_chrome_prompt_impl.h" |
| 19 | 20 |
| 20 namespace base { | 21 namespace base { |
| 21 class FilePath; | 22 class FilePath; |
| 22 class TaskRunner; | 23 class TaskRunner; |
| 23 class Version; | 24 class Version; |
| 24 } | 25 } |
| 25 | 26 |
| 26 class Browser; | 27 class Browser; |
| 27 | 28 |
| 28 namespace safe_browsing { | 29 namespace safe_browsing { |
| 29 | 30 |
| 30 // A special exit code identifying a failure to run the reporter. | 31 // A special exit code identifying a failure to run the reporter. |
| 31 const int kReporterFailureExitCode = INT_MAX; | 32 const int kReporterNotLaunchedExitCode = INT_MAX; |
| 32 | 33 |
| 33 // The number of days to wait before triggering another reporter run. | 34 // The number of days to wait before triggering another reporter run. |
| 34 const int kDaysBetweenSuccessfulSwReporterRuns = 7; | 35 const int kDaysBetweenSuccessfulSwReporterRuns = 7; |
| 35 const int kDaysBetweenSwReporterRunsForPendingPrompt = 1; | 36 const int kDaysBetweenSwReporterRunsForPendingPrompt = 1; |
| 36 // The number of days to wait before sending out reporter logs. | 37 // The number of days to wait before sending out reporter logs. |
| 37 const int kDaysBetweenReporterLogsSent = 7; | 38 const int kDaysBetweenReporterLogsSent = 7; |
| 38 | 39 |
| 39 // When enabled, moves all user interaction with the Software Reporter and the | 40 // When enabled, moves all user interaction with the Software Reporter and the |
| 40 // Chrome Cleanup tool to Chrome. | 41 // Chrome Cleanup tool to Chrome. |
| 41 extern const base::Feature kInBrowserCleanerUIFeature; | 42 extern const base::Feature kInBrowserCleanerUIFeature; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 116 |
| 116 // Test mock for showing the prompt. | 117 // Test mock for showing the prompt. |
| 117 virtual void TriggerPrompt(Browser* browser, | 118 virtual void TriggerPrompt(Browser* browser, |
| 118 const std::string& reporter_version) = 0; | 119 const std::string& reporter_version) = 0; |
| 119 | 120 |
| 120 // Returns the test's idea of the current time. | 121 // Returns the test's idea of the current time. |
| 121 virtual base::Time Now() const = 0; | 122 virtual base::Time Now() const = 0; |
| 122 | 123 |
| 123 // A task runner used to spawn the reporter process (which blocks). | 124 // A task runner used to spawn the reporter process (which blocks). |
| 124 virtual base::TaskRunner* BlockingTaskRunner() const = 0; | 125 virtual base::TaskRunner* BlockingTaskRunner() const = 0; |
| 126 |
| 127 // Returns a ChromePromptImpl object that keeps track of specific actions |
| 128 // during execution. |
| 129 virtual std::unique_ptr<ChromePromptImpl> CreateChromePromptImpl( |
| 130 chrome_cleaner::mojom::ChromePromptRequest request) = 0; |
| 125 }; | 131 }; |
| 126 | 132 |
| 127 // Set a delegate for testing. The implementation will not take ownership of | 133 // Set a delegate for testing. The implementation will not take ownership of |
| 128 // |delegate| - it must remain valid until this function is called again to | 134 // |delegate| - it must remain valid until this function is called again to |
| 129 // reset the delegate. If |delegate| is nullptr, any previous delegate is | 135 // reset the delegate. If |delegate| is nullptr, any previous delegate is |
| 130 // cleared. | 136 // cleared. |
| 131 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate); | 137 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate); |
| 132 | 138 |
| 133 void DisplaySRTPromptForTesting(const base::FilePath& download_path); | 139 void DisplaySRTPromptForTesting(const base::FilePath& download_path); |
| 134 | 140 |
| 135 } // namespace safe_browsing | 141 } // namespace safe_browsing |
| 136 | 142 |
| 137 #endif // CHROME_BROWSER_SAFE_BROWSING_SRT_FETCHER_WIN_H_ | 143 #endif // CHROME_BROWSER_SAFE_BROWSING_SRT_FETCHER_WIN_H_ |
| OLD | NEW |