| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 14 #include "base/string_tokenizer.h" | 14 #include "base/string_tokenizer.h" |
| 15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 16 #include "chrome/app/breakpad_mac.h" | 16 #include "chrome/app/breakpad_mac.h" |
| 17 #include "chrome/browser/browser_about_handler.h" | 17 #include "chrome/browser/browser_about_handler.h" |
| 18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 19 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 19 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 20 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 20 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
| 21 #include "chrome/browser/character_encoding.h" | 21 #include "chrome/browser/character_encoding.h" |
| 22 #include "chrome/browser/chrome_benchmarking_message_filter.h" | 22 #include "chrome/browser/chrome_benchmarking_message_filter.h" |
| 23 #include "chrome/browser/chrome_net_benchmarking_message_filter.h" |
| 23 #include "chrome/browser/chrome_quota_permission_context.h" | 24 #include "chrome/browser/chrome_quota_permission_context.h" |
| 24 #include "chrome/browser/content_settings/content_settings_utils.h" | 25 #include "chrome/browser/content_settings/content_settings_utils.h" |
| 25 #include "chrome/browser/content_settings/cookie_settings.h" | 26 #include "chrome/browser/content_settings/cookie_settings.h" |
| 26 #include "chrome/browser/content_settings/host_content_settings_map.h" | 27 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 27 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 28 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 28 #include "chrome/browser/defaults.h" | 29 #include "chrome/browser/defaults.h" |
| 29 #include "chrome/browser/download/download_util.h" | 30 #include "chrome/browser/download/download_util.h" |
| 30 #include "chrome/browser/extensions/api/web_request/web_request_api.h" | 31 #include "chrome/browser/extensions/api/web_request/web_request_api.h" |
| 31 #include "chrome/browser/extensions/extension_host.h" | 32 #include "chrome/browser/extensions/extension_host.h" |
| 32 #include "chrome/browser/extensions/extension_info_map.h" | 33 #include "chrome/browser/extensions/extension_info_map.h" |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 | 586 |
| 586 new ChromeRenderViewHostObserver(render_view_host, | 587 new ChromeRenderViewHostObserver(render_view_host, |
| 587 profile->GetNetworkPredictor()); | 588 profile->GetNetworkPredictor()); |
| 588 new extensions::MessageHandler(render_view_host); | 589 new extensions::MessageHandler(render_view_host); |
| 589 } | 590 } |
| 590 | 591 |
| 591 void ChromeContentBrowserClient::RenderProcessHostCreated( | 592 void ChromeContentBrowserClient::RenderProcessHostCreated( |
| 592 content::RenderProcessHost* host) { | 593 content::RenderProcessHost* host) { |
| 593 int id = host->GetID(); | 594 int id = host->GetID(); |
| 594 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); | 595 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); |
| 596 net::URLRequestContextGetter* context = |
| 597 profile->GetRequestContextForRenderProcess(id); |
| 598 |
| 595 host->GetChannel()->AddFilter(new ChromeRenderMessageFilter( | 599 host->GetChannel()->AddFilter(new ChromeRenderMessageFilter( |
| 596 id, profile, profile->GetRequestContextForRenderProcess(id))); | 600 id, profile, context)); |
| 597 #if defined(ENABLE_PLUGINS) | 601 #if defined(ENABLE_PLUGINS) |
| 598 host->GetChannel()->AddFilter(new PluginInfoMessageFilter(id, profile)); | 602 host->GetChannel()->AddFilter(new PluginInfoMessageFilter(id, profile)); |
| 599 #endif | 603 #endif |
| 600 #if defined(ENABLE_PRINTING) | 604 #if defined(ENABLE_PRINTING) |
| 601 host->GetChannel()->AddFilter(new PrintingMessageFilter(id, profile)); | 605 host->GetChannel()->AddFilter(new PrintingMessageFilter(id, profile)); |
| 602 #endif | 606 #endif |
| 603 host->GetChannel()->AddFilter( | 607 host->GetChannel()->AddFilter( |
| 604 new SearchProviderInstallStateMessageFilter(id, profile)); | 608 new SearchProviderInstallStateMessageFilter(id, profile)); |
| 605 host->GetChannel()->AddFilter(new SpellCheckMessageFilter(id)); | 609 host->GetChannel()->AddFilter(new SpellCheckMessageFilter(id)); |
| 606 #if defined(OS_MACOSX) | 610 #if defined(OS_MACOSX) |
| 607 host->GetChannel()->AddFilter(new SpellCheckMessageFilterMac()); | 611 host->GetChannel()->AddFilter(new SpellCheckMessageFilterMac()); |
| 608 #endif | 612 #endif |
| 609 host->GetChannel()->AddFilter(new ChromeBenchmarkingMessageFilter( | 613 host->GetChannel()->AddFilter(new ChromeBenchmarkingMessageFilter( |
| 610 id, profile, profile->GetRequestContextForRenderProcess(id))); | 614 id, profile, context)); |
| 615 host->GetChannel()->AddFilter(new ChromeNetBenchmarkingMessageFilter( |
| 616 context)); |
| 611 host->GetChannel()->AddFilter( | 617 host->GetChannel()->AddFilter( |
| 612 new prerender::PrerenderMessageFilter(id, profile)); | 618 new prerender::PrerenderMessageFilter(id, profile)); |
| 613 | 619 |
| 614 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( | 620 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( |
| 615 profile->IsOffTheRecord())); | 621 profile->IsOffTheRecord())); |
| 616 | 622 |
| 617 SendExtensionWebRequestStatusToHost(host); | 623 SendExtensionWebRequestStatusToHost(host); |
| 618 | 624 |
| 619 RendererContentSettingRules rules; | 625 RendererContentSettingRules rules; |
| 620 GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), &rules); | 626 GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), &rules); |
| (...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1895 io_thread_application_locale_ = locale; | 1901 io_thread_application_locale_ = locale; |
| 1896 } | 1902 } |
| 1897 | 1903 |
| 1898 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( | 1904 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( |
| 1899 const std::string& locale) { | 1905 const std::string& locale) { |
| 1900 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 1906 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 1901 io_thread_application_locale_ = locale; | 1907 io_thread_application_locale_ = locale; |
| 1902 } | 1908 } |
| 1903 | 1909 |
| 1904 } // namespace chrome | 1910 } // namespace chrome |
| OLD | NEW |