| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "chrome/browser/download/download_prefs.h" | 50 #include "chrome/browser/download/download_prefs.h" |
| 51 #include "chrome/browser/engagement/site_engagement_eviction_policy.h" | 51 #include "chrome/browser/engagement/site_engagement_eviction_policy.h" |
| 52 #include "chrome/browser/font_family_cache.h" | 52 #include "chrome/browser/font_family_cache.h" |
| 53 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" | 53 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" |
| 54 #include "chrome/browser/memory/chrome_memory_coordinator_delegate.h" | 54 #include "chrome/browser/memory/chrome_memory_coordinator_delegate.h" |
| 55 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h" | 55 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h" |
| 56 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h" | 56 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h" |
| 57 #include "chrome/browser/notifications/platform_notification_service_impl.h" | 57 #include "chrome/browser/notifications/platform_notification_service_impl.h" |
| 58 #include "chrome/browser/page_load_metrics/metrics_navigation_throttle.h" | 58 #include "chrome/browser/page_load_metrics/metrics_navigation_throttle.h" |
| 59 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 59 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
| 60 #include "chrome/browser/payments/payment_request_impl.h" |
| 60 #include "chrome/browser/permissions/permission_context_base.h" | 61 #include "chrome/browser/permissions/permission_context_base.h" |
| 61 #include "chrome/browser/platform_util.h" | 62 #include "chrome/browser/platform_util.h" |
| 62 #include "chrome/browser/prerender/prerender_final_status.h" | 63 #include "chrome/browser/prerender/prerender_final_status.h" |
| 63 #include "chrome/browser/prerender/prerender_manager.h" | 64 #include "chrome/browser/prerender/prerender_manager.h" |
| 64 #include "chrome/browser/prerender/prerender_manager_factory.h" | 65 #include "chrome/browser/prerender/prerender_manager_factory.h" |
| 65 #include "chrome/browser/prerender/prerender_message_filter.h" | 66 #include "chrome/browser/prerender/prerender_message_filter.h" |
| 66 #include "chrome/browser/printing/printing_message_filter.h" | 67 #include "chrome/browser/printing/printing_message_filter.h" |
| 67 #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h" | 68 #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h" |
| 68 #include "chrome/browser/profiles/profile.h" | 69 #include "chrome/browser/profiles/profile.h" |
| 69 #include "chrome/browser/profiles/profile_io_data.h" | 70 #include "chrome/browser/profiles/profile_io_data.h" |
| (...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1394 switches::kEnableOfflineAutoReloadVisibleOnly)) { | 1395 switches::kEnableOfflineAutoReloadVisibleOnly)) { |
| 1395 return true; | 1396 return true; |
| 1396 } | 1397 } |
| 1397 if (browser_command_line.HasSwitch( | 1398 if (browser_command_line.HasSwitch( |
| 1398 switches::kDisableOfflineAutoReloadVisibleOnly)) { | 1399 switches::kDisableOfflineAutoReloadVisibleOnly)) { |
| 1399 return false; | 1400 return false; |
| 1400 } | 1401 } |
| 1401 return true; | 1402 return true; |
| 1402 } | 1403 } |
| 1403 | 1404 |
| 1405 #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) |
| 1406 bool AreExperimentalWebPlatformFeaturesEnabled() { |
| 1407 const base::CommandLine& browser_command_line = |
| 1408 *base::CommandLine::ForCurrentProcess(); |
| 1409 return browser_command_line.HasSwitch( |
| 1410 switches::kEnableExperimentalWebPlatformFeatures); |
| 1411 } |
| 1412 #endif |
| 1413 |
| 1404 void MaybeAppendBlinkSettingsSwitchForFieldTrial( | 1414 void MaybeAppendBlinkSettingsSwitchForFieldTrial( |
| 1405 const base::CommandLine& browser_command_line, | 1415 const base::CommandLine& browser_command_line, |
| 1406 base::CommandLine* command_line) { | 1416 base::CommandLine* command_line) { |
| 1407 // List of field trials that modify the blink-settings command line flag. No | 1417 // List of field trials that modify the blink-settings command line flag. No |
| 1408 // two field trials in the list should specify the same keys, otherwise one | 1418 // two field trials in the list should specify the same keys, otherwise one |
| 1409 // field trial may overwrite another. See Source/core/frame/Settings.in in | 1419 // field trial may overwrite another. See Source/core/frame/Settings.in in |
| 1410 // Blink for the list of valid keys. | 1420 // Blink for the list of valid keys. |
| 1411 static const char* const kBlinkSettingsFieldTrials[] = { | 1421 static const char* const kBlinkSettingsFieldTrials[] = { |
| 1412 // Keys: backgroundHtmlParserOutstandingTokenLimit | 1422 // Keys: backgroundHtmlParserOutstandingTokenLimit |
| 1413 // backgroundHtmlParserPendingTokenLimit | 1423 // backgroundHtmlParserPendingTokenLimit |
| (...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2962 content::WebContents::FromRenderFrameHost(render_frame_host); | 2972 content::WebContents::FromRenderFrameHost(render_frame_host); |
| 2963 if (web_contents) { | 2973 if (web_contents) { |
| 2964 registry->AddInterface( | 2974 registry->AddInterface( |
| 2965 web_contents->GetJavaInterfaces() | 2975 web_contents->GetJavaInterfaces() |
| 2966 ->CreateInterfaceFactory<blink::mojom::PaymentRequest>()); | 2976 ->CreateInterfaceFactory<blink::mojom::PaymentRequest>()); |
| 2967 registry->AddInterface( | 2977 registry->AddInterface( |
| 2968 base::Bind(&ForwardShareServiceRequest, | 2978 base::Bind(&ForwardShareServiceRequest, |
| 2969 web_contents->GetJavaInterfaces()->GetWeakPtr())); | 2979 web_contents->GetJavaInterfaces()->GetWeakPtr())); |
| 2970 } | 2980 } |
| 2971 #endif | 2981 #endif |
| 2972 | 2982 #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) |
| 2983 if (AreExperimentalWebPlatformFeaturesEnabled()) { |
| 2984 content::WebContents* web_contents = |
| 2985 content::WebContents::FromRenderFrameHost(render_frame_host); |
| 2986 if (web_contents) { |
| 2987 registry->AddInterface(base::Bind(CreatePaymentRequestHandler, |
| 2988 render_frame_host, web_contents)); |
| 2989 } |
| 2990 } |
| 2991 #endif |
| 2973 #if defined(ENABLE_MEDIA_ROUTER) | 2992 #if defined(ENABLE_MEDIA_ROUTER) |
| 2974 registry->AddInterface( | 2993 registry->AddInterface( |
| 2975 base::Bind(&CastRemotingConnector::CreateRemoterFactory, | 2994 base::Bind(&CastRemotingConnector::CreateRemoterFactory, |
| 2976 render_frame_host)); | 2995 render_frame_host)); |
| 2977 #endif | 2996 #endif |
| 2978 } | 2997 } |
| 2979 | 2998 |
| 2980 void ChromeContentBrowserClient::ExposeInterfacesToGpuProcess( | 2999 void ChromeContentBrowserClient::ExposeInterfacesToGpuProcess( |
| 2981 service_manager::InterfaceRegistry* registry, | 3000 service_manager::InterfaceRegistry* registry, |
| 2982 content::GpuProcessHost* render_process_host) { | 3001 content::GpuProcessHost* render_process_host) { |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3226 kWebRtcDevSwitchNames, | 3245 kWebRtcDevSwitchNames, |
| 3227 arraysize(kWebRtcDevSwitchNames)); | 3246 arraysize(kWebRtcDevSwitchNames)); |
| 3228 } | 3247 } |
| 3229 } | 3248 } |
| 3230 #endif // defined(ENABLE_WEBRTC) | 3249 #endif // defined(ENABLE_WEBRTC) |
| 3231 | 3250 |
| 3232 std::unique_ptr<content::MemoryCoordinatorDelegate> | 3251 std::unique_ptr<content::MemoryCoordinatorDelegate> |
| 3233 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() { | 3252 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() { |
| 3234 return memory::ChromeMemoryCoordinatorDelegate::Create(); | 3253 return memory::ChromeMemoryCoordinatorDelegate::Create(); |
| 3235 } | 3254 } |
| OLD | NEW |