| 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 "net/proxy/proxy_config_service_linux.h" | 5 #include "net/proxy/proxy_config_service_linux.h" |
| 6 | 6 |
| 7 // glib >=2.40 deprecate g_settings_list_schemas in favor of | 7 // glib >=2.40 deprecate g_settings_list_schemas in favor of |
| 8 // g_settings_schema_source_list_schemas. This function is not available on | 8 // g_settings_schema_source_list_schemas. This function is not available on |
| 9 // earlier versions that we still need to support (specifically, 2.32), so | 9 // earlier versions that we still need to support (specifically, 2.32), so |
| 10 // disable the warning. | 10 // disable the warning. |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // Note that this uses "suffix" matching. So a bypass of "google.com" | 198 // Note that this uses "suffix" matching. So a bypass of "google.com" |
| 199 // is understood to mean a bypass of "*google.com". | 199 // is understood to mean a bypass of "*google.com". |
| 200 config->proxy_rules().bypass_rules.ParseFromStringUsingSuffixMatching( | 200 config->proxy_rules().bypass_rules.ParseFromStringUsingSuffixMatching( |
| 201 no_proxy); | 201 no_proxy); |
| 202 return true; | 202 return true; |
| 203 } | 203 } |
| 204 | 204 |
| 205 namespace { | 205 namespace { |
| 206 | 206 |
| 207 const int kDebounceTimeoutMilliseconds = 250; | 207 const int kDebounceTimeoutMilliseconds = 250; |
| 208 const char kProxyGConfSchema[] = "org.gnome.system.proxy"; | |
| 209 | 208 |
| 210 #if defined(USE_GCONF) | 209 #if defined(USE_GCONF) |
| 211 // This setting getter uses gconf, as used in GNOME 2 and some GNOME 3 desktops. | 210 // This setting getter uses gconf, as used in GNOME 2 and some GNOME 3 desktops. |
| 212 class SettingGetterImplGConf : public ProxyConfigServiceLinux::SettingGetter { | 211 class SettingGetterImplGConf : public ProxyConfigServiceLinux::SettingGetter { |
| 213 public: | 212 public: |
| 214 SettingGetterImplGConf() | 213 SettingGetterImplGConf() |
| 215 : client_(NULL), system_proxy_id_(0), system_http_proxy_id_(0), | 214 : client_(NULL), system_proxy_id_(0), system_http_proxy_id_(0), |
| 216 notify_delegate_(NULL) { | 215 notify_delegate_(NULL) { |
| 217 } | 216 } |
| 218 | 217 |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 // Task runner for the thread that we make gconf calls on. It should | 513 // Task runner for the thread that we make gconf calls on. It should |
| 515 // be the UI thread and all our methods should be called on this | 514 // be the UI thread and all our methods should be called on this |
| 516 // thread. Only for assertions. | 515 // thread. Only for assertions. |
| 517 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 516 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 518 | 517 |
| 519 DISALLOW_COPY_AND_ASSIGN(SettingGetterImplGConf); | 518 DISALLOW_COPY_AND_ASSIGN(SettingGetterImplGConf); |
| 520 }; | 519 }; |
| 521 #endif // defined(USE_GCONF) | 520 #endif // defined(USE_GCONF) |
| 522 | 521 |
| 523 #if defined(USE_GIO) | 522 #if defined(USE_GIO) |
| 523 const char kProxyGConfSchema[] = "org.gnome.system.proxy"; |
| 524 |
| 524 // This setting getter uses gsettings, as used in most GNOME 3 desktops. | 525 // This setting getter uses gsettings, as used in most GNOME 3 desktops. |
| 525 class SettingGetterImplGSettings | 526 class SettingGetterImplGSettings |
| 526 : public ProxyConfigServiceLinux::SettingGetter { | 527 : public ProxyConfigServiceLinux::SettingGetter { |
| 527 public: | 528 public: |
| 528 SettingGetterImplGSettings() : | 529 SettingGetterImplGSettings() : |
| 529 client_(NULL), | 530 client_(NULL), |
| 530 http_client_(NULL), | 531 http_client_(NULL), |
| 531 https_client_(NULL), | 532 https_client_(NULL), |
| 532 ftp_client_(NULL), | 533 ftp_client_(NULL), |
| 533 socks_client_(NULL), | 534 socks_client_(NULL), |
| (...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1772 void ProxyConfigServiceLinux::RemoveObserver(Observer* observer) { | 1773 void ProxyConfigServiceLinux::RemoveObserver(Observer* observer) { |
| 1773 delegate_->RemoveObserver(observer); | 1774 delegate_->RemoveObserver(observer); |
| 1774 } | 1775 } |
| 1775 | 1776 |
| 1776 ProxyConfigService::ConfigAvailability | 1777 ProxyConfigService::ConfigAvailability |
| 1777 ProxyConfigServiceLinux::GetLatestProxyConfig(ProxyConfig* config) { | 1778 ProxyConfigServiceLinux::GetLatestProxyConfig(ProxyConfig* config) { |
| 1778 return delegate_->GetLatestProxyConfig(config); | 1779 return delegate_->GetLatestProxyConfig(config); |
| 1779 } | 1780 } |
| 1780 | 1781 |
| 1781 } // namespace net | 1782 } // namespace net |
| OLD | NEW |