| 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 #elif defined(OS_ANDROID) | 242 #elif defined(OS_ANDROID) |
| 243 #include "chrome/browser/chrome_browser_main_android.h" | 243 #include "chrome/browser/chrome_browser_main_android.h" |
| 244 #include "chrome/common/descriptors_android.h" | 244 #include "chrome/common/descriptors_android.h" |
| 245 #include "components/crash/content/browser/crash_dump_manager_android.h" | 245 #include "components/crash/content/browser/crash_dump_manager_android.h" |
| 246 #include "components/navigation_interception/intercept_navigation_delegate.h" | 246 #include "components/navigation_interception/intercept_navigation_delegate.h" |
| 247 #include "ui/base/resource/resource_bundle_android.h" | 247 #include "ui/base/resource/resource_bundle_android.h" |
| 248 #elif defined(OS_POSIX) | 248 #elif defined(OS_POSIX) |
| 249 #include "chrome/browser/chrome_browser_main_posix.h" | 249 #include "chrome/browser/chrome_browser_main_posix.h" |
| 250 #endif | 250 #endif |
| 251 | 251 |
| 252 #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) | 252 #if !defined(OS_ANDROID) |
| 253 #include "chrome/browser/payments/payment_request_factory.h" | 253 #include "chrome/browser/payments/payment_request_factory.h" |
| 254 #endif | 254 #endif |
| 255 | 255 |
| 256 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 256 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 257 #include "base/debug/leak_annotations.h" | 257 #include "base/debug/leak_annotations.h" |
| 258 #include "components/crash/content/app/breakpad_linux.h" | 258 #include "components/crash/content/app/breakpad_linux.h" |
| 259 #include "components/crash/content/browser/crash_handler_host_linux.h" | 259 #include "components/crash/content/browser/crash_handler_host_linux.h" |
| 260 #endif | 260 #endif |
| 261 | 261 |
| 262 #if defined(OS_ANDROID) | 262 #if defined(OS_ANDROID) |
| (...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1474 switches::kEnableOfflineAutoReloadVisibleOnly)) { | 1474 switches::kEnableOfflineAutoReloadVisibleOnly)) { |
| 1475 return true; | 1475 return true; |
| 1476 } | 1476 } |
| 1477 if (browser_command_line.HasSwitch( | 1477 if (browser_command_line.HasSwitch( |
| 1478 switches::kDisableOfflineAutoReloadVisibleOnly)) { | 1478 switches::kDisableOfflineAutoReloadVisibleOnly)) { |
| 1479 return false; | 1479 return false; |
| 1480 } | 1480 } |
| 1481 return true; | 1481 return true; |
| 1482 } | 1482 } |
| 1483 | 1483 |
| 1484 #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) | 1484 #if !defined(OS_ANDROID) |
| 1485 bool AreExperimentalWebPlatformFeaturesEnabled() { | 1485 bool AreExperimentalWebPlatformFeaturesEnabled() { |
| 1486 const base::CommandLine& browser_command_line = | 1486 const base::CommandLine& browser_command_line = |
| 1487 *base::CommandLine::ForCurrentProcess(); | 1487 *base::CommandLine::ForCurrentProcess(); |
| 1488 return browser_command_line.HasSwitch( | 1488 return browser_command_line.HasSwitch( |
| 1489 switches::kEnableExperimentalWebPlatformFeatures); | 1489 switches::kEnableExperimentalWebPlatformFeatures); |
| 1490 } | 1490 } |
| 1491 #endif | 1491 #endif |
| 1492 | 1492 |
| 1493 void MaybeAppendBlinkSettingsSwitchForFieldTrial( | 1493 void MaybeAppendBlinkSettingsSwitchForFieldTrial( |
| 1494 const base::CommandLine& browser_command_line, | 1494 const base::CommandLine& browser_command_line, |
| (...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3063 content::WebContents* web_contents = | 3063 content::WebContents* web_contents = |
| 3064 content::WebContents::FromRenderFrameHost(render_frame_host); | 3064 content::WebContents::FromRenderFrameHost(render_frame_host); |
| 3065 if (web_contents) { | 3065 if (web_contents) { |
| 3066 registry->AddInterface( | 3066 registry->AddInterface( |
| 3067 web_contents->GetJavaInterfaces() | 3067 web_contents->GetJavaInterfaces() |
| 3068 ->CreateInterfaceFactory<payments::mojom::PaymentRequest>()); | 3068 ->CreateInterfaceFactory<payments::mojom::PaymentRequest>()); |
| 3069 registry->AddInterface( | 3069 registry->AddInterface( |
| 3070 base::Bind(&ForwardShareServiceRequest, | 3070 base::Bind(&ForwardShareServiceRequest, |
| 3071 web_contents->GetJavaInterfaces()->GetWeakPtr())); | 3071 web_contents->GetJavaInterfaces()->GetWeakPtr())); |
| 3072 } | 3072 } |
| 3073 #elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) | 3073 #else |
| 3074 // TODO(crbug.com/679127): Enable for MacViews implementation. | |
| 3075 if (AreExperimentalWebPlatformFeaturesEnabled()) { | 3074 if (AreExperimentalWebPlatformFeaturesEnabled()) { |
| 3076 content::WebContents* web_contents = | 3075 content::WebContents* web_contents = |
| 3077 content::WebContents::FromRenderFrameHost(render_frame_host); | 3076 content::WebContents::FromRenderFrameHost(render_frame_host); |
| 3078 if (web_contents) { | 3077 if (web_contents) { |
| 3079 registry->AddInterface(base::Bind( | 3078 registry->AddInterface(base::Bind( |
| 3080 payments::CreatePaymentRequestForWebContents, web_contents)); | 3079 payments::CreatePaymentRequestForWebContents, web_contents)); |
| 3081 } | 3080 } |
| 3082 } | 3081 } |
| 3083 #endif | 3082 #endif |
| 3084 | 3083 |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3432 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3431 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
| 3433 return variations::GetVariationParamValue( | 3432 return variations::GetVariationParamValue( |
| 3434 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3433 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
| 3435 } | 3434 } |
| 3436 | 3435 |
| 3437 //static | 3436 //static |
| 3438 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( | 3437 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( |
| 3439 const storage::QuotaSettings* settings) { | 3438 const storage::QuotaSettings* settings) { |
| 3440 g_default_quota_settings = settings; | 3439 g_default_quota_settings = settings; |
| 3441 } | 3440 } |
| OLD | NEW |