diff --git a/ash/system/network/network_list.cc b/ash/system/network/network_list.cc index b78fc65e4bd1e..036eb9b2c61cb 100644 --- a/ash/system/network/network_list.cc +++ b/ash/system/network/network_list.cc @@ -845,21 +845,18 @@ std::unique_ptr> NetworkListView::UpdateNetworkChildren( for (const auto& info : network_list_) { if (info->type != type) continue; - if (UpdateNetworkChild(index, info.get())) - ++index; + UpdateNetworkChild(index++, info.get()); new_guids->insert(info->guid); } return new_guids; } -bool NetworkListView::UpdateNetworkChild(int index, const NetworkInfo* info) { - bool added = false; +void NetworkListView::UpdateNetworkChild(int index, const NetworkInfo* info) { HoverHighlightView* network_view = nullptr; NetworkGuidMap::const_iterator found = network_guid_map_.find(info->guid); if (found == network_guid_map_.end()) { network_view = new HoverHighlightView(this); UpdateViewForNetwork(network_view, *info); - added = true; } else { network_view = found->second; if (NeedUpdateViewForNetwork(*info)) @@ -870,7 +867,6 @@ bool NetworkListView::UpdateNetworkChild(int index, const NetworkInfo* info) { network_view->SetEnabled(false); network_map_[network_view] = info->guid; network_guid_map_[info->guid] = network_view; - return added; } void NetworkListView::PlaceViewAtIndex(views::View* view, int index) { diff --git a/ash/system/network/network_list.h b/ash/system/network/network_list.h index 6ae1f8fb13e1d..f1f59e8a5d3d1 100644 --- a/ash/system/network/network_list.h +++ b/ash/system/network/network_list.h @@ -93,8 +93,7 @@ class NetworkListView : public NetworkStateListDetailedView, std::unique_ptr> UpdateNetworkChildren( NetworkInfo::Type type, int child_index); - // Returns true if a new child was added. - bool UpdateNetworkChild(int index, const NetworkInfo* info); + void UpdateNetworkChild(int index, const NetworkInfo* info); // Reorders children of |scroll_content()| as necessary placing |view| at // |index|.