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 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1404 switches::kEnableOfflineAutoReloadVisibleOnly)) { | 1405 switches::kEnableOfflineAutoReloadVisibleOnly)) { |
| 1405 return true; | 1406 return true; |
| 1406 } | 1407 } |
| 1407 if (browser_command_line.HasSwitch( | 1408 if (browser_command_line.HasSwitch( |
| 1408 switches::kDisableOfflineAutoReloadVisibleOnly)) { | 1409 switches::kDisableOfflineAutoReloadVisibleOnly)) { |
| 1409 return false; | 1410 return false; |
| 1410 } | 1411 } |
| 1411 return true; | 1412 return true; |
| 1412 } | 1413 } |
| 1413 | 1414 |
| 1415 #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) | |
| 1416 bool AreExperimentalWebPlatformFeaturesEnabled() { | |
| 1417 const base::CommandLine& browser_command_line = | |
| 1418 *base::CommandLine::ForCurrentProcess(); | |
| 1419 return browser_command_line.HasSwitch( | |
| 1420 switches::kEnableExperimentalWebPlatformFeatures); | |
| 1421 } | |
| 1422 #endif | |
| 1423 | |
| 1414 void MaybeAppendBlinkSettingsSwitchForFieldTrial( | 1424 void MaybeAppendBlinkSettingsSwitchForFieldTrial( |
| 1415 const base::CommandLine& browser_command_line, | 1425 const base::CommandLine& browser_command_line, |
| 1416 base::CommandLine* command_line) { | 1426 base::CommandLine* command_line) { |
| 1417 // List of field trials that modify the blink-settings command line flag. No | 1427 // List of field trials that modify the blink-settings command line flag. No |
| 1418 // two field trials in the list should specify the same keys, otherwise one | 1428 // two field trials in the list should specify the same keys, otherwise one |
| 1419 // field trial may overwrite another. See Source/core/frame/Settings.in in | 1429 // field trial may overwrite another. See Source/core/frame/Settings.in in |
| 1420 // Blink for the list of valid keys. | 1430 // Blink for the list of valid keys. |
| 1421 static const char* const kBlinkSettingsFieldTrials[] = { | 1431 static const char* const kBlinkSettingsFieldTrials[] = { |
| 1422 // Keys: backgroundHtmlParserOutstandingTokenLimit | 1432 // Keys: backgroundHtmlParserOutstandingTokenLimit |
| 1423 // backgroundHtmlParserPendingTokenLimit | 1433 // backgroundHtmlParserPendingTokenLimit |
| (...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2972 content::WebContents::FromRenderFrameHost(render_frame_host); | 2982 content::WebContents::FromRenderFrameHost(render_frame_host); |
| 2973 if (web_contents) { | 2983 if (web_contents) { |
| 2974 registry->AddInterface( | 2984 registry->AddInterface( |
| 2975 web_contents->GetJavaInterfaces() | 2985 web_contents->GetJavaInterfaces() |
| 2976 ->CreateInterfaceFactory<payments::mojom::PaymentRequest>()); | 2986 ->CreateInterfaceFactory<payments::mojom::PaymentRequest>()); |
| 2977 registry->AddInterface( | 2987 registry->AddInterface( |
| 2978 base::Bind(&ForwardShareServiceRequest, | 2988 base::Bind(&ForwardShareServiceRequest, |
| 2979 web_contents->GetJavaInterfaces()->GetWeakPtr())); | 2989 web_contents->GetJavaInterfaces()->GetWeakPtr())); |
| 2980 } | 2990 } |
| 2981 #endif | 2991 #endif |
| 2982 | 2992 #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) |
|
Lei Zhang
2016/11/16 00:59:33
You can do #elif since this is related to the abov
Kevin Bailey
2016/11/16 14:13:47
Done.
| |
| 2993 if (AreExperimentalWebPlatformFeaturesEnabled()) { | |
| 2994 content::WebContents* web_contents = | |
| 2995 content::WebContents::FromRenderFrameHost(render_frame_host); | |
| 2996 if (web_contents) { | |
| 2997 registry->AddInterface( | |
| 2998 base::Bind(CreatePaymentRequestHandler, web_contents)); | |
| 2999 } | |
| 3000 } | |
| 3001 #endif | |
|
Lei Zhang
2016/11/16 00:59:33
And add a blank line to separate from the unrelate
Kevin Bailey
2016/11/16 14:13:47
Done.
| |
| 2983 #if defined(ENABLE_MEDIA_ROUTER) | 3002 #if defined(ENABLE_MEDIA_ROUTER) |
| 2984 registry->AddInterface( | 3003 registry->AddInterface( |
| 2985 base::Bind(&CastRemotingConnector::CreateRemoterFactory, | 3004 base::Bind(&CastRemotingConnector::CreateRemoterFactory, |
| 2986 render_frame_host)); | 3005 render_frame_host)); |
| 2987 #endif | 3006 #endif |
| 2988 } | 3007 } |
| 2989 | 3008 |
| 2990 void ChromeContentBrowserClient::ExposeInterfacesToGpuProcess( | 3009 void ChromeContentBrowserClient::ExposeInterfacesToGpuProcess( |
| 2991 service_manager::InterfaceRegistry* registry, | 3010 service_manager::InterfaceRegistry* registry, |
| 2992 content::GpuProcessHost* render_process_host) { | 3011 content::GpuProcessHost* render_process_host) { |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3238 kWebRtcDevSwitchNames, | 3257 kWebRtcDevSwitchNames, |
| 3239 arraysize(kWebRtcDevSwitchNames)); | 3258 arraysize(kWebRtcDevSwitchNames)); |
| 3240 } | 3259 } |
| 3241 } | 3260 } |
| 3242 #endif // defined(ENABLE_WEBRTC) | 3261 #endif // defined(ENABLE_WEBRTC) |
| 3243 | 3262 |
| 3244 std::unique_ptr<content::MemoryCoordinatorDelegate> | 3263 std::unique_ptr<content::MemoryCoordinatorDelegate> |
| 3245 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() { | 3264 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() { |
| 3246 return memory::ChromeMemoryCoordinatorDelegate::Create(); | 3265 return memory::ChromeMemoryCoordinatorDelegate::Create(); |
| 3247 } | 3266 } |
| OLD | NEW |