| 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/debugger/devtools_handler.h" | 13 #include "chrome/browser/debugger/devtools_handler.h" |
| 13 #include "chrome/browser/desktop_notification_handler.h" | 14 #include "chrome/browser/desktop_notification_handler.h" |
| 14 #include "chrome/browser/extensions/extension_message_handler.h" | 15 #include "chrome/browser/extensions/extension_message_handler.h" |
| 15 #include "chrome/browser/extensions/extension_service.h" | 16 #include "chrome/browser/extensions/extension_service.h" |
| 16 #include "chrome/browser/google/google_util.h" | 17 #include "chrome/browser/google/google_util.h" |
| 17 #include "chrome/browser/prefs/pref_service.h" | 18 #include "chrome/browser/prefs/pref_service.h" |
| 18 #include "chrome/browser/printing/printing_message_filter.h" | 19 #include "chrome/browser/printing/printing_message_filter.h" |
| 19 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" | 21 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" |
| 21 #include "chrome/browser/renderer_host/chrome_render_view_host_observer.h" | 22 #include "chrome/browser/renderer_host/chrome_render_view_host_observer.h" |
| 22 #include "chrome/browser/renderer_host/text_input_client_message_filter.h" | 23 #include "chrome/browser/renderer_host/text_input_client_message_filter.h" |
| 23 #include "chrome/browser/search_engines/search_provider_install_state_message_fi
lter.h" | 24 #include "chrome/browser/search_engines/search_provider_install_state_message_fi
lter.h" |
| 24 #include "chrome/browser/spellcheck_message_filter.h" | 25 #include "chrome/browser/spellcheck_message_filter.h" |
| 25 #include "chrome/browser/ui/webui/chrome_web_ui_factory.h" | 26 #include "chrome/browser/ui/webui/chrome_web_ui_factory.h" |
| 26 #include "chrome/common/child_process_logging.h" | 27 #include "chrome/common/child_process_logging.h" |
| 27 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
| 28 #include "chrome/common/pref_names.h" | 29 #include "chrome/common/pref_names.h" |
| 29 #include "content/browser/renderer_host/browser_render_process_host.h" | 30 #include "content/browser/renderer_host/browser_render_process_host.h" |
| 30 #include "content/browser/renderer_host/render_view_host.h" | 31 #include "content/browser/renderer_host/render_view_host.h" |
| 32 #include "content/browser/resource_context.h" |
| 31 #include "content/browser/tab_contents/tab_contents.h" | 33 #include "content/browser/tab_contents/tab_contents.h" |
| 32 #include "content/browser/worker_host/worker_process_host.h" | 34 #include "content/browser/worker_host/worker_process_host.h" |
| 33 | 35 |
| 34 #if defined(OS_LINUX) | 36 #if defined(OS_LINUX) |
| 35 #include "base/linux_util.h" | 37 #include "base/linux_util.h" |
| 36 #include "chrome/browser/crash_handler_host_linux.h" | 38 #include "chrome/browser/crash_handler_host_linux.h" |
| 37 #endif // OS_LINUX | 39 #endif // OS_LINUX |
| 38 | 40 |
| 39 namespace chrome { | 41 namespace chrome { |
| 40 | 42 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // in the browser process. | 175 // in the browser process. |
| 174 if (!g_browser_process->safe_browsing_detection_service()) | 176 if (!g_browser_process->safe_browsing_detection_service()) |
| 175 command_line->AppendSwitch(switches::kDisableClientSidePhishingDetection); | 177 command_line->AppendSwitch(switches::kDisableClientSidePhishingDetection); |
| 176 } | 178 } |
| 177 } | 179 } |
| 178 | 180 |
| 179 std::string ChromeContentBrowserClient::GetApplicationLocale() { | 181 std::string ChromeContentBrowserClient::GetApplicationLocale() { |
| 180 return g_browser_process->GetApplicationLocale(); | 182 return g_browser_process->GetApplicationLocale(); |
| 181 } | 183 } |
| 182 | 184 |
| 185 bool ChromeContentBrowserClient::AllowAppCache( |
| 186 const GURL& manifest_url, const content::ResourceContext* context) { |
| 187 ContentSetting setting = context->host_content_settings_map()-> |
| 188 GetContentSetting(manifest_url, CONTENT_SETTINGS_TYPE_COOKIES, ""); |
| 189 DCHECK(setting != CONTENT_SETTING_DEFAULT); |
| 190 return setting != CONTENT_SETTING_BLOCK; |
| 191 } |
| 192 |
| 183 #if defined(OS_LINUX) | 193 #if defined(OS_LINUX) |
| 184 int ChromeContentBrowserClient::GetCrashSignalFD( | 194 int ChromeContentBrowserClient::GetCrashSignalFD( |
| 185 const std::string& process_type) { | 195 const std::string& process_type) { |
| 186 if (process_type == switches::kRendererProcess) | 196 if (process_type == switches::kRendererProcess) |
| 187 return RendererCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); | 197 return RendererCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); |
| 188 | 198 |
| 189 if (process_type == switches::kPluginProcess) | 199 if (process_type == switches::kPluginProcess) |
| 190 return PluginCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); | 200 return PluginCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); |
| 191 | 201 |
| 192 if (process_type == switches::kPpapiPluginProcess) | 202 if (process_type == switches::kPpapiPluginProcess) |
| 193 return PpapiCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); | 203 return PpapiCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); |
| 194 | 204 |
| 195 if (process_type == switches::kGpuProcess) | 205 if (process_type == switches::kGpuProcess) |
| 196 return GpuCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); | 206 return GpuCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); |
| 197 | 207 |
| 198 return -1; | 208 return -1; |
| 199 } | 209 } |
| 200 #endif | 210 #endif |
| 201 | 211 |
| 202 } // namespace chrome | 212 } // namespace chrome |
| OLD | NEW |