Chromium Code Reviews| Index: net/proxy/proxy_config_service_android.cc |
| diff --git a/net/proxy/proxy_config_service_android.cc b/net/proxy/proxy_config_service_android.cc |
| index f1a0b6cca54f702b924b969ba320d691b61b1108..18f878312ad02e3a2a3c30775769df49b737a860 100644 |
| --- a/net/proxy/proxy_config_service_android.cc |
| +++ b/net/proxy/proxy_config_service_android.cc |
| @@ -197,7 +197,8 @@ class ProxyConfigServiceAndroid::Delegate |
| : jni_delegate_(this), |
| network_task_runner_(network_task_runner), |
| jni_task_runner_(jni_task_runner), |
| - get_property_callback_(get_property_callback) { |
| + get_property_callback_(get_property_callback), |
| + use_local_proxy_(false) { |
| } |
| void SetupJNI() { |
| @@ -271,13 +272,22 @@ class ProxyConfigServiceAndroid::Delegate |
| const std::vector<std::string>& exclusion_list) { |
| DCHECK(OnJNIThread()); |
| ProxyConfig proxy_config; |
| - CreateStaticProxyConfig(host, port, pac_url, exclusion_list, &proxy_config); |
| + if (use_local_proxy_) { |
| + CreateStaticProxyConfig(host, port, "", exclusion_list, &proxy_config); |
| + } else { |
| + CreateStaticProxyConfig(host, port, pac_url, exclusion_list, |
| + &proxy_config); |
| + } |
| network_task_runner_->PostTask( |
| FROM_HERE, |
| base::Bind( |
| &Delegate::SetNewConfigOnNetworkThread, this, proxy_config)); |
| } |
| + void set_use_local_proxy(bool enabled) { |
|
eroman
2014/11/21 01:55:15
Something like "exclude_pac_url" seems like it wou
sgurun-gerrit only
2014/11/21 02:13:37
Acknowledged.
I actually think that we are relyin
|
| + use_local_proxy_ = enabled; |
| + } |
| + |
| private: |
| friend class base::RefCountedThreadSafe<Delegate>; |
| @@ -344,6 +354,7 @@ class ProxyConfigServiceAndroid::Delegate |
| scoped_refptr<base::SequencedTaskRunner> jni_task_runner_; |
| GetPropertyCallback get_property_callback_; |
| ProxyConfig proxy_config_; |
| + bool use_local_proxy_; |
| DISALLOW_COPY_AND_ASSIGN(Delegate); |
| }; |
| @@ -366,6 +377,10 @@ bool ProxyConfigServiceAndroid::Register(JNIEnv* env) { |
| return RegisterNativesImpl(env); |
| } |
| +void ProxyConfigServiceAndroid::set_use_local_proxy(bool enabled) { |
| + delegate_->set_use_local_proxy(enabled); |
| +} |
| + |
| void ProxyConfigServiceAndroid::AddObserver(Observer* observer) { |
| delegate_->AddObserver(observer); |
| } |