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 #include "components/crash/app/crash_reporter_client.h"
      6 
      7 #include "base/files/file_path.h"
      8 #include "base/logging.h"
      9 
     10 namespace crash_reporter {
     11 
     12 namespace {
     13 
     14 CrashReporterClient* g_client = NULL;
     15 
     16 }  // namespace
     17 
     18 void SetCrashReporterClient(CrashReporterClient* client) {
     19   g_client = client;
     20 }
     21 
     22 CrashReporterClient* GetCrashReporterClient() {
     23   DCHECK(g_client);
     24   return g_client;
     25 }
     26 
     27 CrashReporterClient::CrashReporterClient() {}
     28 CrashReporterClient::~CrashReporterClient() {}
     29 
     30 void CrashReporterClient::SetCrashReporterClientIdFromGUID(
     31     const std::string& client_guid) {
     32 }
     33 
     34 #if defined(OS_WIN)
     35 bool CrashReporterClient::GetAlternativeCrashDumpLocation(
     36     base::FilePath* crash_dir) {
     37   return false;
     38 }
     39 
     40 void CrashReporterClient::GetProductNameAndVersion(
     41     const base::FilePath& exe_path,
     42     base::string16* product_name,
     43     base::string16* version,
     44     base::string16* special_build,
     45     base::string16* channel_name) {
     46 }
     47 
     48 bool CrashReporterClient::ShouldShowRestartDialog(base::string16* title,
     49                                                   base::string16* message,
     50                                                   bool* is_rtl_locale) {
     51   return false;
     52 }
     53 
     54 bool CrashReporterClient::AboutToRestart() {
     55   return false;
     56 }
     57 
     58 bool CrashReporterClient::GetDeferredUploadsSupported(bool is_per_usr_install) {
     59   return false;
     60 }
     61 
     62 bool CrashReporterClient::GetIsPerUserInstall(const base::FilePath& exe_path) {
     63   return true;
     64 }
     65 
     66 bool CrashReporterClient::GetShouldDumpLargerDumps(bool is_per_user_install) {
     67   return false;
     68 }
     69 
     70 int CrashReporterClient::GetResultCodeRespawnFailed() {
     71   return 0;
     72 }
     73 
     74 void CrashReporterClient::InitBrowserCrashDumpsRegKey() {
     75 }
     76 
     77 void CrashReporterClient::RecordCrashDumpAttempt(bool is_real_crash) {
     78 }
     79 #endif
     80 
     81 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS)
     82 void CrashReporterClient::GetProductNameAndVersion(std::string* product_name,
     83                                                    std::string* version) {
     84 }
     85 
     86 base::FilePath CrashReporterClient::GetReporterLogFilename() {
     87   return base::FilePath();
     88 }
     89 #endif
     90 
     91 bool CrashReporterClient::GetCrashDumpLocation(base::FilePath* crash_dir) {
     92   return false;
     93 }
     94 
     95 size_t CrashReporterClient::RegisterCrashKeys() {
     96   return 0;
     97 }
     98 
     99 bool CrashReporterClient::IsRunningUnattended() {
    100   return true;
    101 }
    102 
    103 bool CrashReporterClient::GetCollectStatsConsent() {
    104   return false;
    105 }
    106 
    107 #if defined(OS_WIN) || defined(OS_MACOSX)
    108 bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
    109   return false;
    110 }
    111 #endif
    112 
    113 #if defined(OS_ANDROID)
    114 int CrashReporterClient::GetAndroidMinidumpDescriptor() {
    115   return 0;
    116 }
    117 #endif
    118 
    119 #if defined(OS_MACOSX)
    120 void CrashReporterClient::InstallAdditionalFilters(BreakpadRef breakpad) {
    121 }
    122 #endif
    123 
    124 bool CrashReporterClient::EnableBreakpadForProcess(
    125     const std::string& process_type) {
    126   return false;
    127 }
    128 
    129 }  // namespace crash_reporter
    130