| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/chrome_browser_main_linux.h" | 5 #include "chrome/browser/chrome_browser_main_linux.h" |
| 6 | 6 |
| 7 #if !defined(OS_CHROMEOS) | 7 #if !defined(OS_CHROMEOS) |
| 8 #include "chrome/browser/storage_monitor/storage_monitor_linux.h" | 8 #include "chrome/browser/storage_monitor/storage_monitor_linux.h" |
| 9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
| 10 #endif | 10 #endif |
| 11 | 11 |
| 12 #if defined(USE_LINUX_BREAKPAD) | 12 #if defined(USE_LINUX_BREAKPAD) |
| 13 #include <stdlib.h> | 13 #include <stdlib.h> |
| 14 | 14 |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/linux_util.h" | 16 #include "base/linux_util.h" |
| 17 #include "base/prefs/pref_service.h" | 17 #include "base/prefs/pref_service.h" |
| 18 #include "chrome/app/breakpad_linux.h" | 18 #include "chrome/app/breakpad_linux.h" |
| 19 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
| 20 #include "chrome/common/env_vars.h" | 20 #include "chrome/common/env_vars.h" |
| 21 #include "chrome/common/pref_names.h" | 21 #include "chrome/common/pref_names.h" |
| 22 | 22 |
| 23 #if defined(OS_CHROMEOS) | 23 #if defined(OS_CHROMEOS) |
| 24 #include "chrome/browser/chromeos/settings/cros_settings.h" | 24 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 25 #include "chrome/browser/chromeos/settings/cros_settings_names.h" | 25 #include "chrome/browser/chromeos/settings/cros_settings_names.h" |
| 26 #include "chrome/common/chrome_version_info.h" | 26 #include "chrome/common/chrome_version_info.h" |
| 27 #include "chromeos/chromeos_switches.h" |
| 27 #endif | 28 #endif |
| 28 | 29 |
| 29 #endif // defined(USE_LINUX_BREAKPAD) | 30 #endif // defined(USE_LINUX_BREAKPAD) |
| 30 | 31 |
| 31 namespace { | 32 namespace { |
| 32 | 33 |
| 33 #if defined(USE_LINUX_BREAKPAD) | 34 #if defined(USE_LINUX_BREAKPAD) |
| 34 #if !defined(OS_CHROMEOS) | 35 #if !defined(OS_CHROMEOS) |
| 35 void GetLinuxDistroCallback() { | 36 void GetLinuxDistroCallback() { |
| 36 base::GetLinuxDistro(); // Initialize base::linux_distro if needed. | 37 base::GetLinuxDistro(); // Initialize base::linux_distro if needed. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 53 bool is_chrome_build = true; | 54 bool is_chrome_build = true; |
| 54 #else | 55 #else |
| 55 bool is_chrome_build = false; | 56 bool is_chrome_build = false; |
| 56 #endif | 57 #endif |
| 57 | 58 |
| 58 // Check these settings in Chrome builds only, to reduce the chance | 59 // Check these settings in Chrome builds only, to reduce the chance |
| 59 // that we accidentally upload crash dumps from Chromium builds. | 60 // that we accidentally upload crash dumps from Chromium builds. |
| 60 bool breakpad_enabled = false; | 61 bool breakpad_enabled = false; |
| 61 if (is_chrome_build) { | 62 if (is_chrome_build) { |
| 62 #if defined(OS_CHROMEOS) | 63 #if defined(OS_CHROMEOS) |
| 63 bool is_guest_session = | 64 bool is_guest_session = CommandLine::ForCurrentProcess()->HasSwitch( |
| 64 CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession); | 65 chromeos::switches::kGuestSession); |
| 65 bool is_stable_channel = | 66 bool is_stable_channel = |
| 66 chrome::VersionInfo::GetChannel() == | 67 chrome::VersionInfo::GetChannel() == |
| 67 chrome::VersionInfo::CHANNEL_STABLE; | 68 chrome::VersionInfo::CHANNEL_STABLE; |
| 68 // TODO(pastarmovj): Consider the TrustedGet here. | 69 // TODO(pastarmovj): Consider the TrustedGet here. |
| 69 bool reporting_enabled; | 70 bool reporting_enabled; |
| 70 chromeos::CrosSettings::Get()->GetBoolean(chromeos::kStatsReportingPref, | 71 chromeos::CrosSettings::Get()->GetBoolean(chromeos::kStatsReportingPref, |
| 71 &reporting_enabled); | 72 &reporting_enabled); |
| 72 breakpad_enabled = | 73 breakpad_enabled = |
| 73 !(is_guest_session && is_stable_channel) && reporting_enabled; | 74 !(is_guest_session && is_stable_channel) && reporting_enabled; |
| 74 #else | 75 #else |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 void ChromeBrowserMainPartsLinux::PostMainMessageLoopRun() { | 144 void ChromeBrowserMainPartsLinux::PostMainMessageLoopRun() { |
| 144 #if !defined(OS_CHROMEOS) | 145 #if !defined(OS_CHROMEOS) |
| 145 // Delete it now. Otherwise the FILE thread would be gone when we try to | 146 // Delete it now. Otherwise the FILE thread would be gone when we try to |
| 146 // release it in the dtor and Valgrind would report a leak on almost every | 147 // release it in the dtor and Valgrind would report a leak on almost every |
| 147 // single browser_test. | 148 // single browser_test. |
| 148 storage_monitor_.reset(); | 149 storage_monitor_.reset(); |
| 149 #endif | 150 #endif |
| 150 | 151 |
| 151 ChromeBrowserMainPartsPosix::PostMainMessageLoopRun(); | 152 ChromeBrowserMainPartsPosix::PostMainMessageLoopRun(); |
| 152 } | 153 } |
| OLD | NEW |