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 "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 "chromeos/network/network_state.h" | 10 #include "chromeos/network/network_state.h" |
11 #include "chromeos/network/network_state_handler.h" | 11 #include "chromeos/network/network_state_handler.h" |
12 #include "third_party/cros_system_api/dbus/service_constants.h" | 12 #include "third_party/cros_system_api/dbus/service_constants.h" |
13 | 13 |
| 14 using chromeos::NetworkHandler; |
| 15 |
14 namespace ash { | 16 namespace ash { |
15 namespace internal { | 17 namespace internal { |
16 | 18 |
17 TrayNetworkStateObserver::TrayNetworkStateObserver(Delegate* delegate) | 19 TrayNetworkStateObserver::TrayNetworkStateObserver(Delegate* delegate) |
18 : delegate_(delegate) { | 20 : delegate_(delegate) { |
19 if (chromeos::NetworkStateHandler::IsInitialized()) | 21 if (NetworkHandler::IsInitialized()) |
20 chromeos::NetworkStateHandler::Get()->AddObserver(this); | 22 NetworkHandler::Get()->network_state_handler()->AddObserver(this); |
21 } | 23 } |
22 | 24 |
23 TrayNetworkStateObserver::~TrayNetworkStateObserver() { | 25 TrayNetworkStateObserver::~TrayNetworkStateObserver() { |
24 if (chromeos::NetworkStateHandler::IsInitialized()) | 26 if (NetworkHandler::IsInitialized()) |
25 chromeos::NetworkStateHandler::Get()->RemoveObserver(this); | 27 NetworkHandler::Get()->network_state_handler()->RemoveObserver(this); |
26 } | 28 } |
27 | 29 |
28 void TrayNetworkStateObserver::NetworkManagerChanged() { | 30 void TrayNetworkStateObserver::NetworkManagerChanged() { |
29 delegate_->NetworkStateChanged(false); | 31 delegate_->NetworkStateChanged(false); |
30 } | 32 } |
31 | 33 |
32 void TrayNetworkStateObserver::NetworkListChanged() { | 34 void TrayNetworkStateObserver::NetworkListChanged() { |
33 delegate_->NetworkStateChanged(true); | 35 delegate_->NetworkStateChanged(true); |
34 } | 36 } |
35 | 37 |
36 void TrayNetworkStateObserver::DeviceListChanged() { | 38 void TrayNetworkStateObserver::DeviceListChanged() { |
37 delegate_->NetworkStateChanged(false); | 39 delegate_->NetworkStateChanged(false); |
38 } | 40 } |
39 | 41 |
40 void TrayNetworkStateObserver::DefaultNetworkChanged( | 42 void TrayNetworkStateObserver::DefaultNetworkChanged( |
41 const chromeos::NetworkState* network) { | 43 const chromeos::NetworkState* network) { |
42 delegate_->NetworkStateChanged(true); | 44 delegate_->NetworkStateChanged(true); |
43 } | 45 } |
44 | 46 |
45 void TrayNetworkStateObserver::NetworkPropertiesUpdated( | 47 void TrayNetworkStateObserver::NetworkPropertiesUpdated( |
46 const chromeos::NetworkState* network) { | 48 const chromeos::NetworkState* network) { |
47 if (network == chromeos::NetworkStateHandler::Get()->DefaultNetwork()) | 49 if (network == |
| 50 NetworkHandler::Get()->network_state_handler()->DefaultNetwork()) |
48 delegate_->NetworkStateChanged(true); | 51 delegate_->NetworkStateChanged(true); |
49 delegate_->NetworkServiceChanged(network); | 52 delegate_->NetworkServiceChanged(network); |
50 } | 53 } |
51 | 54 |
52 } // namespace ash | 55 } // namespace ash |
53 } // namespace internal | 56 } // namespace internal |
OLD | NEW |