| 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/app/chrome_main_delegate.h" | 5 #include "chrome/app/chrome_main_delegate.h" |
| 6 | 6 |
| 7 #include "base/base_paths.h" | |
| 8 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 9 #include "base/cpu.h" | 8 #include "base/cpu.h" |
| 10 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 11 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| 12 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 13 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 14 #include "base/metrics/statistics_recorder.h" | 13 #include "base/metrics/statistics_recorder.h" |
| 15 #include "base/metrics/stats_counters.h" | 14 #include "base/metrics/stats_counters.h" |
| 16 #include "base/path_service.h" | 15 #include "base/path_service.h" |
| 17 #include "base/process/memory.h" | 16 #include "base/process/memory.h" |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 | 469 |
| 471 diagnostics::DiagnosticsWriter writer(format); | 470 diagnostics::DiagnosticsWriter writer(format); |
| 472 *exit_code = diagnostics::DiagnosticsController::GetInstance()->Run( | 471 *exit_code = diagnostics::DiagnosticsController::GetInstance()->Run( |
| 473 command_line, &writer); | 472 command_line, &writer); |
| 474 diagnostics::DiagnosticsController::GetInstance()->ClearResults(); | 473 diagnostics::DiagnosticsController::GetInstance()->ClearResults(); |
| 475 return true; | 474 return true; |
| 476 } | 475 } |
| 477 #endif | 476 #endif |
| 478 | 477 |
| 479 #if defined(OS_CHROMEOS) | 478 #if defined(OS_CHROMEOS) |
| 480 // Initialize primary user homedir (in multi-profile session) as it may be | |
| 481 // passed as a command line switch. | |
| 482 base::FilePath homedir; | |
| 483 if (command_line.HasSwitch(chromeos::switches::kHomedir)) { | |
| 484 homedir = base::FilePath( | |
| 485 command_line.GetSwitchValueASCII(chromeos::switches::kHomedir)); | |
| 486 PathService::OverrideAndCreateIfNeeded( | |
| 487 base::DIR_HOME, homedir, true, false); | |
| 488 } | |
| 489 | |
| 490 // If we are recovering from a crash on ChromeOS, then we will do some | 479 // If we are recovering from a crash on ChromeOS, then we will do some |
| 491 // recovery using the diagnostics module, and then continue on. We fake up a | 480 // recovery using the diagnostics module, and then continue on. We fake up a |
| 492 // command line to tell it that we want it to recover, and to preserve the | 481 // command line to tell it that we want it to recover, and to preserve the |
| 493 // original command line. | 482 // original command line. |
| 494 if (command_line.HasSwitch(chromeos::switches::kLoginUser) || | 483 if (command_line.HasSwitch(chromeos::switches::kLoginUser) || |
| 495 command_line.HasSwitch(switches::kDiagnosticsRecovery)) { | 484 command_line.HasSwitch(switches::kDiagnosticsRecovery)) { |
| 496 | 485 |
| 497 // The statistics subsystem needs get initialized soon enough for the | 486 // The statistics subsystem needs get initialized soon enough for the |
| 498 // statistics to be collected. It's safe to call this more than once. | 487 // statistics to be collected. It's safe to call this more than once. |
| 499 base::StatisticsRecorder::Initialize(); | 488 base::StatisticsRecorder::Initialize(); |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 920 } | 909 } |
| 921 | 910 |
| 922 content::ContentUtilityClient* | 911 content::ContentUtilityClient* |
| 923 ChromeMainDelegate::CreateContentUtilityClient() { | 912 ChromeMainDelegate::CreateContentUtilityClient() { |
| 924 #if defined(CHROME_MULTIPLE_DLL_BROWSER) | 913 #if defined(CHROME_MULTIPLE_DLL_BROWSER) |
| 925 return NULL; | 914 return NULL; |
| 926 #else | 915 #else |
| 927 return g_chrome_content_utility_client.Pointer(); | 916 return g_chrome_content_utility_client.Pointer(); |
| 928 #endif | 917 #endif |
| 929 } | 918 } |
| OLD | NEW |