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 #ifndef NET_PROXY_PROXY_CONFIG_SERVICE_ANDROID_H_ | 5 #ifndef NET_PROXY_PROXY_CONFIG_SERVICE_ANDROID_H_ |
6 #define NET_PROXY_PROXY_CONFIG_SERVICE_ANDROID_H_ | 6 #define NET_PROXY_PROXY_CONFIG_SERVICE_ANDROID_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 ProxyConfigServiceAndroid( | 58 ProxyConfigServiceAndroid( |
59 const scoped_refptr<base::SequencedTaskRunner>& network_task_runner, | 59 const scoped_refptr<base::SequencedTaskRunner>& network_task_runner, |
60 const scoped_refptr<base::SequencedTaskRunner>& jni_task_runner); | 60 const scoped_refptr<base::SequencedTaskRunner>& jni_task_runner); |
61 | 61 |
62 virtual ~ProxyConfigServiceAndroid(); | 62 virtual ~ProxyConfigServiceAndroid(); |
63 | 63 |
64 // Register JNI bindings. | 64 // Register JNI bindings. |
65 static bool Register(JNIEnv* env); | 65 static bool Register(JNIEnv* env); |
66 | 66 |
| 67 // Android provides a local HTTP proxy that does PAC resolution. When this |
| 68 // setting is enabled, the proxy config service ignores the PAC URL and uses |
| 69 // the local proxy for all proxy resolution. |
| 70 void set_exclude_pac_url(bool enabled); |
| 71 |
67 // ProxyConfigService: | 72 // ProxyConfigService: |
68 // Called only on the network thread. | 73 // Called only on the network thread. |
69 virtual void AddObserver(Observer* observer) override; | 74 virtual void AddObserver(Observer* observer) override; |
70 virtual void RemoveObserver(Observer* observer) override; | 75 virtual void RemoveObserver(Observer* observer) override; |
71 virtual ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) override; | 76 virtual ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) override; |
72 | 77 |
73 private: | 78 private: |
74 friend class ProxyConfigServiceAndroidTestBase; | 79 friend class ProxyConfigServiceAndroidTestBase; |
75 class Delegate; | 80 class Delegate; |
76 | 81 |
77 // For tests. | 82 // For tests. |
78 ProxyConfigServiceAndroid( | 83 ProxyConfigServiceAndroid( |
79 const scoped_refptr<base::SequencedTaskRunner>& network_task_runner, | 84 const scoped_refptr<base::SequencedTaskRunner>& network_task_runner, |
80 const scoped_refptr<base::SequencedTaskRunner>& jni_task_runner, | 85 const scoped_refptr<base::SequencedTaskRunner>& jni_task_runner, |
81 GetPropertyCallback get_property_callback); | 86 GetPropertyCallback get_property_callback); |
82 | 87 |
83 // For tests. | 88 // For tests. |
84 void ProxySettingsChanged(); | 89 void ProxySettingsChanged(); |
85 | 90 |
86 scoped_refptr<Delegate> delegate_; | 91 scoped_refptr<Delegate> delegate_; |
87 | 92 |
88 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceAndroid); | 93 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceAndroid); |
89 }; | 94 }; |
90 | 95 |
91 } // namespace net | 96 } // namespace net |
92 | 97 |
93 #endif // NET_PROXY_PROXY_CONFIG_SERVICE_ANDROID_H_ | 98 #endif // NET_PROXY_PROXY_CONFIG_SERVICE_ANDROID_H_ |
OLD | NEW |