| 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 "ui/chromeos/network/network_icon.h" | 5 #include "ui/chromeos/network/network_icon.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chromeos/network/device_state.h" | 8 #include "chromeos/network/device_state.h" |
| 9 #include "chromeos/network/network_connection_handler.h" | 9 #include "chromeos/network/network_connection_handler.h" |
| 10 #include "chromeos/network/network_state.h" | 10 #include "chromeos/network/network_state.h" |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 std::string roaming_state = network->roaming(); | 634 std::string roaming_state = network->roaming(); |
| 635 if (roaming_state != roaming_state_) { | 635 if (roaming_state != roaming_state_) { |
| 636 roaming_state_ = roaming_state; | 636 roaming_state_ = roaming_state; |
| 637 dirty = true; | 637 dirty = true; |
| 638 } | 638 } |
| 639 return dirty; | 639 return dirty; |
| 640 } | 640 } |
| 641 | 641 |
| 642 bool NetworkIconImpl::UpdatePortalState(const NetworkState* network) { | 642 bool NetworkIconImpl::UpdatePortalState(const NetworkState* network) { |
| 643 bool behind_captive_portal = false; | 643 bool behind_captive_portal = false; |
| 644 if (network) { | 644 if (network && NetworkPortalDetector::IsInitialized()) { |
| 645 NetworkPortalDetector::CaptivePortalState state = | 645 NetworkPortalDetector::CaptivePortalState state = |
| 646 NetworkPortalDetector::Get()->GetCaptivePortalState(network->guid()); | 646 NetworkPortalDetector::Get()->GetCaptivePortalState(network->guid()); |
| 647 behind_captive_portal = | 647 behind_captive_portal = |
| 648 state.status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL; | 648 state.status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL; |
| 649 } | 649 } |
| 650 | 650 |
| 651 if (behind_captive_portal == behind_captive_portal_) | 651 if (behind_captive_portal == behind_captive_portal_) |
| 652 return false; | 652 return false; |
| 653 behind_captive_portal_ = behind_captive_portal; | 653 behind_captive_portal_ = behind_captive_portal; |
| 654 return true; | 654 return true; |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 iter != networks.end(); ++iter) { | 953 iter != networks.end(); ++iter) { |
| 954 network_paths.insert((*iter)->path()); | 954 network_paths.insert((*iter)->path()); |
| 955 } | 955 } |
| 956 PurgeIconMap(ICON_TYPE_TRAY, network_paths); | 956 PurgeIconMap(ICON_TYPE_TRAY, network_paths); |
| 957 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths); | 957 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths); |
| 958 PurgeIconMap(ICON_TYPE_LIST, network_paths); | 958 PurgeIconMap(ICON_TYPE_LIST, network_paths); |
| 959 } | 959 } |
| 960 | 960 |
| 961 } // namespace network_icon | 961 } // namespace network_icon |
| 962 } // namespace ui | 962 } // namespace ui |
| OLD | NEW |