| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 13 matching lines...) Expand all Loading... |
| 24 #include "base/string_util.h" | 24 #include "base/string_util.h" |
| 25 #include "base/sys_string_conversions.h" | 25 #include "base/sys_string_conversions.h" |
| 26 #include "base/threading/platform_thread.h" | 26 #include "base/threading/platform_thread.h" |
| 27 #include "base/threading/thread_restrictions.h" | 27 #include "base/threading/thread_restrictions.h" |
| 28 #include "base/time.h" | 28 #include "base/time.h" |
| 29 #include "base/utf_string_conversions.h" | 29 #include "base/utf_string_conversions.h" |
| 30 #include "base/values.h" | 30 #include "base/values.h" |
| 31 #include "build/build_config.h" | 31 #include "build/build_config.h" |
| 32 #include "chrome/browser/about_flags.h" | 32 #include "chrome/browser/about_flags.h" |
| 33 #include "chrome/browser/browser_main_win.h" | 33 #include "chrome/browser/browser_main_win.h" |
| 34 #include "chrome/browser/defaults.h" | |
| 35 #include "chrome/browser/browser_process.h" | 34 #include "chrome/browser/browser_process.h" |
| 36 #include "chrome/browser/browser_process_impl.h" | 35 #include "chrome/browser/browser_process_impl.h" |
| 37 #include "chrome/browser/browser_shutdown.h" | 36 #include "chrome/browser/browser_shutdown.h" |
| 38 #include "chrome/browser/browser_thread.h" | 37 #include "chrome/browser/browser_thread.h" |
| 38 #include "chrome/browser/defaults.h" |
| 39 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" | 39 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
| 40 #include "chrome/browser/extensions/extension_protocols.h" | 40 #include "chrome/browser/extensions/extension_protocols.h" |
| 41 #include "chrome/browser/extensions/extension_service.h" | 41 #include "chrome/browser/extensions/extension_service.h" |
| 42 #include "chrome/browser/extensions/extensions_startup.h" | 42 #include "chrome/browser/extensions/extensions_startup.h" |
| 43 #include "chrome/browser/first_run/first_run.h" | 43 #include "chrome/browser/first_run/first_run.h" |
| 44 #include "chrome/browser/jankometer.h" | 44 #include "chrome/browser/jankometer.h" |
| 45 #include "chrome/browser/metrics/histogram_synchronizer.h" | 45 #include "chrome/browser/metrics/histogram_synchronizer.h" |
| 46 #include "chrome/browser/metrics/metrics_log.h" | 46 #include "chrome/browser/metrics/metrics_log.h" |
| 47 #include "chrome/browser/metrics/metrics_service.h" | 47 #include "chrome/browser/metrics/metrics_service.h" |
| 48 #include "chrome/browser/net/blob_url_request_job_factory.h" | 48 #include "chrome/browser/net/blob_url_request_job_factory.h" |
| 49 #include "chrome/browser/net/chrome_dns_cert_provenance_checker.h" | 49 #include "chrome/browser/net/chrome_dns_cert_provenance_checker.h" |
| 50 #include "chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h" | 50 #include "chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h" |
| 51 #include "chrome/browser/net/metadata_url_request.h" | 51 #include "chrome/browser/net/metadata_url_request.h" |
| 52 #include "chrome/browser/net/predictor_api.h" | 52 #include "chrome/browser/net/predictor_api.h" |
| 53 #include "chrome/browser/net/sdch_dictionary_fetcher.h" | 53 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
| 54 #include "chrome/browser/net/websocket_experiment/websocket_experiment_runner.h" | 54 #include "chrome/browser/net/websocket_experiment/websocket_experiment_runner.h" |
| 55 #include "chrome/browser/plugin_service.h" | 55 #include "chrome/browser/plugin_service.h" |
| 56 #include "chrome/browser/policy/browser_policy_context.h" |
| 56 #include "chrome/browser/prefs/browser_prefs.h" | 57 #include "chrome/browser/prefs/browser_prefs.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/prerender/prerender_manager.h" | 60 #include "chrome/browser/prerender/prerender_manager.h" |
| 60 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" | 61 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
| 61 #include "chrome/browser/printing/print_dialog_cloud.h" | 62 #include "chrome/browser/printing/print_dialog_cloud.h" |
| 62 #include "chrome/browser/process_singleton.h" | 63 #include "chrome/browser/process_singleton.h" |
| 63 #include "chrome/browser/profiles/profile.h" | 64 #include "chrome/browser/profiles/profile.h" |
| 64 #include "chrome/browser/profiles/profile_manager.h" | 65 #include "chrome/browser/profiles/profile_manager.h" |
| 65 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 66 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 #include "ui/base/l10n/l10n_util.h" | 108 #include "ui/base/l10n/l10n_util.h" |
| 108 #include "ui/base/resource/resource_bundle.h" | 109 #include "ui/base/resource/resource_bundle.h" |
| 109 #include "ui/base/system_monitor/system_monitor.h" | 110 #include "ui/base/system_monitor/system_monitor.h" |
| 110 | 111 |
| 111 #if defined(USE_LINUX_BREAKPAD) | 112 #if defined(USE_LINUX_BREAKPAD) |
| 112 #include "base/linux_util.h" | 113 #include "base/linux_util.h" |
| 113 #include "chrome/app/breakpad_linux.h" | 114 #include "chrome/app/breakpad_linux.h" |
| 114 #endif | 115 #endif |
| 115 | 116 |
| 116 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 117 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 117 #include <dbus/dbus-glib.h> | |
| 118 #include "chrome/browser/browser_main_gtk.h" | 118 #include "chrome/browser/browser_main_gtk.h" |
| 119 #include "chrome/browser/ui/gtk/gtk_util.h" | 119 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 120 #include <dbus/dbus-glib.h> |
| 120 #endif | 121 #endif |
| 121 | 122 |
| 122 #if defined(OS_CHROMEOS) | 123 #if defined(OS_CHROMEOS) |
| 123 #include "chrome/browser/chromeos/boot_times_loader.h" | 124 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 124 #include "chrome/browser/oom_priority_manager.h" | 125 #include "chrome/browser/oom_priority_manager.h" |
| 125 #endif | 126 #endif |
| 126 | 127 |
| 127 // TODO(port): several win-only methods have been pulled out of this, but | 128 // TODO(port): several win-only methods have been pulled out of this, but |
| 128 // BrowserMain() as a whole needs to be broken apart so that it's usable by | 129 // BrowserMain() as a whole needs to be broken apart so that it's usable by |
| 129 // other platforms. For now, it's just a stub. This is a serious work in | 130 // other platforms. For now, it's just a stub. This is a serious work in |
| (...skipping 16 matching lines...) Expand all Loading... |
| 146 #include "chrome/installer/util/shell_util.h" | 147 #include "chrome/installer/util/shell_util.h" |
| 147 #include "gfx/platform_font_win.h" | 148 #include "gfx/platform_font_win.h" |
| 148 #include "net/base/net_util.h" | 149 #include "net/base/net_util.h" |
| 149 #include "net/base/sdch_manager.h" | 150 #include "net/base/sdch_manager.h" |
| 150 #include "printing/printed_document.h" | 151 #include "printing/printed_document.h" |
| 151 #include "sandbox/src/sandbox.h" | 152 #include "sandbox/src/sandbox.h" |
| 152 #include "ui/base/l10n/l10n_util_win.h" | 153 #include "ui/base/l10n/l10n_util_win.h" |
| 153 #endif // defined(OS_WIN) | 154 #endif // defined(OS_WIN) |
| 154 | 155 |
| 155 #if defined(OS_MACOSX) | 156 #if defined(OS_MACOSX) |
| 157 #include "chrome/browser/ui/cocoa/install_from_dmg.h" |
| 156 #include <Security/Security.h> | 158 #include <Security/Security.h> |
| 157 #include "chrome/browser/ui/cocoa/install_from_dmg.h" | |
| 158 #endif | 159 #endif |
| 159 | 160 |
| 160 #if defined(TOOLKIT_VIEWS) | 161 #if defined(TOOLKIT_VIEWS) |
| 161 #include "chrome/browser/ui/views/chrome_views_delegate.h" | 162 #include "chrome/browser/ui/views/chrome_views_delegate.h" |
| 162 #include "views/focus/accelerator_handler.h" | 163 #include "views/focus/accelerator_handler.h" |
| 163 #endif | 164 #endif |
| 164 | 165 |
| 165 #if defined(OS_CHROMEOS) | 166 #if defined(OS_CHROMEOS) |
| 166 #include "chrome/browser/chromeos/cros/cros_library.h" | 167 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 167 #include "chrome/browser/chromeos/cros/screen_lock_library.h" | 168 #include "chrome/browser/chromeos/cros/screen_lock_library.h" |
| (...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1422 | 1423 |
| 1423 Profile* profile = CreateProfile(parameters, user_data_dir); | 1424 Profile* profile = CreateProfile(parameters, user_data_dir); |
| 1424 if (!profile) | 1425 if (!profile) |
| 1425 return ResultCodes::NORMAL_EXIT; | 1426 return ResultCodes::NORMAL_EXIT; |
| 1426 | 1427 |
| 1427 // Post-profile init --------------------------------------------------------- | 1428 // Post-profile init --------------------------------------------------------- |
| 1428 | 1429 |
| 1429 PrefService* user_prefs = profile->GetPrefs(); | 1430 PrefService* user_prefs = profile->GetPrefs(); |
| 1430 DCHECK(user_prefs); | 1431 DCHECK(user_prefs); |
| 1431 | 1432 |
| 1433 // Bring up the cloud policy infrastructure for browser-global policy. |
| 1434 g_browser_process->browser_policy_context()->Initialize( |
| 1435 local_state, Profile::GetDefaultRequestContext()); |
| 1436 |
| 1432 // Tests should be able to tune login manager before showing it. | 1437 // Tests should be able to tune login manager before showing it. |
| 1433 // Thus only show login manager in normal (non-testing) mode. | 1438 // Thus only show login manager in normal (non-testing) mode. |
| 1434 if (!parameters.ui_task) { | 1439 if (!parameters.ui_task) { |
| 1435 OptionallyRunChromeOSLoginManager(parsed_command_line); | 1440 OptionallyRunChromeOSLoginManager(parsed_command_line); |
| 1436 } | 1441 } |
| 1437 | 1442 |
| 1438 #if !defined(OS_MACOSX) | 1443 #if !defined(OS_MACOSX) |
| 1439 // Importing other browser settings is done in a browser-like process | 1444 // Importing other browser settings is done in a browser-like process |
| 1440 // that exits when this task has finished. | 1445 // that exits when this task has finished. |
| 1441 // TODO(port): Port the Mac's IPC-based implementation to other platforms to | 1446 // TODO(port): Port the Mac's IPC-based implementation to other platforms to |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1799 #if defined(OS_CHROMEOS) | 1804 #if defined(OS_CHROMEOS) |
| 1800 // To be precise, logout (browser shutdown) is not yet done, but the | 1805 // To be precise, logout (browser shutdown) is not yet done, but the |
| 1801 // remaining work is negligible, hence we say LogoutDone here. | 1806 // remaining work is negligible, hence we say LogoutDone here. |
| 1802 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 1807 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
| 1803 false); | 1808 false); |
| 1804 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 1809 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
| 1805 #endif | 1810 #endif |
| 1806 TRACE_EVENT_END("BrowserMain", 0, 0); | 1811 TRACE_EVENT_END("BrowserMain", 0, 0); |
| 1807 return result_code; | 1812 return result_code; |
| 1808 } | 1813 } |
| OLD | NEW |