| 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 25 matching lines...) Expand all Loading... |
| 36 #include "chrome/browser/prefs/browser_prefs.h" | 36 #include "chrome/browser/prefs/browser_prefs.h" |
| 37 #include "chrome/browser/browser_process.h" | 37 #include "chrome/browser/browser_process.h" |
| 38 #include "chrome/browser/browser_process_impl.h" | 38 #include "chrome/browser/browser_process_impl.h" |
| 39 #include "chrome/browser/browser_shutdown.h" | 39 #include "chrome/browser/browser_shutdown.h" |
| 40 #include "chrome/browser/chrome_thread.h" | 40 #include "chrome/browser/chrome_thread.h" |
| 41 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" | 41 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
| 42 #include "chrome/browser/extensions/extension_protocols.h" | 42 #include "chrome/browser/extensions/extension_protocols.h" |
| 43 #include "chrome/browser/extensions/extensions_service.h" | 43 #include "chrome/browser/extensions/extensions_service.h" |
| 44 #include "chrome/browser/first_run/first_run.h" | 44 #include "chrome/browser/first_run/first_run.h" |
| 45 #include "chrome/browser/jankometer.h" | 45 #include "chrome/browser/jankometer.h" |
| 46 #include "chrome/browser/labs.h" |
| 46 #include "chrome/browser/metrics/histogram_synchronizer.h" | 47 #include "chrome/browser/metrics/histogram_synchronizer.h" |
| 47 #include "chrome/browser/metrics/metrics_log.h" | 48 #include "chrome/browser/metrics/metrics_log.h" |
| 48 #include "chrome/browser/metrics/metrics_service.h" | 49 #include "chrome/browser/metrics/metrics_service.h" |
| 49 #include "chrome/browser/net/predictor_api.h" | 50 #include "chrome/browser/net/predictor_api.h" |
| 50 #include "chrome/browser/net/metadata_url_request.h" | 51 #include "chrome/browser/net/metadata_url_request.h" |
| 51 #include "chrome/browser/net/sdch_dictionary_fetcher.h" | 52 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
| 52 #include "chrome/browser/net/websocket_experiment/websocket_experiment_runner.h" | 53 #include "chrome/browser/net/websocket_experiment/websocket_experiment_runner.h" |
| 53 #include "chrome/browser/plugin_service.h" | 54 #include "chrome/browser/plugin_service.h" |
| 54 #include "chrome/browser/prefs/pref_service.h" | 55 #include "chrome/browser/prefs/pref_service.h" |
| 55 #include "chrome/browser/prefs/pref_value_store.h" | 56 #include "chrome/browser/prefs/pref_value_store.h" |
| (...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1175 | 1176 |
| 1176 Profile* profile = CreateProfile(parameters, user_data_dir); | 1177 Profile* profile = CreateProfile(parameters, user_data_dir); |
| 1177 if (!profile) | 1178 if (!profile) |
| 1178 return ResultCodes::NORMAL_EXIT; | 1179 return ResultCodes::NORMAL_EXIT; |
| 1179 | 1180 |
| 1180 // Post-profile init --------------------------------------------------------- | 1181 // Post-profile init --------------------------------------------------------- |
| 1181 | 1182 |
| 1182 PrefService* user_prefs = profile->GetPrefs(); | 1183 PrefService* user_prefs = profile->GetPrefs(); |
| 1183 DCHECK(user_prefs); | 1184 DCHECK(user_prefs); |
| 1184 | 1185 |
| 1186 // Convert active labs into switches. Modifies the current command line. |
| 1187 about_labs::ConvertLabsToSwitches(profile, CommandLine::ForCurrentProcess()); |
| 1188 |
| 1185 // Tests should be able to tune login manager before showing it. | 1189 // Tests should be able to tune login manager before showing it. |
| 1186 // Thus only show login manager in normal (non-testing) mode. | 1190 // Thus only show login manager in normal (non-testing) mode. |
| 1187 if (!parameters.ui_task) { | 1191 if (!parameters.ui_task) { |
| 1188 OptionallyRunChromeOSLoginManager(parsed_command_line); | 1192 OptionallyRunChromeOSLoginManager(parsed_command_line); |
| 1189 } | 1193 } |
| 1190 | 1194 |
| 1191 #if !defined(OS_MACOSX) | 1195 #if !defined(OS_MACOSX) |
| 1192 // Importing other browser settings is done in a browser-like process | 1196 // Importing other browser settings is done in a browser-like process |
| 1193 // that exits when this task has finished. | 1197 // that exits when this task has finished. |
| 1194 // TODO(port): Port to Mac | 1198 // TODO(port): Port to Mac |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1492 metrics->Stop(); | 1496 metrics->Stop(); |
| 1493 | 1497 |
| 1494 // browser_shutdown takes care of deleting browser_process, so we need to | 1498 // browser_shutdown takes care of deleting browser_process, so we need to |
| 1495 // release it. | 1499 // release it. |
| 1496 ignore_result(browser_process.release()); | 1500 ignore_result(browser_process.release()); |
| 1497 browser_shutdown::Shutdown(); | 1501 browser_shutdown::Shutdown(); |
| 1498 | 1502 |
| 1499 TRACE_EVENT_END("BrowserMain", 0, 0); | 1503 TRACE_EVENT_END("BrowserMain", 0, 0); |
| 1500 return result_code; | 1504 return result_code; |
| 1501 } | 1505 } |
| OLD | NEW |