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/strings/string_tokenizer.h" | 14 #include "base/strings/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_net_benchmarking_message_filter.h" |
23 #include "chrome/browser/chrome_quota_permission_context.h" | 23 #include "chrome/browser/chrome_quota_permission_context.h" |
24 #include "chrome/browser/content_settings/content_settings_utils.h" | 24 #include "chrome/browser/content_settings/content_settings_utils.h" |
25 #include "chrome/browser/content_settings/cookie_settings.h" | 25 #include "chrome/browser/content_settings/cookie_settings.h" |
26 #include "chrome/browser/content_settings/host_content_settings_map.h" | 26 #include "chrome/browser/content_settings/host_content_settings_map.h" |
27 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 27 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
28 #include "chrome/browser/defaults.h" | 28 #include "chrome/browser/defaults.h" |
29 #include "chrome/browser/download/download_util.h" | 29 #include "chrome/browser/download/download_util.h" |
30 #include "chrome/browser/extensions/api/web_request/web_request_api.h" | 30 #include "chrome/browser/extensions/api/web_request/web_request_api.h" |
31 #include "chrome/browser/extensions/extension_host.h" | 31 #include "chrome/browser/extensions/extension_host.h" |
32 #include "chrome/browser/extensions/extension_info_map.h" | 32 #include "chrome/browser/extensions/extension_info_map.h" |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 return; | 684 return; |
685 std::vector<ExtensionMsg_Loaded_Params> extensions; | 685 std::vector<ExtensionMsg_Loaded_Params> extensions; |
686 extensions.push_back(ExtensionMsg_Loaded_Params(extension)); | 686 extensions.push_back(ExtensionMsg_Loaded_Params(extension)); |
687 guest_web_contents->Send(new ExtensionMsg_Loaded(extensions)); | 687 guest_web_contents->Send(new ExtensionMsg_Loaded(extensions)); |
688 } | 688 } |
689 | 689 |
690 void ChromeContentBrowserClient::RenderProcessHostCreated( | 690 void ChromeContentBrowserClient::RenderProcessHostCreated( |
691 content::RenderProcessHost* host) { | 691 content::RenderProcessHost* host) { |
692 int id = host->GetID(); | 692 int id = host->GetID(); |
693 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); | 693 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); |
| 694 net::URLRequestContextGetter* context = |
| 695 profile->GetRequestContextForRenderProcess(id); |
| 696 |
694 host->GetChannel()->AddFilter(new ChromeRenderMessageFilter( | 697 host->GetChannel()->AddFilter(new ChromeRenderMessageFilter( |
695 id, profile, profile->GetRequestContextForRenderProcess(id))); | 698 id, profile, context)); |
696 #if defined(ENABLE_PLUGINS) | 699 #if defined(ENABLE_PLUGINS) |
697 host->GetChannel()->AddFilter(new PluginInfoMessageFilter(id, profile)); | 700 host->GetChannel()->AddFilter(new PluginInfoMessageFilter(id, profile)); |
698 #endif | 701 #endif |
699 #if defined(ENABLE_PRINTING) | 702 #if defined(ENABLE_PRINTING) |
700 host->GetChannel()->AddFilter(new PrintingMessageFilter(id, profile)); | 703 host->GetChannel()->AddFilter(new PrintingMessageFilter(id, profile)); |
701 #endif | 704 #endif |
702 host->GetChannel()->AddFilter( | 705 host->GetChannel()->AddFilter( |
703 new SearchProviderInstallStateMessageFilter(id, profile)); | 706 new SearchProviderInstallStateMessageFilter(id, profile)); |
704 host->GetChannel()->AddFilter(new SpellCheckMessageFilter(id)); | 707 host->GetChannel()->AddFilter(new SpellCheckMessageFilter(id)); |
705 #if defined(OS_MACOSX) | 708 #if defined(OS_MACOSX) |
706 host->GetChannel()->AddFilter(new SpellCheckMessageFilterMac()); | 709 host->GetChannel()->AddFilter(new SpellCheckMessageFilterMac()); |
707 #endif | 710 #endif |
708 host->GetChannel()->AddFilter(new ChromeBenchmarkingMessageFilter( | 711 host->GetChannel()->AddFilter(new ChromeNetBenchmarkingMessageFilter( |
709 id, profile, profile->GetRequestContextForRenderProcess(id))); | 712 id, profile, context)); |
710 host->GetChannel()->AddFilter( | 713 host->GetChannel()->AddFilter( |
711 new prerender::PrerenderMessageFilter(id, profile)); | 714 new prerender::PrerenderMessageFilter(id, profile)); |
712 | 715 |
713 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( | 716 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( |
714 profile->IsOffTheRecord())); | 717 profile->IsOffTheRecord())); |
715 | 718 |
716 SendExtensionWebRequestStatusToHost(host); | 719 SendExtensionWebRequestStatusToHost(host); |
717 | 720 |
718 RendererContentSettingRules rules; | 721 RendererContentSettingRules rules; |
719 GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), &rules); | 722 GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), &rules); |
(...skipping 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2040 io_thread_application_locale_ = locale; | 2043 io_thread_application_locale_ = locale; |
2041 } | 2044 } |
2042 | 2045 |
2043 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( | 2046 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( |
2044 const std::string& locale) { | 2047 const std::string& locale) { |
2045 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 2048 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
2046 io_thread_application_locale_ = locale; | 2049 io_thread_application_locale_ = locale; |
2047 } | 2050 } |
2048 | 2051 |
2049 } // namespace chrome | 2052 } // namespace chrome |
OLD | NEW |