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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 // Called from Java (on JNI thread) to signal that the proxy settings have | 53 // Called from Java (on JNI thread) to signal that the proxy settings have |
54 // changed. New proxy settings are fetched from the system property store. | 54 // changed. New proxy settings are fetched from the system property store. |
55 virtual void ProxySettingsChanged(JNIEnv*, jobject) = 0; | 55 virtual void ProxySettingsChanged(JNIEnv*, jobject) = 0; |
56 }; | 56 }; |
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 ~ProxyConfigServiceAndroid() override; |
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 | 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 | 68 // setting is enabled, the proxy config service ignores the PAC URL and uses |
69 // the local proxy for all proxy resolution. | 69 // the local proxy for all proxy resolution. |
70 void set_exclude_pac_url(bool enabled); | 70 void set_exclude_pac_url(bool enabled); |
71 | 71 |
72 // ProxyConfigService: | 72 // ProxyConfigService: |
73 // Called only on the network thread. | 73 // Called only on the network thread. |
74 virtual void AddObserver(Observer* observer) override; | 74 void AddObserver(Observer* observer) override; |
75 virtual void RemoveObserver(Observer* observer) override; | 75 void RemoveObserver(Observer* observer) override; |
76 virtual ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) override; | 76 ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) override; |
77 | 77 |
78 private: | 78 private: |
79 friend class ProxyConfigServiceAndroidTestBase; | 79 friend class ProxyConfigServiceAndroidTestBase; |
80 class Delegate; | 80 class Delegate; |
81 | 81 |
82 // For tests. | 82 // For tests. |
83 ProxyConfigServiceAndroid( | 83 ProxyConfigServiceAndroid( |
84 const scoped_refptr<base::SequencedTaskRunner>& network_task_runner, | 84 const scoped_refptr<base::SequencedTaskRunner>& network_task_runner, |
85 const scoped_refptr<base::SequencedTaskRunner>& jni_task_runner, | 85 const scoped_refptr<base::SequencedTaskRunner>& jni_task_runner, |
86 GetPropertyCallback get_property_callback); | 86 GetPropertyCallback get_property_callback); |
87 | 87 |
88 // For tests. | 88 // For tests. |
89 void ProxySettingsChanged(); | 89 void ProxySettingsChanged(); |
90 | 90 |
91 scoped_refptr<Delegate> delegate_; | 91 scoped_refptr<Delegate> delegate_; |
92 | 92 |
93 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceAndroid); | 93 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceAndroid); |
94 }; | 94 }; |
95 | 95 |
96 } // namespace net | 96 } // namespace net |
97 | 97 |
98 #endif // NET_PROXY_PROXY_CONFIG_SERVICE_ANDROID_H_ | 98 #endif // NET_PROXY_PROXY_CONFIG_SERVICE_ANDROID_H_ |
OLD | NEW |