| 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_android.h" | 5 #include "chrome/browser/chrome_browser_main_android.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" |
| 7 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 8 #include "chrome/app/breakpad_linux.h" | 9 #include "chrome/app/breakpad_linux.h" |
| 9 #include "chrome/browser/android/crash_dump_manager.h" | 10 #include "chrome/browser/android/crash_dump_manager.h" |
| 10 #include "chrome/common/env_vars.h" | 11 #include "chrome/common/chrome_switches.h" |
| 11 #include "content/public/browser/android/compositor.h" | 12 #include "content/public/browser/android/compositor.h" |
| 12 #include "content/public/common/main_function_params.h" | 13 #include "content/public/common/main_function_params.h" |
| 13 #include "net/android/network_change_notifier_factory_android.h" | 14 #include "net/android/network_change_notifier_factory_android.h" |
| 14 #include "net/base/network_change_notifier.h" | 15 #include "net/base/network_change_notifier.h" |
| 15 #include "ui/base/resource/resource_bundle.h" | 16 #include "ui/base/resource/resource_bundle.h" |
| 16 #include "ui/base/ui_base_paths.h" | 17 #include "ui/base/ui_base_paths.h" |
| 17 | 18 |
| 18 ChromeBrowserMainPartsAndroid::ChromeBrowserMainPartsAndroid( | 19 ChromeBrowserMainPartsAndroid::ChromeBrowserMainPartsAndroid( |
| 19 const content::MainFunctionParams& parameters) | 20 const content::MainFunctionParams& parameters) |
| 20 : ChromeBrowserMainParts(parameters) { | 21 : ChromeBrowserMainParts(parameters) { |
| 21 } | 22 } |
| 22 | 23 |
| 23 ChromeBrowserMainPartsAndroid::~ChromeBrowserMainPartsAndroid() { | 24 ChromeBrowserMainPartsAndroid::~ChromeBrowserMainPartsAndroid() { |
| 24 } | 25 } |
| 25 | 26 |
| 26 void ChromeBrowserMainPartsAndroid::PreProfileInit() { | 27 void ChromeBrowserMainPartsAndroid::PreProfileInit() { |
| 27 #if defined(USE_LINUX_BREAKPAD) | 28 #if defined(USE_LINUX_BREAKPAD) |
| 28 #if defined(GOOGLE_CHROME_BUILD) | 29 #if defined(GOOGLE_CHROME_BUILD) |
| 29 // TODO(jcivelli): we should not initialize the crash-reporter when it was not | 30 // TODO(jcivelli): we should not initialize the crash-reporter when it was not |
| 30 // enabled. Right now if it is disabled we still generate the minidumps but we | 31 // enabled. Right now if it is disabled we still generate the minidumps but we |
| 31 // do not upload them. | 32 // do not upload them. |
| 32 bool breakpad_enabled = true; | 33 bool breakpad_enabled = true; |
| 33 #else | 34 #else |
| 34 bool breakpad_enabled = false; | 35 bool breakpad_enabled = false; |
| 35 #endif | 36 #endif |
| 37 |
| 36 // Allow Breakpad to be enabled in Chromium builds for testing purposes. | 38 // Allow Breakpad to be enabled in Chromium builds for testing purposes. |
| 37 if (!breakpad_enabled) | 39 if (!breakpad_enabled) |
| 38 breakpad_enabled = getenv(env_vars::kEnableBreakpad) != NULL; | 40 breakpad_enabled = CommandLine::ForCurrentProcess()->HasSwitch( |
| 41 switches::kEnableCrashReporterForTesting); |
| 39 | 42 |
| 40 if (breakpad_enabled) { | 43 if (breakpad_enabled) { |
| 41 InitCrashReporter(); | 44 InitCrashReporter(); |
| 42 crash_dump_manager_.reset(new CrashDumpManager()); | 45 crash_dump_manager_.reset(new CrashDumpManager()); |
| 43 } | 46 } |
| 44 #endif | 47 #endif |
| 45 | 48 |
| 46 ChromeBrowserMainParts::PreProfileInit(); | 49 ChromeBrowserMainParts::PreProfileInit(); |
| 47 } | 50 } |
| 48 | 51 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 79 NOTREACHED(); | 82 NOTREACHED(); |
| 80 } | 83 } |
| 81 | 84 |
| 82 void RecordBreakpadStatusUMA(MetricsService* metrics) { | 85 void RecordBreakpadStatusUMA(MetricsService* metrics) { |
| 83 // TODO: crbug.com/139023 | 86 // TODO: crbug.com/139023 |
| 84 NOTIMPLEMENTED(); | 87 NOTIMPLEMENTED(); |
| 85 } | 88 } |
| 86 | 89 |
| 87 void WarnAboutMinimumSystemRequirements() { | 90 void WarnAboutMinimumSystemRequirements() { |
| 88 } | 91 } |
| OLD | NEW |