| 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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/app/breakpad_mac.h" | 8 #include "chrome/app/breakpad_mac.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/character_encoding.h" | 10 #include "chrome/browser/character_encoding.h" |
| 11 #include "chrome/browser/chrome_worker_message_filter.h" | 11 #include "chrome/browser/chrome_worker_message_filter.h" |
| 12 #include "chrome/browser/content_settings/host_content_settings_map.h" | 12 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 13 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 13 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 14 #include "chrome/browser/debugger/devtools_handler.h" | 14 #include "chrome/browser/debugger/devtools_handler.h" |
| 15 #include "chrome/browser/desktop_notification_handler.h" | 15 #include "chrome/browser/desktop_notification_handler.h" |
| 16 #include "chrome/browser/extensions/extension_message_handler.h" | 16 #include "chrome/browser/extensions/extension_message_handler.h" |
| 17 #include "chrome/browser/extensions/extension_service.h" | 17 #include "chrome/browser/extensions/extension_service.h" |
| 18 #include "chrome/browser/google/google_util.h" | 18 #include "chrome/browser/google/google_util.h" |
| 19 #include "chrome/browser/prefs/pref_service.h" | 19 #include "chrome/browser/prefs/pref_service.h" |
| 20 #include "chrome/browser/prerender/prerender_message_filter.h" |
| 20 #include "chrome/browser/printing/printing_message_filter.h" | 21 #include "chrome/browser/printing/printing_message_filter.h" |
| 21 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
| 22 #include "chrome/browser/profiles/profile_io_data.h" | 23 #include "chrome/browser/profiles/profile_io_data.h" |
| 23 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" | 24 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" |
| 24 #include "chrome/browser/renderer_host/chrome_render_view_host_observer.h" | 25 #include "chrome/browser/renderer_host/chrome_render_view_host_observer.h" |
| 25 #include "chrome/browser/renderer_host/text_input_client_message_filter.h" | 26 #include "chrome/browser/renderer_host/text_input_client_message_filter.h" |
| 26 #include "chrome/browser/search_engines/search_provider_install_state_message_fi
lter.h" | 27 #include "chrome/browser/search_engines/search_provider_install_state_message_fi
lter.h" |
| 27 #include "chrome/browser/spellcheck_message_filter.h" | 28 #include "chrome/browser/spellcheck_message_filter.h" |
| 28 #include "chrome/browser/ui/webui/chrome_web_ui_factory.h" | 29 #include "chrome/browser/ui/webui/chrome_web_ui_factory.h" |
| 29 #include "chrome/common/child_process_logging.h" | 30 #include "chrome/common/child_process_logging.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 120 |
| 120 InitRenderViewHostForExtensions(render_view_host); | 121 InitRenderViewHostForExtensions(render_view_host); |
| 121 } | 122 } |
| 122 | 123 |
| 123 void ChromeContentBrowserClient::BrowserRenderProcessHostCreated( | 124 void ChromeContentBrowserClient::BrowserRenderProcessHostCreated( |
| 124 BrowserRenderProcessHost* host) { | 125 BrowserRenderProcessHost* host) { |
| 125 int id = host->id(); | 126 int id = host->id(); |
| 126 Profile* profile = host->profile(); | 127 Profile* profile = host->profile(); |
| 127 host->channel()->AddFilter(new ChromeRenderMessageFilter( | 128 host->channel()->AddFilter(new ChromeRenderMessageFilter( |
| 128 id, profile, profile->GetRequestContextForRenderProcess(id))); | 129 id, profile, profile->GetRequestContextForRenderProcess(id))); |
| 130 // Add the PrerenderMessageFilter before the PrintingMessageFilter to |
| 131 // intercept PrintHostMsg_ messages. |
| 132 host->channel()->AddFilter(new prerender::PrerenderMessageFilter( |
| 133 host, profile->GetPrerenderManager())); |
| 129 host->channel()->AddFilter(new PrintingMessageFilter()); | 134 host->channel()->AddFilter(new PrintingMessageFilter()); |
| 130 host->channel()->AddFilter( | 135 host->channel()->AddFilter( |
| 131 new SearchProviderInstallStateMessageFilter(id, profile)); | 136 new SearchProviderInstallStateMessageFilter(id, profile)); |
| 132 host->channel()->AddFilter(new SpellCheckMessageFilter(id)); | 137 host->channel()->AddFilter(new SpellCheckMessageFilter(id)); |
| 133 #if defined(OS_MACOSX) | 138 #if defined(OS_MACOSX) |
| 134 host->channel()->AddFilter(new TextInputClientMessageFilter(host->id())); | 139 host->channel()->AddFilter(new TextInputClientMessageFilter(host->id())); |
| 135 #endif | 140 #endif |
| 136 } | 141 } |
| 137 | 142 |
| 138 void ChromeContentBrowserClient::WorkerProcessHostCreated( | 143 void ChromeContentBrowserClient::WorkerProcessHostCreated( |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 return PpapiCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); | 346 return PpapiCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); |
| 342 | 347 |
| 343 if (process_type == switches::kGpuProcess) | 348 if (process_type == switches::kGpuProcess) |
| 344 return GpuCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); | 349 return GpuCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); |
| 345 | 350 |
| 346 return -1; | 351 return -1; |
| 347 } | 352 } |
| 348 #endif | 353 #endif |
| 349 | 354 |
| 350 } // namespace chrome | 355 } // namespace chrome |
| OLD | NEW |