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