| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" | 42 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
| 43 #include "chrome/browser/extensions/extension_protocols.h" | 43 #include "chrome/browser/extensions/extension_protocols.h" |
| 44 #include "chrome/browser/extensions/extensions_service.h" | 44 #include "chrome/browser/extensions/extensions_service.h" |
| 45 #include "chrome/browser/first_run/first_run.h" | 45 #include "chrome/browser/first_run/first_run.h" |
| 46 #include "chrome/browser/jankometer.h" | 46 #include "chrome/browser/jankometer.h" |
| 47 #include "chrome/browser/labs.h" | 47 #include "chrome/browser/labs.h" |
| 48 #include "chrome/browser/metrics/histogram_synchronizer.h" | 48 #include "chrome/browser/metrics/histogram_synchronizer.h" |
| 49 #include "chrome/browser/metrics/metrics_log.h" | 49 #include "chrome/browser/metrics/metrics_log.h" |
| 50 #include "chrome/browser/metrics/metrics_service.h" | 50 #include "chrome/browser/metrics/metrics_service.h" |
| 51 #include "chrome/browser/net/blob_url_request_job_factory.h" | 51 #include "chrome/browser/net/blob_url_request_job_factory.h" |
| 52 #include "chrome/browser/net/chrome_url_request_context.h" |
| 53 #include "chrome/browser/net/metadata_url_request.h" |
| 52 #include "chrome/browser/net/predictor_api.h" | 54 #include "chrome/browser/net/predictor_api.h" |
| 53 #include "chrome/browser/net/metadata_url_request.h" | |
| 54 #include "chrome/browser/net/sdch_dictionary_fetcher.h" | 55 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
| 55 #include "chrome/browser/net/websocket_experiment/websocket_experiment_runner.h" | 56 #include "chrome/browser/net/websocket_experiment/websocket_experiment_runner.h" |
| 56 #include "chrome/browser/plugin_service.h" | 57 #include "chrome/browser/plugin_service.h" |
| 57 #include "chrome/browser/prefs/pref_service.h" | 58 #include "chrome/browser/prefs/pref_service.h" |
| 58 #include "chrome/browser/prefs/pref_value_store.h" | 59 #include "chrome/browser/prefs/pref_value_store.h" |
| 59 #include "chrome/browser/process_singleton.h" | 60 #include "chrome/browser/process_singleton.h" |
| 60 #include "chrome/browser/profile.h" | 61 #include "chrome/browser/profile.h" |
| 61 #include "chrome/browser/profile_manager.h" | 62 #include "chrome/browser/profile_manager.h" |
| 62 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 63 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
| 63 #include "chrome/browser/search_engines/template_url.h" | 64 #include "chrome/browser/search_engines/template_url.h" |
| (...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1185 | 1186 |
| 1186 Profile* profile = CreateProfile(parameters, user_data_dir); | 1187 Profile* profile = CreateProfile(parameters, user_data_dir); |
| 1187 if (!profile) | 1188 if (!profile) |
| 1188 return ResultCodes::NORMAL_EXIT; | 1189 return ResultCodes::NORMAL_EXIT; |
| 1189 | 1190 |
| 1190 // Post-profile init --------------------------------------------------------- | 1191 // Post-profile init --------------------------------------------------------- |
| 1191 | 1192 |
| 1192 PrefService* user_prefs = profile->GetPrefs(); | 1193 PrefService* user_prefs = profile->GetPrefs(); |
| 1193 DCHECK(user_prefs); | 1194 DCHECK(user_prefs); |
| 1194 | 1195 |
| 1196 profile->GetDefaultRequestContext()->set_is_main(true); |
| 1197 |
| 1195 // Convert active labs into switches. Modifies the current command line. | 1198 // Convert active labs into switches. Modifies the current command line. |
| 1196 about_labs::ConvertLabsToSwitches(profile, CommandLine::ForCurrentProcess()); | 1199 about_labs::ConvertLabsToSwitches(profile, CommandLine::ForCurrentProcess()); |
| 1197 | 1200 |
| 1198 // Tests should be able to tune login manager before showing it. | 1201 // Tests should be able to tune login manager before showing it. |
| 1199 // Thus only show login manager in normal (non-testing) mode. | 1202 // Thus only show login manager in normal (non-testing) mode. |
| 1200 if (!parameters.ui_task) { | 1203 if (!parameters.ui_task) { |
| 1201 OptionallyRunChromeOSLoginManager(parsed_command_line); | 1204 OptionallyRunChromeOSLoginManager(parsed_command_line); |
| 1202 } | 1205 } |
| 1203 | 1206 |
| 1204 #if !defined(OS_MACOSX) | 1207 #if !defined(OS_MACOSX) |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1506 metrics->Stop(); | 1509 metrics->Stop(); |
| 1507 | 1510 |
| 1508 // browser_shutdown takes care of deleting browser_process, so we need to | 1511 // browser_shutdown takes care of deleting browser_process, so we need to |
| 1509 // release it. | 1512 // release it. |
| 1510 ignore_result(browser_process.release()); | 1513 ignore_result(browser_process.release()); |
| 1511 browser_shutdown::Shutdown(); | 1514 browser_shutdown::Shutdown(); |
| 1512 | 1515 |
| 1513 TRACE_EVENT_END("BrowserMain", 0, 0); | 1516 TRACE_EVENT_END("BrowserMain", 0, 0); |
| 1514 return result_code; | 1517 return result_code; |
| 1515 } | 1518 } |
| OLD | NEW |