| 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 <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 39 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
| 40 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" | 40 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" |
| 41 #include "chrome/browser/budget_service/budget_service_impl.h" | 41 #include "chrome/browser/budget_service/budget_service_impl.h" |
| 42 #include "chrome/browser/chrome_content_browser_client_parts.h" | 42 #include "chrome/browser/chrome_content_browser_client_parts.h" |
| 43 #include "chrome/browser/chrome_quota_permission_context.h" | 43 #include "chrome/browser/chrome_quota_permission_context.h" |
| 44 #include "chrome/browser/content_settings/cookie_settings_factory.h" | 44 #include "chrome/browser/content_settings/cookie_settings_factory.h" |
| 45 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 45 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 46 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 46 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 47 #include "chrome/browser/defaults.h" | 47 #include "chrome/browser/defaults.h" |
| 48 #include "chrome/browser/download/download_prefs.h" | 48 #include "chrome/browser/download/download_prefs.h" |
| 49 #include "chrome/browser/engagement/site_engagement_eviction_policy.h" | |
| 50 #include "chrome/browser/field_trial_recorder.h" | 49 #include "chrome/browser/field_trial_recorder.h" |
| 51 #include "chrome/browser/font_family_cache.h" | 50 #include "chrome/browser/font_family_cache.h" |
| 52 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" | 51 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" |
| 53 #include "chrome/browser/memory/chrome_memory_coordinator_delegate.h" | 52 #include "chrome/browser/memory/chrome_memory_coordinator_delegate.h" |
| 54 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h" | 53 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h" |
| 55 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h" | 54 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h" |
| 56 #include "chrome/browser/net_benchmarking.h" | 55 #include "chrome/browser/net_benchmarking.h" |
| 57 #include "chrome/browser/notifications/platform_notification_service_impl.h" | 56 #include "chrome/browser/notifications/platform_notification_service_impl.h" |
| 58 #include "chrome/browser/page_load_metrics/metrics_navigation_throttle.h" | 57 #include "chrome/browser/page_load_metrics/metrics_navigation_throttle.h" |
| 59 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 58 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 #if BUILDFLAG(ENABLE_PLUGINS) | 405 #if BUILDFLAG(ENABLE_PLUGINS) |
| 407 using plugins::ChromeContentBrowserClientPluginsPart; | 406 using plugins::ChromeContentBrowserClientPluginsPart; |
| 408 #endif | 407 #endif |
| 409 | 408 |
| 410 namespace { | 409 namespace { |
| 411 | 410 |
| 412 // Cached version of the locale so we can return the locale on the I/O | 411 // Cached version of the locale so we can return the locale on the I/O |
| 413 // thread. | 412 // thread. |
| 414 base::LazyInstance<std::string> g_io_thread_application_locale; | 413 base::LazyInstance<std::string> g_io_thread_application_locale; |
| 415 | 414 |
| 415 const storage::QuotaSettings* g_default_quota_settings; |
| 416 |
| 416 #if BUILDFLAG(ENABLE_PLUGINS) | 417 #if BUILDFLAG(ENABLE_PLUGINS) |
| 417 // TODO(teravest): Add renderer-side API-specific checking for these APIs so | 418 // TODO(teravest): Add renderer-side API-specific checking for these APIs so |
| 418 // that blanket permission isn't granted to all dev channel APIs for these. | 419 // that blanket permission isn't granted to all dev channel APIs for these. |
| 419 // http://crbug.com/386743 | 420 // http://crbug.com/386743 |
| 420 const char* const kPredefinedAllowedDevChannelOrigins[] = { | 421 const char* const kPredefinedAllowedDevChannelOrigins[] = { |
| 421 "6EAED1924DB611B6EEF2A664BD077BE7EAD33B8F", // see crbug.com/383937 | 422 "6EAED1924DB611B6EEF2A664BD077BE7EAD33B8F", // see crbug.com/383937 |
| 422 "4EB74897CB187C7633357C2FE832E0AD6A44883A" // see crbug.com/383937 | 423 "4EB74897CB187C7633357C2FE832E0AD6A44883A" // see crbug.com/383937 |
| 423 }; | 424 }; |
| 424 | 425 |
| 425 const char* const kPredefinedAllowedFileHandleOrigins[] = { | 426 const char* const kPredefinedAllowedFileHandleOrigins[] = { |
| (...skipping 1746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2172 #endif | 2173 #endif |
| 2173 | 2174 |
| 2174 return NULL; | 2175 return NULL; |
| 2175 } | 2176 } |
| 2176 | 2177 |
| 2177 QuotaPermissionContext* | 2178 QuotaPermissionContext* |
| 2178 ChromeContentBrowserClient::CreateQuotaPermissionContext() { | 2179 ChromeContentBrowserClient::CreateQuotaPermissionContext() { |
| 2179 return new ChromeQuotaPermissionContext(); | 2180 return new ChromeQuotaPermissionContext(); |
| 2180 } | 2181 } |
| 2181 | 2182 |
| 2182 std::unique_ptr<storage::QuotaEvictionPolicy> | 2183 void ChromeContentBrowserClient::GetQuotaSettings( |
| 2183 ChromeContentBrowserClient::GetTemporaryStorageEvictionPolicy( | 2184 content::BrowserContext* context, |
| 2184 content::BrowserContext* context) { | 2185 content::StoragePartition* partition, |
| 2185 return SiteEngagementEvictionPolicy::IsEnabled() | 2186 const storage::OptionalQuotaSettingsCallback& callback) { |
| 2186 ? base::MakeUnique<SiteEngagementEvictionPolicy>(context) | 2187 if (g_default_quota_settings) { |
| 2187 : nullptr; | 2188 // For debugging tests harness can inject settings. |
| 2189 callback.Run(*g_default_quota_settings); |
| 2190 return; |
| 2191 } |
| 2192 content::BrowserThread::PostTaskAndReplyWithResult( |
| 2193 content::BrowserThread::FILE, FROM_HERE, |
| 2194 base::Bind(&storage::CalculateNominalDynamicSettings, |
| 2195 partition->GetPath(), context->IsOffTheRecord()), |
| 2196 callback); |
| 2188 } | 2197 } |
| 2189 | 2198 |
| 2190 void ChromeContentBrowserClient::AllowCertificateError( | 2199 void ChromeContentBrowserClient::AllowCertificateError( |
| 2191 content::WebContents* web_contents, | 2200 content::WebContents* web_contents, |
| 2192 int cert_error, | 2201 int cert_error, |
| 2193 const net::SSLInfo& ssl_info, | 2202 const net::SSLInfo& ssl_info, |
| 2194 const GURL& request_url, | 2203 const GURL& request_url, |
| 2195 ResourceType resource_type, | 2204 ResourceType resource_type, |
| 2196 bool overridable, | 2205 bool overridable, |
| 2197 bool strict_enforcement, | 2206 bool strict_enforcement, |
| (...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3418 bool ChromeContentBrowserClient::ShouldRedirectDOMStorageTaskRunner() { | 3427 bool ChromeContentBrowserClient::ShouldRedirectDOMStorageTaskRunner() { |
| 3419 return variations::GetVariationParamValue( | 3428 return variations::GetVariationParamValue( |
| 3420 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true"; | 3429 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true"; |
| 3421 } | 3430 } |
| 3422 | 3431 |
| 3423 bool ChromeContentBrowserClient:: | 3432 bool ChromeContentBrowserClient:: |
| 3424 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3433 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
| 3425 return variations::GetVariationParamValue( | 3434 return variations::GetVariationParamValue( |
| 3426 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3435 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
| 3427 } | 3436 } |
| 3437 |
| 3438 //static |
| 3439 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( |
| 3440 const storage::QuotaSettings* settings) { |
| 3441 g_default_quota_settings = settings; |
| 3442 } |
| OLD | NEW |