| 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 "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "chrome/browser/chromeos/net/proxy_config_handler.h" |
| 10 #include "chrome/browser/prefs/proxy_config_dictionary.h" | 11 #include "chrome/browser/prefs/proxy_config_dictionary.h" |
| 11 #include "chrome/browser/prefs/proxy_prefs.h" | 12 #include "chrome/browser/prefs/proxy_prefs.h" |
| 12 #include "chrome/common/chrome_notification_types.h" | 13 #include "chrome/common/chrome_notification_types.h" |
| 13 #include "chromeos/network/network_state.h" | 14 #include "chromeos/network/network_state.h" |
| 14 #include "chromeos/network/network_state_handler.h" | 15 #include "chromeos/network/network_state_handler.h" |
| 15 #include "net/proxy/proxy_config.h" | 16 #include "net/proxy/proxy_config.h" |
| 16 #include "third_party/cros_system_api/dbus/service_constants.h" | 17 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 17 | 18 |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 return ONLINE; | 207 return ONLINE; |
| 207 if (network->connection_state() == flimflam::kStatePortal) | 208 if (network->connection_state() == flimflam::kStatePortal) |
| 208 return CAPTIVE_PORTAL; | 209 return CAPTIVE_PORTAL; |
| 209 } | 210 } |
| 210 return OFFLINE; | 211 return OFFLINE; |
| 211 } | 212 } |
| 212 | 213 |
| 213 bool NetworkStateInformer::IsProxyConfigured(const NetworkState* network) { | 214 bool NetworkStateInformer::IsProxyConfigured(const NetworkState* network) { |
| 214 DCHECK(network); | 215 DCHECK(network); |
| 215 | 216 |
| 216 ProxyConfigDictionary proxy_dict(&network->proxy_config()); | 217 scoped_ptr<ProxyConfigDictionary> proxy_dict( |
| 218 proxy_config::GetProxyConfigForNetwork(*network)); |
| 217 ProxyPrefs::ProxyMode mode; | 219 ProxyPrefs::ProxyMode mode; |
| 218 return proxy_dict.GetMode(&mode) && mode == ProxyPrefs::MODE_FIXED_SERVERS; | 220 return (proxy_dict && |
| 221 proxy_dict->GetMode(&mode) && |
| 222 mode == ProxyPrefs::MODE_FIXED_SERVERS); |
| 219 } | 223 } |
| 220 | 224 |
| 221 } // namespace chromeos | 225 } // namespace chromeos |
| OLD | NEW |