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/file_system_url_request_job_factory.h" | 51 #include "chrome/browser/net/file_system_url_request_job_factory.h" |
52 #include "chrome/browser/net/metadata_url_request.h" | 52 #include "chrome/browser/net/metadata_url_request.h" |
53 #include "chrome/browser/net/predictor_api.h" | 53 #include "chrome/browser/net/predictor_api.h" |
54 #include "chrome/browser/net/sdch_dictionary_fetcher.h" | 54 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
55 #include "chrome/browser/net/websocket_experiment/websocket_experiment_runner.h" | 55 #include "chrome/browser/net/websocket_experiment/websocket_experiment_runner.h" |
56 #include "chrome/browser/plugin_service.h" | 56 #include "chrome/browser/plugin_service.h" |
57 #include "chrome/browser/policy/browser_policy_connector.h" | |
57 #include "chrome/browser/prefs/browser_prefs.h" | 58 #include "chrome/browser/prefs/browser_prefs.h" |
58 #include "chrome/browser/prefs/pref_service.h" | 59 #include "chrome/browser/prefs/pref_service.h" |
59 #include "chrome/browser/prefs/pref_value_store.h" | 60 #include "chrome/browser/prefs/pref_value_store.h" |
60 #include "chrome/browser/prerender/prerender_manager.h" | 61 #include "chrome/browser/prerender/prerender_manager.h" |
61 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" | 62 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
62 #include "chrome/browser/printing/print_dialog_cloud.h" | 63 #include "chrome/browser/printing/print_dialog_cloud.h" |
63 #include "chrome/browser/process_singleton.h" | 64 #include "chrome/browser/process_singleton.h" |
64 #include "chrome/browser/profiles/profile.h" | 65 #include "chrome/browser/profiles/profile.h" |
65 #include "chrome/browser/profiles/profile_manager.h" | 66 #include "chrome/browser/profiles/profile_manager.h" |
66 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 67 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 #include "ui/gfx/gfx_module.h" | 111 #include "ui/gfx/gfx_module.h" |
111 | 112 |
112 #if defined(USE_LINUX_BREAKPAD) | 113 #if defined(USE_LINUX_BREAKPAD) |
113 #include "base/linux_util.h" | 114 #include "base/linux_util.h" |
114 #include "chrome/app/breakpad_linux.h" | 115 #include "chrome/app/breakpad_linux.h" |
115 #endif | 116 #endif |
116 | 117 |
117 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 118 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
118 #include <dbus/dbus-glib.h> | |
119 #include "chrome/browser/browser_main_gtk.h" | 119 #include "chrome/browser/browser_main_gtk.h" |
120 #include "chrome/browser/ui/gtk/gtk_util.h" | 120 #include "chrome/browser/ui/gtk/gtk_util.h" |
121 #include <dbus/dbus-glib.h> | |
Mattias Nissler (ping if slow)
2011/02/15 10:15:16
why? I guess I accidentally introduced this in my
Jakob Kummerow
2011/02/21 12:12:15
Done.
| |
121 #endif | 122 #endif |
122 | 123 |
123 #if defined(OS_CHROMEOS) | 124 #if defined(OS_CHROMEOS) |
124 #include "chrome/browser/chromeos/boot_times_loader.h" | 125 #include "chrome/browser/chromeos/boot_times_loader.h" |
125 #include "chrome/browser/oom_priority_manager.h" | 126 #include "chrome/browser/oom_priority_manager.h" |
126 #endif | 127 #endif |
127 | 128 |
128 // TODO(port): several win-only methods have been pulled out of this, but | 129 // TODO(port): several win-only methods have been pulled out of this, but |
129 // BrowserMain() as a whole needs to be broken apart so that it's usable by | 130 // BrowserMain() as a whole needs to be broken apart so that it's usable by |
130 // other platforms. For now, it's just a stub. This is a serious work in | 131 // other platforms. For now, it's just a stub. This is a serious work in |
(...skipping 16 matching lines...) Expand all Loading... | |
147 #include "chrome/installer/util/shell_util.h" | 148 #include "chrome/installer/util/shell_util.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 #include "ui/gfx/platform_font_win.h" | 154 #include "ui/gfx/platform_font_win.h" |
154 #endif // defined(OS_WIN) | 155 #endif // defined(OS_WIN) |
155 | 156 |
156 #if defined(OS_MACOSX) | 157 #if defined(OS_MACOSX) |
158 #include "chrome/browser/ui/cocoa/install_from_dmg.h" | |
Mattias Nissler (ping if slow)
2011/02/15 10:15:16
same here.
Jakob Kummerow
2011/02/21 12:12:15
Done.
| |
157 #include <Security/Security.h> | 159 #include <Security/Security.h> |
158 #include "chrome/browser/ui/cocoa/install_from_dmg.h" | |
159 #endif | 160 #endif |
160 | 161 |
161 #if defined(TOOLKIT_VIEWS) | 162 #if defined(TOOLKIT_VIEWS) |
162 #include "chrome/browser/ui/views/chrome_views_delegate.h" | 163 #include "chrome/browser/ui/views/chrome_views_delegate.h" |
163 #include "views/focus/accelerator_handler.h" | 164 #include "views/focus/accelerator_handler.h" |
164 #endif | 165 #endif |
165 | 166 |
166 #if defined(OS_CHROMEOS) | 167 #if defined(OS_CHROMEOS) |
167 #include "chrome/browser/chromeos/cros/cros_library.h" | 168 #include "chrome/browser/chromeos/cros/cros_library.h" |
168 #include "chrome/browser/chromeos/cros/screen_lock_library.h" | 169 #include "chrome/browser/chromeos/cros/screen_lock_library.h" |
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1430 | 1431 |
1431 Profile* profile = CreateProfile(parameters, user_data_dir); | 1432 Profile* profile = CreateProfile(parameters, user_data_dir); |
1432 if (!profile) | 1433 if (!profile) |
1433 return ResultCodes::NORMAL_EXIT; | 1434 return ResultCodes::NORMAL_EXIT; |
1434 | 1435 |
1435 // Post-profile init --------------------------------------------------------- | 1436 // Post-profile init --------------------------------------------------------- |
1436 | 1437 |
1437 PrefService* user_prefs = profile->GetPrefs(); | 1438 PrefService* user_prefs = profile->GetPrefs(); |
1438 DCHECK(user_prefs); | 1439 DCHECK(user_prefs); |
1439 | 1440 |
1441 // Bring up the cloud policy infrastructure for browser-global policy. | |
1442 g_browser_process->browser_policy_connector()->Initialize( | |
1443 local_state, Profile::GetDefaultRequestContext()); | |
1444 | |
1440 // Tests should be able to tune login manager before showing it. | 1445 // Tests should be able to tune login manager before showing it. |
1441 // Thus only show login manager in normal (non-testing) mode. | 1446 // Thus only show login manager in normal (non-testing) mode. |
1442 if (!parameters.ui_task) { | 1447 if (!parameters.ui_task) { |
1443 OptionallyRunChromeOSLoginManager(parsed_command_line); | 1448 OptionallyRunChromeOSLoginManager(parsed_command_line); |
1444 } | 1449 } |
1445 | 1450 |
1446 #if !defined(OS_MACOSX) | 1451 #if !defined(OS_MACOSX) |
1447 // Importing other browser settings is done in a browser-like process | 1452 // Importing other browser settings is done in a browser-like process |
1448 // that exits when this task has finished. | 1453 // that exits when this task has finished. |
1449 // TODO(port): Port the Mac's IPC-based implementation to other platforms to | 1454 // TODO(port): Port the Mac's IPC-based implementation to other platforms to |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1810 #if defined(OS_CHROMEOS) | 1815 #if defined(OS_CHROMEOS) |
1811 // To be precise, logout (browser shutdown) is not yet done, but the | 1816 // To be precise, logout (browser shutdown) is not yet done, but the |
1812 // remaining work is negligible, hence we say LogoutDone here. | 1817 // remaining work is negligible, hence we say LogoutDone here. |
1813 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 1818 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
1814 false); | 1819 false); |
1815 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 1820 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
1816 #endif | 1821 #endif |
1817 TRACE_EVENT_END("BrowserMain", 0, 0); | 1822 TRACE_EVENT_END("BrowserMain", 0, 0); |
1818 return result_code; | 1823 return result_code; |
1819 } | 1824 } |
OLD | NEW |