Home | History | Annotate | Download | only in app
      1 // Copyright 2013 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_APP_CHROME_BREAKPAD_CLIENT_H_
      6 #define CHROME_APP_CHROME_BREAKPAD_CLIENT_H_
      7 
      8 #include "base/basictypes.h"
      9 #include "base/compiler_specific.h"
     10 #include "components/breakpad/app/breakpad_client.h"
     11 
     12 namespace chrome {
     13 
     14 class ChromeBreakpadClient : public breakpad::BreakpadClient {
     15  public:
     16   ChromeBreakpadClient();
     17   virtual ~ChromeBreakpadClient();
     18 
     19   // breakpad::BreakpadClient implementation.
     20   virtual void SetClientID(const std::string& client_id) OVERRIDE;
     21 #if defined(OS_WIN)
     22   virtual bool GetAlternativeCrashDumpLocation(base::FilePath* crash_dir)
     23       OVERRIDE;
     24   virtual void GetProductNameAndVersion(const base::FilePath& exe_path,
     25                                         base::string16* product_name,
     26                                         base::string16* version,
     27                                         base::string16* special_build,
     28                                         base::string16* channel_name) OVERRIDE;
     29   virtual bool ShouldShowRestartDialog(base::string16* title,
     30                                        base::string16* message,
     31                                        bool* is_rtl_locale) OVERRIDE;
     32   virtual bool AboutToRestart() OVERRIDE;
     33   virtual bool GetDeferredUploadsSupported(bool is_per_user_install) OVERRIDE;
     34   virtual bool GetIsPerUserInstall(const base::FilePath& exe_path) OVERRIDE;
     35   virtual bool GetShouldDumpLargerDumps(bool is_per_user_install) OVERRIDE;
     36   virtual int GetResultCodeRespawnFailed() OVERRIDE;
     37   virtual void InitBrowserCrashDumpsRegKey() OVERRIDE;
     38   virtual void RecordCrashDumpAttempt(bool is_real_crash) OVERRIDE;
     39 #endif
     40 
     41 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS)
     42   virtual void GetProductNameAndVersion(std::string* product_name,
     43                                         std::string* version) OVERRIDE;
     44   virtual base::FilePath GetReporterLogFilename() OVERRIDE;
     45 #endif
     46 
     47   virtual bool GetCrashDumpLocation(base::FilePath* crash_dir) OVERRIDE;
     48 
     49   virtual size_t RegisterCrashKeys() OVERRIDE;
     50 
     51   virtual bool IsRunningUnattended() OVERRIDE;
     52 
     53   virtual bool GetCollectStatsConsent() OVERRIDE;
     54 
     55 #if defined(OS_WIN) || defined(OS_MACOSX)
     56   virtual bool ReportingIsEnforcedByPolicy(bool* breakpad_enabled) OVERRIDE;
     57 #endif
     58 
     59 #if defined(OS_ANDROID)
     60   virtual int GetAndroidMinidumpDescriptor() OVERRIDE;
     61 #endif
     62 
     63 #if defined(OS_MACOSX)
     64   virtual void InstallAdditionalFilters(BreakpadRef breakpad) OVERRIDE;
     65 #endif
     66 
     67   virtual bool EnableBreakpadForProcess(
     68       const std::string& process_type) OVERRIDE;
     69 
     70  private:
     71   DISALLOW_COPY_AND_ASSIGN(ChromeBreakpadClient);
     72 };
     73 
     74 }  // namespace chrome
     75 
     76 #endif  // CHROME_APP_CHROME_BREAKPAD_CLIENT_H_
     77