Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: ash/system/network/vpn_list_view.cc

Issue 2865533002: Reset HoverHighlightView state before re-populating (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/system/network/network_list.cc ('k') | ash/system/tray/hover_highlight_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ash/system/network/vpn_list_view.h" 5 #include "ash/system/network/vpn_list_view.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 if (network && network->IsConnectingState()) 185 if (network && network->IsConnectingState())
186 network_icon::NetworkIconAnimation::GetInstance()->AddObserver(this); 186 network_icon::NetworkIconAnimation::GetInstance()->AddObserver(this);
187 else 187 else
188 network_icon::NetworkIconAnimation::GetInstance()->RemoveObserver(this); 188 network_icon::NetworkIconAnimation::GetInstance()->RemoveObserver(this);
189 189
190 if (!network) { 190 if (!network) {
191 // This is a transient state where the network has been removed already but 191 // This is a transient state where the network has been removed already but
192 // the network list in the UI has not been updated yet. 192 // the network list in the UI has not been updated yet.
193 return; 193 return;
194 } 194 }
195 RemoveAllChildViews(true); 195 Reset();
196 disconnect_button_ = nullptr; 196 disconnect_button_ = nullptr;
197 197
198 gfx::ImageSkia image = 198 gfx::ImageSkia image =
199 network_icon::GetImageForNetwork(network, network_icon::ICON_TYPE_LIST); 199 network_icon::GetImageForNetwork(network, network_icon::ICON_TYPE_LIST);
200 base::string16 label = network_icon::GetLabelForNetwork( 200 base::string16 label = network_icon::GetLabelForNetwork(
201 network, network_icon::ICON_TYPE_MENU_LIST); 201 network, network_icon::ICON_TYPE_MENU_LIST);
202 if (network->IsConnectedState()) 202 if (network->IsConnectedState())
203 SetupConnectedItem(label, image); 203 SetupConnectedItem(label, image);
204 else if (network->IsConnectingState()) 204 else if (network->IsConnectingState())
205 SetupConnectingItem(label, image); 205 SetupConnectingItem(label, image);
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 } 388 }
389 } 389 }
390 390
391 // Add providers without any configured networks, in the order that the 391 // Add providers without any configured networks, in the order that the
392 // providers were returned by the extensions system. 392 // providers were returned by the extensions system.
393 for (const VPNProvider& provider : providers) 393 for (const VPNProvider& provider : providers)
394 AddProviderAndNetworks(provider, networks); 394 AddProviderAndNetworks(provider, networks);
395 } 395 }
396 396
397 } // namespace ash 397 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/network/network_list.cc ('k') | ash/system/tray/hover_highlight_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698