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/chromeos/cros/network_library_impl_cros.h" | 5 #include "chrome/browser/chromeos/cros/network_library_impl_cros.h" |
6 | 6 |
7 #include <dbus/dbus-glib.h> | 7 #include <dbus/dbus-glib.h> |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/json/json_writer.h" // for debug output only. | 9 #include "base/json/json_writer.h" // for debug output only. |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 } | 836 } |
837 // Iterate through list of remaining networks that are no longer in the | 837 // Iterate through list of remaining networks that are no longer in the |
838 // list and delete them or update their status and re-add them to the list. | 838 // list and delete them or update their status and re-add them to the list. |
839 for (NetworkMap::iterator iter = old_network_map.begin(); | 839 for (NetworkMap::iterator iter = old_network_map.begin(); |
840 iter != old_network_map.end(); ++iter) { | 840 iter != old_network_map.end(); ++iter) { |
841 Network* network = iter->second; | 841 Network* network = iter->second; |
842 VLOG(2) << "Delete Network: " << network->name() | 842 VLOG(2) << "Delete Network: " << network->name() |
843 << " State = " << network->GetStateString() | 843 << " State = " << network->GetStateString() |
844 << " connecting = " << network->connecting() | 844 << " connecting = " << network->connecting() |
845 << " connection_started = " << network->connection_started(); | 845 << " connection_started = " << network->connection_started(); |
| 846 WifiNetwork* wifi = NULL; |
| 847 if (network->type() == TYPE_WIFI) |
| 848 wifi = static_cast<WifiNetwork*>(network); |
846 if (network->failed() && network->notify_failure()) { | 849 if (network->failed() && network->notify_failure()) { |
847 // We have not notified observers of a connection failure yet. | 850 // We have not notified observers of a connection failure yet. |
848 AddNetwork(network); | 851 AddNetwork(network); |
849 } else if (network->connecting() && network->connection_started()) { | 852 } else if (network->connecting() && network->connection_started() && |
850 // Network was in connecting state; set state to failed. | 853 !(wifi && wifi->hidden_ssid())) { |
| 854 // Network was in connecting state; set state to failed, but not if it |
| 855 // had a hidden SSID (since that won't appear in the scanning list). |
851 VLOG(2) << "Removed network was connecting: " << network->name(); | 856 VLOG(2) << "Removed network was connecting: " << network->name(); |
852 network->SetState(STATE_FAILURE); | 857 network->SetState(STATE_FAILURE); |
853 AddNetwork(network); | 858 AddNetwork(network); |
854 } else { | 859 } else { |
855 VLOG(2) << "Deleting removed network: " << network->name() | 860 VLOG(2) << "Deleting removed network: " << network->name() |
856 << " State = " << network->GetStateString(); | 861 << " State = " << network->GetStateString(); |
857 DeleteNetwork(network); | 862 DeleteNetwork(network); |
858 } | 863 } |
859 } | 864 } |
860 // If the last network has disappeared, nothing else will | 865 // If the last network has disappeared, nothing else will |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 // Switch back to signed settings value. | 1190 // Switch back to signed settings value. |
1186 SetCellularDataRoamingAllowed(settings_value); | 1191 SetCellularDataRoamingAllowed(settings_value); |
1187 } | 1192 } |
1188 } | 1193 } |
1189 } | 1194 } |
1190 NotifyNetworkManagerChanged(false); // Not forced. | 1195 NotifyNetworkManagerChanged(false); // Not forced. |
1191 AddNetworkDeviceObserver(device_path, network_device_observer_.get()); | 1196 AddNetworkDeviceObserver(device_path, network_device_observer_.get()); |
1192 } | 1197 } |
1193 | 1198 |
1194 } // namespace chromeos | 1199 } // namespace chromeos |
OLD | NEW |