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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 #include "net/cookies/cookie_options.h" | 194 #include "net/cookies/cookie_options.h" |
| 195 #include "net/ssl/ssl_cert_request_info.h" | 195 #include "net/ssl/ssl_cert_request_info.h" |
| 196 #include "ppapi/features/features.h" | 196 #include "ppapi/features/features.h" |
| 197 #include "ppapi/host/ppapi_host.h" | 197 #include "ppapi/host/ppapi_host.h" |
| 198 #include "printing/features/features.h" | 198 #include "printing/features/features.h" |
| 199 #include "services/image_decoder/public/interfaces/constants.mojom.h" | 199 #include "services/image_decoder/public/interfaces/constants.mojom.h" |
| 200 #include "services/preferences/public/interfaces/preferences.mojom.h" | 200 #include "services/preferences/public/interfaces/preferences.mojom.h" |
| 201 #include "services/service_manager/public/cpp/interface_provider.h" | 201 #include "services/service_manager/public/cpp/interface_provider.h" |
| 202 #include "services/service_manager/public/cpp/interface_registry.h" | 202 #include "services/service_manager/public/cpp/interface_registry.h" |
| 203 #include "services/service_manager/public/cpp/service.h" | 203 #include "services/service_manager/public/cpp/service.h" |
| 204 #include "services/shape_detection/public/interfaces/barcodedetection.mojom.h" | |
| 205 #include "services/shape_detection/public/interfaces/textdetection.mojom.h" | |
| 206 #include "storage/browser/fileapi/external_mount_points.h" | 204 #include "storage/browser/fileapi/external_mount_points.h" |
| 207 #include "third_party/WebKit/public/platform/modules/webshare/webshare.mojom.h" | 205 #include "third_party/WebKit/public/platform/modules/webshare/webshare.mojom.h" |
| 208 #include "ui/base/l10n/l10n_util.h" | 206 #include "ui/base/l10n/l10n_util.h" |
| 209 #include "ui/base/resource/resource_bundle.h" | 207 #include "ui/base/resource/resource_bundle.h" |
| 210 #include "ui/resources/grit/ui_resources.h" | 208 #include "ui/resources/grit/ui_resources.h" |
| 211 #include "url/gurl.h" | 209 #include "url/gurl.h" |
| 212 #include "url/origin.h" | 210 #include "url/origin.h" |
| 213 | 211 |
| 214 #if defined(OS_WIN) | 212 #if defined(OS_WIN) |
| 215 #include "base/strings/string_tokenizer.h" | 213 #include "base/strings/string_tokenizer.h" |
| (...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1438 switches::kEnableOfflineAutoReloadVisibleOnly)) { | 1436 switches::kEnableOfflineAutoReloadVisibleOnly)) { |
| 1439 return true; | 1437 return true; |
| 1440 } | 1438 } |
| 1441 if (browser_command_line.HasSwitch( | 1439 if (browser_command_line.HasSwitch( |
| 1442 switches::kDisableOfflineAutoReloadVisibleOnly)) { | 1440 switches::kDisableOfflineAutoReloadVisibleOnly)) { |
| 1443 return false; | 1441 return false; |
| 1444 } | 1442 } |
| 1445 return true; | 1443 return true; |
| 1446 } | 1444 } |
| 1447 | 1445 |
| 1448 #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) || \ | 1446 #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) |
| 1449 defined(OS_ANDROID) | |
|
mcasas
2017/01/18 02:05:10
nit: is this your changes or a side effect of some
xianglu
2017/01/18 02:22:30
I removed this because otherwise AreExperimentalWe
| |
| 1450 bool AreExperimentalWebPlatformFeaturesEnabled() { | 1447 bool AreExperimentalWebPlatformFeaturesEnabled() { |
| 1451 const base::CommandLine& browser_command_line = | 1448 const base::CommandLine& browser_command_line = |
| 1452 *base::CommandLine::ForCurrentProcess(); | 1449 *base::CommandLine::ForCurrentProcess(); |
| 1453 return browser_command_line.HasSwitch( | 1450 return browser_command_line.HasSwitch( |
| 1454 switches::kEnableExperimentalWebPlatformFeatures); | 1451 switches::kEnableExperimentalWebPlatformFeatures); |
| 1455 } | 1452 } |
| 1456 #endif | 1453 #endif |
| 1457 | 1454 |
| 1458 void MaybeAppendBlinkSettingsSwitchForFieldTrial( | 1455 void MaybeAppendBlinkSettingsSwitchForFieldTrial( |
| 1459 const base::CommandLine& browser_command_line, | 1456 const base::CommandLine& browser_command_line, |
| (...skipping 1534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2994 #if defined(OS_ANDROID) | 2991 #if defined(OS_ANDROID) |
| 2995 content::WebContents* web_contents = | 2992 content::WebContents* web_contents = |
| 2996 content::WebContents::FromRenderFrameHost(render_frame_host); | 2993 content::WebContents::FromRenderFrameHost(render_frame_host); |
| 2997 if (web_contents) { | 2994 if (web_contents) { |
| 2998 registry->AddInterface( | 2995 registry->AddInterface( |
| 2999 web_contents->GetJavaInterfaces() | 2996 web_contents->GetJavaInterfaces() |
| 3000 ->CreateInterfaceFactory<payments::mojom::PaymentRequest>()); | 2997 ->CreateInterfaceFactory<payments::mojom::PaymentRequest>()); |
| 3001 registry->AddInterface( | 2998 registry->AddInterface( |
| 3002 base::Bind(&ForwardShareServiceRequest, | 2999 base::Bind(&ForwardShareServiceRequest, |
| 3003 web_contents->GetJavaInterfaces()->GetWeakPtr())); | 3000 web_contents->GetJavaInterfaces()->GetWeakPtr())); |
| 3004 if (AreExperimentalWebPlatformFeaturesEnabled()) { | |
| 3005 registry->AddInterface( | |
| 3006 web_contents->GetJavaInterfaces() | |
| 3007 ->CreateInterfaceFactory< | |
| 3008 shape_detection::mojom::BarcodeDetection>()); | |
| 3009 registry->AddInterface(web_contents->GetJavaInterfaces() | |
| 3010 ->CreateInterfaceFactory< | |
| 3011 shape_detection::mojom::TextDetection>()); | |
| 3012 } | |
| 3013 } | 3001 } |
| 3014 #elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) | 3002 #elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) |
| 3015 // TODO(crbug.com/679127): Enable for MacViews implementation. | 3003 // TODO(crbug.com/679127): Enable for MacViews implementation. |
| 3016 if (AreExperimentalWebPlatformFeaturesEnabled()) { | 3004 if (AreExperimentalWebPlatformFeaturesEnabled()) { |
| 3017 content::WebContents* web_contents = | 3005 content::WebContents* web_contents = |
| 3018 content::WebContents::FromRenderFrameHost(render_frame_host); | 3006 content::WebContents::FromRenderFrameHost(render_frame_host); |
| 3019 if (web_contents) { | 3007 if (web_contents) { |
| 3020 registry->AddInterface(base::Bind( | 3008 registry->AddInterface(base::Bind( |
| 3021 payments::CreatePaymentRequestForWebContents, web_contents)); | 3009 payments::CreatePaymentRequestForWebContents, web_contents)); |
| 3022 } | 3010 } |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3367 bool ChromeContentBrowserClient::ShouldRedirectDOMStorageTaskRunner() { | 3355 bool ChromeContentBrowserClient::ShouldRedirectDOMStorageTaskRunner() { |
| 3368 return variations::GetVariationParamValue( | 3356 return variations::GetVariationParamValue( |
| 3369 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true"; | 3357 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true"; |
| 3370 } | 3358 } |
| 3371 | 3359 |
| 3372 bool ChromeContentBrowserClient:: | 3360 bool ChromeContentBrowserClient:: |
| 3373 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3361 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
| 3374 return variations::GetVariationParamValue( | 3362 return variations::GetVariationParamValue( |
| 3375 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3363 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
| 3376 } | 3364 } |
| OLD | NEW |