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

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

Issue 14729017: Add NetworkHandler to own network handlers in src/chromeos/network (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix chromeos_unittests Created 7 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.cc ('k') | ash/system/chromeos/network/tray_vpn.cc » ('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 (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
OLDNEW
« no previous file with comments | « ash/system/chromeos/network/tray_network.cc ('k') | ash/system/chromeos/network/tray_vpn.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698