Commit 5b92d4e1 authored by feng@chromium.org's avatar feng@chromium.org

[Android] Enable SB protection when --enable-spdy-proxy-auth is on.

The flag is used for testing purpose, and was left out.
Flywheel protection is on when flag is on or setting is on.

BUG=381896

Review URL: https://codereview.chromium.org/398853003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284002 0039d316-1c4b-4281-b951-d872f2087c98
parent 41faeb3e
......@@ -97,6 +97,7 @@
#if defined(OS_ANDROID)
#include "chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.h"
#include "chrome/browser/net/spdyproxy/data_reduction_proxy_settings_factory_android.h"
#include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h"
#endif // defined(OS_ANDROID)
#if defined(OS_CHROMEOS)
......@@ -839,6 +840,14 @@ bool ProfileIOData::GetMetricsEnabledStateOnIOThread() const {
#endif // defined(OS_CHROMEOS)
}
#if defined(OS_ANDROID)
bool ProfileIOData::IsDataReductionProxyEnabled() const {
return data_reduction_proxy_enabled_.GetValue() ||
CommandLine::ForCurrentProcess()->HasSwitch(
data_reduction_proxy::switches::kEnableDataReductionProxy);
}
#endif
base::WeakPtr<net::HttpServerProperties>
ProfileIOData::http_server_properties() const {
return http_server_properties_->GetWeakPtr();
......@@ -1175,7 +1184,9 @@ void ProfileIOData::ShutdownOnUIThread() {
enable_metrics_.Destroy();
#endif
safe_browsing_enabled_.Destroy();
#if defined(OS_ANDROID)
data_reduction_proxy_enabled_.Destroy();
#endif
printing_enabled_.Destroy();
sync_disabled_.Destroy();
signin_allowed_.Destroy();
......
......@@ -170,9 +170,13 @@ class ProfileIOData {
return &safe_browsing_enabled_;
}
#if defined(OS_ANDROID)
// TODO(feng): move the function to protected area.
// IsDataReductionProxyEnabled() should be used as public API.
BooleanPrefMember* data_reduction_proxy_enabled() const {
return &data_reduction_proxy_enabled_;
}
#endif
BooleanPrefMember* printing_enabled() const {
return &printing_enabled_;
......@@ -242,6 +246,12 @@ class ProfileIOData {
// should only be called from there.
bool GetMetricsEnabledStateOnIOThread() const;
#if defined(OS_ANDROID)
// Returns whether or not data reduction proxy is enabled in the browser
// instance on which this profile resides.
bool IsDataReductionProxyEnabled() const;
#endif
void set_client_cert_store_factory_for_testing(
const base::Callback<scoped_ptr<net::ClientCertStore>()>& factory) {
client_cert_store_factory_ = factory;
......@@ -534,7 +544,9 @@ class ProfileIOData {
mutable BooleanPrefMember enable_do_not_track_;
mutable BooleanPrefMember force_safesearch_;
mutable BooleanPrefMember safe_browsing_enabled_;
#if defined(OS_ANDROID)
mutable BooleanPrefMember data_reduction_proxy_enabled_;
#endif
mutable BooleanPrefMember printing_enabled_;
mutable BooleanPrefMember sync_disabled_;
mutable BooleanPrefMember signin_allowed_;
......
......@@ -490,7 +490,7 @@ void ChromeResourceDispatcherHostDelegate::AppendStandardResourceThrottles(
// policies first.
if (io_data->safe_browsing_enabled()->GetValue()
#if defined(OS_ANDROID)
|| io_data->data_reduction_proxy_enabled()->GetValue()
|| io_data->IsDataReductionProxyEnabled()
#endif
) {
bool is_subresource_request = resource_type != ResourceType::MAIN_FRAME;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment