| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser_main.h" | 5 #include "chrome/browser/browser_main.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 #include "chrome/browser/profile_manager.h" | 54 #include "chrome/browser/profile_manager.h" |
| 55 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 55 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
| 56 #include "chrome/browser/search_engines/template_url_model.h" | 56 #include "chrome/browser/search_engines/template_url_model.h" |
| 57 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" | 57 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" |
| 58 #include "chrome/browser/shell_integration.h" | 58 #include "chrome/browser/shell_integration.h" |
| 59 #if !defined(OS_WIN) | 59 #if !defined(OS_WIN) |
| 60 #include "chrome/browser/translate/translate_manager.h" | 60 #include "chrome/browser/translate/translate_manager.h" |
| 61 #else | 61 #else |
| 62 #include "chrome/browser/translate/translate_manager2.h" | 62 #include "chrome/browser/translate/translate_manager2.h" |
| 63 #endif | 63 #endif |
| 64 #include "chrome/common/child_process.h" |
| 64 #include "chrome/common/chrome_constants.h" | 65 #include "chrome/common/chrome_constants.h" |
| 65 #include "chrome/common/chrome_paths.h" | 66 #include "chrome/common/chrome_paths.h" |
| 66 #include "chrome/common/chrome_switches.h" | 67 #include "chrome/common/chrome_switches.h" |
| 67 #include "chrome/common/json_pref_store.h" | 68 #include "chrome/common/json_pref_store.h" |
| 68 #include "chrome/common/jstemplate_builder.h" | 69 #include "chrome/common/jstemplate_builder.h" |
| 69 #include "chrome/common/main_function_params.h" | 70 #include "chrome/common/main_function_params.h" |
| 70 #include "chrome/common/net/net_resource_provider.h" | 71 #include "chrome/common/net/net_resource_provider.h" |
| 71 #include "chrome/common/pref_names.h" | 72 #include "chrome/common/pref_names.h" |
| 72 #include "chrome/common/result_codes.h" | 73 #include "chrome/common/result_codes.h" |
| 73 #include "chrome/installer/util/google_update_settings.h" | 74 #include "chrome/installer/util/google_update_settings.h" |
| (...skipping 1292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1366 // See issue 40144. | 1367 // See issue 40144. |
| 1367 profile->GetExtensionsService()->InitEventRouters(); | 1368 profile->GetExtensionsService()->InitEventRouters(); |
| 1368 } | 1369 } |
| 1369 | 1370 |
| 1370 #if defined(OS_WIN) | 1371 #if defined(OS_WIN) |
| 1371 // We check this here because if the profile is OTR (chromeos possibility) | 1372 // We check this here because if the profile is OTR (chromeos possibility) |
| 1372 // it won't still be accessible after browser is destroyed. | 1373 // it won't still be accessible after browser is destroyed. |
| 1373 bool record_search_engine = is_first_run && !profile->IsOffTheRecord(); | 1374 bool record_search_engine = is_first_run && !profile->IsOffTheRecord(); |
| 1374 #endif | 1375 #endif |
| 1375 | 1376 |
| 1377 // ChildProcess:: is a misnomer unless you consider context. Use |
| 1378 // of --wait-for-debugger only makes sense when Chrome itself is a |
| 1379 // child process (e.g. when launched by PyAuto). |
| 1380 if (parsed_command_line.HasSwitch(switches::kWaitForDebugger)) { |
| 1381 ChildProcess::WaitForDebugger(L"Browser"); |
| 1382 } |
| 1383 |
| 1384 |
| 1376 int result_code = ResultCodes::NORMAL_EXIT; | 1385 int result_code = ResultCodes::NORMAL_EXIT; |
| 1377 if (parameters.ui_task) { | 1386 if (parameters.ui_task) { |
| 1378 // We are in test mode. Run one task and enter the main message loop. | 1387 // We are in test mode. Run one task and enter the main message loop. |
| 1379 if (pool) | 1388 if (pool) |
| 1380 pool->Recycle(); | 1389 pool->Recycle(); |
| 1381 parameters.ui_task->Run(); | 1390 parameters.ui_task->Run(); |
| 1382 delete parameters.ui_task; | 1391 delete parameters.ui_task; |
| 1383 } else { | 1392 } else { |
| 1384 // We are in regular browser boot sequence. Open initial stabs and enter | 1393 // We are in regular browser boot sequence. Open initial stabs and enter |
| 1385 // the main message loop. | 1394 // the main message loop. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1441 | 1450 |
| 1442 metrics->Stop(); | 1451 metrics->Stop(); |
| 1443 | 1452 |
| 1444 // browser_shutdown takes care of deleting browser_process, so we need to | 1453 // browser_shutdown takes care of deleting browser_process, so we need to |
| 1445 // release it. | 1454 // release it. |
| 1446 ignore_result(browser_process.release()); | 1455 ignore_result(browser_process.release()); |
| 1447 browser_shutdown::Shutdown(); | 1456 browser_shutdown::Shutdown(); |
| 1448 | 1457 |
| 1449 return result_code; | 1458 return result_code; |
| 1450 } | 1459 } |
| OLD | NEW |