| 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/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
| 15 #include "base/strings/string_tokenizer.h" | 15 #include "base/strings/string_tokenizer.h" |
| 16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 17 #include "chrome/app/breakpad_mac.h" | 17 #include "chrome/app/breakpad_mac.h" |
| 18 #include "chrome/browser/browser_about_handler.h" | 18 #include "chrome/browser/browser_about_handler.h" |
| 19 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
| 20 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 20 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 21 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 21 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
| 22 #include "chrome/browser/character_encoding.h" | 22 #include "chrome/browser/character_encoding.h" |
| 23 #include "chrome/browser/chrome_benchmarking_message_filter.h" | 23 #include "chrome/browser/chrome_net_benchmarking_message_filter.h" |
| 24 #include "chrome/browser/chrome_quota_permission_context.h" | 24 #include "chrome/browser/chrome_quota_permission_context.h" |
| 25 #include "chrome/browser/content_settings/content_settings_utils.h" | 25 #include "chrome/browser/content_settings/content_settings_utils.h" |
| 26 #include "chrome/browser/content_settings/cookie_settings.h" | 26 #include "chrome/browser/content_settings/cookie_settings.h" |
| 27 #include "chrome/browser/content_settings/host_content_settings_map.h" | 27 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 28 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 28 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 29 #include "chrome/browser/defaults.h" | 29 #include "chrome/browser/defaults.h" |
| 30 #include "chrome/browser/download/download_util.h" | 30 #include "chrome/browser/download/download_util.h" |
| 31 #include "chrome/browser/extensions/api/web_request/web_request_api.h" | 31 #include "chrome/browser/extensions/api/web_request/web_request_api.h" |
| 32 #include "chrome/browser/extensions/extension_host.h" | 32 #include "chrome/browser/extensions/extension_host.h" |
| 33 #include "chrome/browser/extensions/extension_info_map.h" | 33 #include "chrome/browser/extensions/extension_info_map.h" |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 return; | 641 return; |
| 642 std::vector<ExtensionMsg_Loaded_Params> extensions; | 642 std::vector<ExtensionMsg_Loaded_Params> extensions; |
| 643 extensions.push_back(ExtensionMsg_Loaded_Params(extension)); | 643 extensions.push_back(ExtensionMsg_Loaded_Params(extension)); |
| 644 guest_web_contents->Send(new ExtensionMsg_Loaded(extensions)); | 644 guest_web_contents->Send(new ExtensionMsg_Loaded(extensions)); |
| 645 } | 645 } |
| 646 | 646 |
| 647 void ChromeContentBrowserClient::RenderProcessHostCreated( | 647 void ChromeContentBrowserClient::RenderProcessHostCreated( |
| 648 content::RenderProcessHost* host) { | 648 content::RenderProcessHost* host) { |
| 649 int id = host->GetID(); | 649 int id = host->GetID(); |
| 650 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); | 650 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); |
| 651 net::URLRequestContextGetter* context = |
| 652 profile->GetRequestContextForRenderProcess(id); |
| 653 |
| 651 host->GetChannel()->AddFilter(new ChromeRenderMessageFilter( | 654 host->GetChannel()->AddFilter(new ChromeRenderMessageFilter( |
| 652 id, profile, profile->GetRequestContextForRenderProcess(id))); | 655 id, profile, context)); |
| 653 #if defined(ENABLE_PLUGINS) | 656 #if defined(ENABLE_PLUGINS) |
| 654 host->GetChannel()->AddFilter(new PluginInfoMessageFilter(id, profile)); | 657 host->GetChannel()->AddFilter(new PluginInfoMessageFilter(id, profile)); |
| 655 #endif | 658 #endif |
| 656 #if defined(ENABLE_PRINTING) | 659 #if defined(ENABLE_PRINTING) |
| 657 host->GetChannel()->AddFilter(new PrintingMessageFilter(id, profile)); | 660 host->GetChannel()->AddFilter(new PrintingMessageFilter(id, profile)); |
| 658 #endif | 661 #endif |
| 659 host->GetChannel()->AddFilter( | 662 host->GetChannel()->AddFilter( |
| 660 new SearchProviderInstallStateMessageFilter(id, profile)); | 663 new SearchProviderInstallStateMessageFilter(id, profile)); |
| 661 host->GetChannel()->AddFilter(new SpellCheckMessageFilter(id)); | 664 host->GetChannel()->AddFilter(new SpellCheckMessageFilter(id)); |
| 662 #if defined(OS_MACOSX) | 665 #if defined(OS_MACOSX) |
| 663 host->GetChannel()->AddFilter(new SpellCheckMessageFilterMac()); | 666 host->GetChannel()->AddFilter(new SpellCheckMessageFilterMac()); |
| 664 #endif | 667 #endif |
| 665 host->GetChannel()->AddFilter(new ChromeBenchmarkingMessageFilter( | 668 host->GetChannel()->AddFilter(new ChromeNetBenchmarkingMessageFilter( |
| 666 id, profile, profile->GetRequestContextForRenderProcess(id))); | 669 id, profile, context)); |
| 667 host->GetChannel()->AddFilter( | 670 host->GetChannel()->AddFilter( |
| 668 new prerender::PrerenderMessageFilter(id, profile)); | 671 new prerender::PrerenderMessageFilter(id, profile)); |
| 669 | 672 |
| 670 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( | 673 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( |
| 671 profile->IsOffTheRecord())); | 674 profile->IsOffTheRecord())); |
| 672 | 675 |
| 673 SendExtensionWebRequestStatusToHost(host); | 676 SendExtensionWebRequestStatusToHost(host); |
| 674 | 677 |
| 675 RendererContentSettingRules rules; | 678 RendererContentSettingRules rules; |
| 676 GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), &rules); | 679 GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), &rules); |
| (...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2046 io_thread_application_locale_ = locale; | 2049 io_thread_application_locale_ = locale; |
| 2047 } | 2050 } |
| 2048 | 2051 |
| 2049 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( | 2052 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( |
| 2050 const std::string& locale) { | 2053 const std::string& locale) { |
| 2051 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 2054 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 2052 io_thread_application_locale_ = locale; | 2055 io_thread_application_locale_ = locale; |
| 2053 } | 2056 } |
| 2054 | 2057 |
| 2055 } // namespace chrome | 2058 } // namespace chrome |
| OLD | NEW |