Chromium Code Reviews| 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 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1398 switches::kEnableOfflineAutoReloadVisibleOnly)) { | 1399 switches::kEnableOfflineAutoReloadVisibleOnly)) { |
| 1399 return true; | 1400 return true; |
| 1400 } | 1401 } |
| 1401 if (browser_command_line.HasSwitch( | 1402 if (browser_command_line.HasSwitch( |
| 1402 switches::kDisableOfflineAutoReloadVisibleOnly)) { | 1403 switches::kDisableOfflineAutoReloadVisibleOnly)) { |
| 1403 return false; | 1404 return false; |
| 1404 } | 1405 } |
| 1405 return true; | 1406 return true; |
| 1406 } | 1407 } |
| 1407 | 1408 |
| 1409 #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) | |
| 1410 bool AreExperimentalWebPlatformFeaturesEnabled() { | |
| 1411 const base::CommandLine& browser_command_line = | |
| 1412 *base::CommandLine::ForCurrentProcess(); | |
| 1413 return browser_command_line.HasSwitch( | |
| 1414 switches::kEnableExperimentalWebPlatformFeatures); | |
| 1415 } | |
| 1416 #endif | |
| 1417 | |
| 1408 void MaybeAppendBlinkSettingsSwitchForFieldTrial( | 1418 void MaybeAppendBlinkSettingsSwitchForFieldTrial( |
| 1409 const base::CommandLine& browser_command_line, | 1419 const base::CommandLine& browser_command_line, |
| 1410 base::CommandLine* command_line) { | 1420 base::CommandLine* command_line) { |
| 1411 // List of field trials that modify the blink-settings command line flag. No | 1421 // List of field trials that modify the blink-settings command line flag. No |
| 1412 // two field trials in the list should specify the same keys, otherwise one | 1422 // two field trials in the list should specify the same keys, otherwise one |
| 1413 // field trial may overwrite another. See Source/core/frame/Settings.in in | 1423 // field trial may overwrite another. See Source/core/frame/Settings.in in |
| 1414 // Blink for the list of valid keys. | 1424 // Blink for the list of valid keys. |
| 1415 static const char* const kBlinkSettingsFieldTrials[] = { | 1425 static const char* const kBlinkSettingsFieldTrials[] = { |
| 1416 // Keys: backgroundHtmlParserOutstandingTokenLimit | 1426 // Keys: backgroundHtmlParserOutstandingTokenLimit |
| 1417 // backgroundHtmlParserPendingTokenLimit | 1427 // backgroundHtmlParserPendingTokenLimit |
| (...skipping 1551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2969 content::WebContents::FromRenderFrameHost(render_frame_host); | 2979 content::WebContents::FromRenderFrameHost(render_frame_host); |
| 2970 if (web_contents) { | 2980 if (web_contents) { |
| 2971 registry->AddInterface( | 2981 registry->AddInterface( |
| 2972 web_contents->GetJavaInterfaces() | 2982 web_contents->GetJavaInterfaces() |
| 2973 ->CreateInterfaceFactory<blink::mojom::PaymentRequest>()); | 2983 ->CreateInterfaceFactory<blink::mojom::PaymentRequest>()); |
| 2974 registry->AddInterface( | 2984 registry->AddInterface( |
| 2975 base::Bind(&ForwardShareServiceRequest, | 2985 base::Bind(&ForwardShareServiceRequest, |
| 2976 web_contents->GetJavaInterfaces()->GetWeakPtr())); | 2986 web_contents->GetJavaInterfaces()->GetWeakPtr())); |
| 2977 } | 2987 } |
| 2978 #endif | 2988 #endif |
| 2979 | 2989 #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) |
| 2990 if (AreExperimentalWebPlatformFeaturesEnabled()) { | |
|
please use gerrit instead
2016/11/04 21:58:12
nit: I think there's no need to explicitly check t
Kevin Bailey
2016/11/09 16:25:20
Mostly I was unsure about how reachable this servi
| |
| 2991 content::WebContents* web_contents = | |
| 2992 content::WebContents::FromRenderFrameHost(render_frame_host); | |
| 2993 if (web_contents) { | |
| 2994 registry->AddInterface(base::Bind(CreatePaymentRequestHandler, | |
| 2995 render_frame_host, web_contents)); | |
| 2996 } | |
| 2997 } | |
| 2998 #endif | |
| 2980 #if defined(ENABLE_MEDIA_ROUTER) | 2999 #if defined(ENABLE_MEDIA_ROUTER) |
| 2981 registry->AddInterface( | 3000 registry->AddInterface( |
| 2982 base::Bind(&CastRemotingConnector::CreateRemoterFactory, | 3001 base::Bind(&CastRemotingConnector::CreateRemoterFactory, |
| 2983 render_frame_host)); | 3002 render_frame_host)); |
| 2984 #endif | 3003 #endif |
| 2985 } | 3004 } |
| 2986 | 3005 |
| 2987 void ChromeContentBrowserClient::ExposeInterfacesToGpuProcess( | 3006 void ChromeContentBrowserClient::ExposeInterfacesToGpuProcess( |
| 2988 service_manager::InterfaceRegistry* registry, | 3007 service_manager::InterfaceRegistry* registry, |
| 2989 content::GpuProcessHost* render_process_host) { | 3008 content::GpuProcessHost* render_process_host) { |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3231 kWebRtcDevSwitchNames, | 3250 kWebRtcDevSwitchNames, |
| 3232 arraysize(kWebRtcDevSwitchNames)); | 3251 arraysize(kWebRtcDevSwitchNames)); |
| 3233 } | 3252 } |
| 3234 } | 3253 } |
| 3235 #endif // defined(ENABLE_WEBRTC) | 3254 #endif // defined(ENABLE_WEBRTC) |
| 3236 | 3255 |
| 3237 std::unique_ptr<content::MemoryCoordinatorDelegate> | 3256 std::unique_ptr<content::MemoryCoordinatorDelegate> |
| 3238 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() { | 3257 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() { |
| 3239 return memory::ChromeMemoryCoordinatorDelegate::Create(); | 3258 return memory::ChromeMemoryCoordinatorDelegate::Create(); |
| 3240 } | 3259 } |
| OLD | NEW |