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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 #include "chrome/browser/search_engines/search_engine_type.h" | 67 #include "chrome/browser/search_engines/search_engine_type.h" |
68 #include "chrome/browser/search_engines/template_url.h" | 68 #include "chrome/browser/search_engines/template_url.h" |
69 #include "chrome/browser/search_engines/template_url_model.h" | 69 #include "chrome/browser/search_engines/template_url_model.h" |
70 #include "chrome/browser/service/service_process_control.h" | 70 #include "chrome/browser/service/service_process_control.h" |
71 #include "chrome/browser/service/service_process_control_manager.h" | 71 #include "chrome/browser/service/service_process_control_manager.h" |
72 #include "chrome/browser/shell_integration.h" | 72 #include "chrome/browser/shell_integration.h" |
73 #include "chrome/browser/translate/translate_manager.h" | 73 #include "chrome/browser/translate/translate_manager.h" |
74 #include "chrome/browser/ui/browser.h" | 74 #include "chrome/browser/ui/browser.h" |
75 #include "chrome/browser/ui/browser_init.h" | 75 #include "chrome/browser/ui/browser_init.h" |
76 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" | 76 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" |
| 77 #include "chrome/browser/ui/webui/web_ui_factory.h" |
77 #include "chrome/common/chrome_constants.h" | 78 #include "chrome/common/chrome_constants.h" |
78 #include "chrome/common/chrome_paths.h" | 79 #include "chrome/common/chrome_paths.h" |
79 #include "chrome/common/chrome_switches.h" | 80 #include "chrome/common/chrome_switches.h" |
80 #include "chrome/common/env_vars.h" | 81 #include "chrome/common/env_vars.h" |
81 #include "chrome/common/gfx_resource_provider.h" | 82 #include "chrome/common/gfx_resource_provider.h" |
82 #include "chrome/common/json_pref_store.h" | 83 #include "chrome/common/json_pref_store.h" |
83 #include "chrome/common/jstemplate_builder.h" | 84 #include "chrome/common/jstemplate_builder.h" |
84 #include "chrome/common/logging_chrome.h" | 85 #include "chrome/common/logging_chrome.h" |
85 #include "chrome/common/net/net_resource_provider.h" | 86 #include "chrome/common/net/net_resource_provider.h" |
86 #include "chrome/common/pref_names.h" | 87 #include "chrome/common/pref_names.h" |
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1450 | 1451 |
1451 Profile* profile = CreateProfile(parameters, user_data_dir); | 1452 Profile* profile = CreateProfile(parameters, user_data_dir); |
1452 if (!profile) | 1453 if (!profile) |
1453 return ResultCodes::NORMAL_EXIT; | 1454 return ResultCodes::NORMAL_EXIT; |
1454 | 1455 |
1455 // Post-profile init --------------------------------------------------------- | 1456 // Post-profile init --------------------------------------------------------- |
1456 | 1457 |
1457 PrefService* user_prefs = profile->GetPrefs(); | 1458 PrefService* user_prefs = profile->GetPrefs(); |
1458 DCHECK(user_prefs); | 1459 DCHECK(user_prefs); |
1459 | 1460 |
1460 // Override the default ContentBrowserClient to let Chrome participate in | 1461 // Override the default ContentBrowserClient and to let Chrome participate in |
1461 // content logic. Must be done before any tabs are created. | 1462 // content logic. Must be done before any tabs are created. |
1462 chrome::ChromeContentBrowserClient browser_client; | 1463 chrome::ChromeContentBrowserClient browser_client; |
1463 content::GetContentClient()->set_browser(&browser_client); | 1464 content::GetContentClient()->set_browser(&browser_client); |
1464 | 1465 |
| 1466 // Do the same for the ContentWebUIClient. |
| 1467 content::GetContentClient()->set_web_ui(WebUIFactory::GetInstance()); |
| 1468 |
1465 // Tests should be able to tune login manager before showing it. | 1469 // Tests should be able to tune login manager before showing it. |
1466 // Thus only show login manager in normal (non-testing) mode. | 1470 // Thus only show login manager in normal (non-testing) mode. |
1467 if (!parameters.ui_task) { | 1471 if (!parameters.ui_task) { |
1468 OptionallyRunChromeOSLoginManager(parsed_command_line); | 1472 OptionallyRunChromeOSLoginManager(parsed_command_line); |
1469 } | 1473 } |
1470 | 1474 |
1471 #if !defined(OS_MACOSX) | 1475 #if !defined(OS_MACOSX) |
1472 // Importing other browser settings is done in a browser-like process | 1476 // Importing other browser settings is done in a browser-like process |
1473 // that exits when this task has finished. | 1477 // that exits when this task has finished. |
1474 // TODO(port): Port the Mac's IPC-based implementation to other platforms to | 1478 // TODO(port): Port the Mac's IPC-based implementation to other platforms to |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1863 #if defined(OS_CHROMEOS) | 1867 #if defined(OS_CHROMEOS) |
1864 // To be precise, logout (browser shutdown) is not yet done, but the | 1868 // To be precise, logout (browser shutdown) is not yet done, but the |
1865 // remaining work is negligible, hence we say LogoutDone here. | 1869 // remaining work is negligible, hence we say LogoutDone here. |
1866 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 1870 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
1867 false); | 1871 false); |
1868 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 1872 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
1869 #endif | 1873 #endif |
1870 TRACE_EVENT_END("BrowserMain", 0, 0); | 1874 TRACE_EVENT_END("BrowserMain", 0, 0); |
1871 return result_code; | 1875 return result_code; |
1872 } | 1876 } |
OLD | NEW |