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

Side by Side Diff: ash/system/chromeos/network/tray_network_state_observer.cc

Issue 286923003: Observe ConnectionState changed events in TrayNetworkStateObserver (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comment Created 6 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 | Annotate | Revision Log
« no previous file with comments | « ash/system/chromeos/network/tray_network_state_observer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ash/system/chromeos/network/tray_network_state_observer.h" 5 #include "ash/system/chromeos/network/tray_network_state_observer.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "ash/system/chromeos/network/network_icon.h" 10 #include "ash/system/chromeos/network/network_icon.h"
(...skipping 23 matching lines...) Expand all
34 34
35 void TrayNetworkStateObserver::NetworkListChanged() { 35 void TrayNetworkStateObserver::NetworkListChanged() {
36 delegate_->NetworkStateChanged(true); 36 delegate_->NetworkStateChanged(true);
37 network_icon::PurgeNetworkIconCache(); 37 network_icon::PurgeNetworkIconCache();
38 } 38 }
39 39
40 void TrayNetworkStateObserver::DeviceListChanged() { 40 void TrayNetworkStateObserver::DeviceListChanged() {
41 delegate_->NetworkStateChanged(false); 41 delegate_->NetworkStateChanged(false);
42 } 42 }
43 43
44 // Any change to the Default (primary connected) network, including Strength
45 // changes, should trigger a NetworkStateChanged update.
44 void TrayNetworkStateObserver::DefaultNetworkChanged( 46 void TrayNetworkStateObserver::DefaultNetworkChanged(
45 const chromeos::NetworkState* network) { 47 const chromeos::NetworkState* network) {
46 delegate_->NetworkStateChanged(true); 48 delegate_->NetworkStateChanged(true);
47 } 49 }
48 50
51 // Any change to the Connection State should trigger a NetworkStateChanged
52 // update. This is important when both a VPN and a physical network are
53 // connected.
54 void TrayNetworkStateObserver::NetworkConnectionStateChanged(
55 const chromeos::NetworkState* network) {
56 delegate_->NetworkStateChanged(true);
57 }
58
59 // This tracks Strength and other property changes for all networks. It will
60 // be called in addition to NetworkConnectionStateChanged for connection state
61 // changes.
49 void TrayNetworkStateObserver::NetworkPropertiesUpdated( 62 void TrayNetworkStateObserver::NetworkPropertiesUpdated(
50 const chromeos::NetworkState* network) { 63 const chromeos::NetworkState* network) {
51 if (network == 64 if (network ==
52 NetworkHandler::Get()->network_state_handler()->DefaultNetwork()) 65 NetworkHandler::Get()->network_state_handler()->DefaultNetwork()) {
66 // Trigger NetworkStateChanged in case the Strength property of the
67 // Default network changed.
53 delegate_->NetworkStateChanged(true); 68 delegate_->NetworkStateChanged(true);
69 }
54 delegate_->NetworkServiceChanged(network); 70 delegate_->NetworkServiceChanged(network);
55 } 71 }
56 72
57 } // namespace ash 73 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/network/tray_network_state_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698