| 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 1593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1604 switches::kEnableOfflineAutoReloadVisibleOnly)) { | 1604 switches::kEnableOfflineAutoReloadVisibleOnly)) { |
| 1605 return true; | 1605 return true; |
| 1606 } | 1606 } |
| 1607 if (browser_command_line.HasSwitch( | 1607 if (browser_command_line.HasSwitch( |
| 1608 switches::kDisableOfflineAutoReloadVisibleOnly)) { | 1608 switches::kDisableOfflineAutoReloadVisibleOnly)) { |
| 1609 return false; | 1609 return false; |
| 1610 } | 1610 } |
| 1611 return true; | 1611 return true; |
| 1612 } | 1612 } |
| 1613 | 1613 |
| 1614 #if !defined(OS_ANDROID) | |
| 1615 bool AreExperimentalWebPlatformFeaturesEnabled() { | |
| 1616 const base::CommandLine& browser_command_line = | |
| 1617 *base::CommandLine::ForCurrentProcess(); | |
| 1618 return browser_command_line.HasSwitch( | |
| 1619 switches::kEnableExperimentalWebPlatformFeatures); | |
| 1620 } | |
| 1621 #endif | |
| 1622 | |
| 1623 void MaybeAppendBlinkSettingsSwitchForFieldTrial( | 1614 void MaybeAppendBlinkSettingsSwitchForFieldTrial( |
| 1624 const base::CommandLine& browser_command_line, | 1615 const base::CommandLine& browser_command_line, |
| 1625 base::CommandLine* command_line) { | 1616 base::CommandLine* command_line) { |
| 1626 // List of field trials that modify the blink-settings command line flag. No | 1617 // List of field trials that modify the blink-settings command line flag. No |
| 1627 // two field trials in the list should specify the same keys, otherwise one | 1618 // two field trials in the list should specify the same keys, otherwise one |
| 1628 // field trial may overwrite another. See Source/core/frame/Settings.in in | 1619 // field trial may overwrite another. See Source/core/frame/Settings.in in |
| 1629 // Blink for the list of valid keys. | 1620 // Blink for the list of valid keys. |
| 1630 static const char* const kBlinkSettingsFieldTrials[] = { | 1621 static const char* const kBlinkSettingsFieldTrials[] = { |
| 1631 // Keys: backgroundHtmlParserOutstandingTokenLimit | 1622 // Keys: backgroundHtmlParserOutstandingTokenLimit |
| 1632 // backgroundHtmlParserPendingTokenLimit | 1623 // backgroundHtmlParserPendingTokenLimit |
| (...skipping 1585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3218 base::Bind(&ForwardInstalledAppProviderRequest, | 3209 base::Bind(&ForwardInstalledAppProviderRequest, |
| 3219 render_frame_host->GetJavaInterfaces()->GetWeakPtr())); | 3210 render_frame_host->GetJavaInterfaces()->GetWeakPtr())); |
| 3220 content::WebContents* web_contents = | 3211 content::WebContents* web_contents = |
| 3221 content::WebContents::FromRenderFrameHost(render_frame_host); | 3212 content::WebContents::FromRenderFrameHost(render_frame_host); |
| 3222 if (web_contents) { | 3213 if (web_contents) { |
| 3223 registry->AddInterface( | 3214 registry->AddInterface( |
| 3224 base::Bind(&ForwardShareServiceRequest, | 3215 base::Bind(&ForwardShareServiceRequest, |
| 3225 web_contents->GetJavaInterfaces()->GetWeakPtr())); | 3216 web_contents->GetJavaInterfaces()->GetWeakPtr())); |
| 3226 } | 3217 } |
| 3227 #else | 3218 #else |
| 3228 if (AreExperimentalWebPlatformFeaturesEnabled() && | 3219 if (base::FeatureList::IsEnabled(features::kWebPayments)) { |
| 3229 base::FeatureList::IsEnabled(features::kWebPayments)) { | |
| 3230 content::WebContents* web_contents = | 3220 content::WebContents* web_contents = |
| 3231 content::WebContents::FromRenderFrameHost(render_frame_host); | 3221 content::WebContents::FromRenderFrameHost(render_frame_host); |
| 3232 if (web_contents) { | 3222 if (web_contents) { |
| 3233 registry->AddInterface(base::Bind( | 3223 registry->AddInterface(base::Bind( |
| 3234 payments::CreatePaymentRequestForWebContents, web_contents)); | 3224 payments::CreatePaymentRequestForWebContents, web_contents)); |
| 3235 } | 3225 } |
| 3236 } | 3226 } |
| 3237 #endif | 3227 #endif |
| 3238 | 3228 |
| 3239 #if defined(OS_LINUX) || defined(OS_WIN) | 3229 #if defined(OS_LINUX) || defined(OS_WIN) |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3624 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3614 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
| 3625 return variations::GetVariationParamValue( | 3615 return variations::GetVariationParamValue( |
| 3626 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3616 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
| 3627 } | 3617 } |
| 3628 | 3618 |
| 3629 // static | 3619 // static |
| 3630 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( | 3620 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( |
| 3631 const storage::QuotaSettings* settings) { | 3621 const storage::QuotaSettings* settings) { |
| 3632 g_default_quota_settings = settings; | 3622 g_default_quota_settings = settings; |
| 3633 } | 3623 } |
| OLD | NEW |