summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/google_update_settings_posix.cc9
-rw-r--r--chrome/common/chrome_switches.cc2
2 files changed, 8 insertions, 3 deletions
diff --git a/chrome/browser/google_update_settings_posix.cc b/chrome/browser/google_update_settings_posix.cc
index bc35bbc..defe492 100644
--- a/chrome/browser/google_update_settings_posix.cc
+++ b/chrome/browser/google_update_settings_posix.cc
@@ -4,12 +4,14 @@
#include "chrome/installer/util/google_update_settings.h"
+#include "base/command_line.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/rand_util.h"
#include "base/string_util.h"
#include "chrome/common/chrome_paths.h"
+#include "chrome/common/chrome_switches.h"
#if !defined(OS_MACOSX)
namespace google_update {
@@ -23,6 +25,8 @@ static const int kGuidLen = sizeof(uint64) * 4; // 128 bits -> 32 bytes hex.
// static
bool GoogleUpdateSettings::GetCollectStatsConsent() {
+ bool forced_enable = CommandLine::ForCurrentProcess()->
+ HasSwitch(switches::kEnableCrashReporter);
#if defined(OS_MACOSX)
std::string linux_guid;
#else
@@ -31,10 +35,9 @@ bool GoogleUpdateSettings::GetCollectStatsConsent() {
FilePath consent_file;
PathService::Get(chrome::DIR_USER_DATA, &consent_file);
consent_file = consent_file.Append(kConsentToSendStats);
- bool r = file_util::ReadFileToString(consent_file,
- &linux_guid);
+ bool consented = file_util::ReadFileToString(consent_file, &linux_guid);
linux_guid.resize(kGuidLen, '0');
- return r;
+ return forced_enable || consented;
}
// static
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index c38bcfa..121feba 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -655,6 +655,8 @@ const char kAutoSSLClientAuth[] = "auto-ssl-client-auth";
// command lines on Linux and Mac. It tells the helper process to enable crash
// dumping and reporting, because helpers cannot access the profile or other
// files needed to make this decision.
+// If passed to the browser, it'll be passed on to all the helper processes
+// as well, thereby force-enabling the crash reporter.
const char kEnableCrashReporter[] = "enable-crash-reporter";
// This switch is used during automated testing.