1 // Copyright 2018 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_NOTIFICATION_HELPER_NOTIFICATION_HELPER_CRASH_REPORTER_CLIENT_H_
6 #define CHROME_NOTIFICATION_HELPER_NOTIFICATION_HELPER_CRASH_REPORTER_CLIENT_H_
8 #include "base/files/file_path.h"
9 #include "components/crash/core/app/crash_reporter_client.h"
11 class NotificationHelperCrashReporterClient
12 : public crash_reporter::CrashReporterClient {
14 // Instantiates a process wide instance of the
15 // NotificationHelperCrashReporterClient class and initializes crash reporting
16 // for the process. The instance is leaked.
17 // Uses the crashpad handler embedded in the executable at |exe_path|.
18 static void InitializeCrashReportingForProcessWithHandler(
19 const base::FilePath& exe_path);
21 NotificationHelperCrashReporterClient();
23 NotificationHelperCrashReporterClient(
24 const NotificationHelperCrashReporterClient&) = delete;
25 NotificationHelperCrashReporterClient& operator=(
26 const NotificationHelperCrashReporterClient&) = delete;
28 ~NotificationHelperCrashReporterClient() override;
30 // crash_reporter::CrashReporterClient:
31 bool ShouldCreatePipeName(const std::wstring& process_type) override;
32 bool GetAlternativeCrashDumpLocation(std::wstring* crash_dir) override;
33 void GetProductNameAndVersion(const std::wstring& exe_path,
34 std::wstring* product_name,
35 std::wstring* version,
36 std::wstring* special_build,
37 std::wstring* channel_name) override;
38 bool ShouldShowRestartDialog(std::wstring* title,
39 std::wstring* message,
40 bool* is_rtl_locale) override;
41 bool AboutToRestart() override;
42 bool GetIsPerUserInstall() override;
43 bool GetShouldDumpLargerDumps() override;
44 int GetResultCodeRespawnFailed() override;
45 bool GetCrashDumpLocation(std::wstring* crash_dir) override;
46 bool GetCrashMetricsLocation(std::wstring* metrics_dir) override;
47 bool IsRunningUnattended() override;
48 bool GetCollectStatsConsent() override;
49 bool GetCollectStatsInSample() override;
50 bool ReportingIsEnforcedByPolicy(bool* enabled) override;
51 bool ShouldMonitorCrashHandlerExpensively() override;
52 bool EnableBreakpadForProcess(const std::string& process_type) override;
55 #endif // CHROME_NOTIFICATION_HELPER_NOTIFICATION_HELPER_CRASH_REPORTER_CLIENT_H_