OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/chromeos/net/connectivity_state_helper.h" | 5 #include "chrome/browser/chromeos/net/connectivity_state_helper.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/chromeos/cros/cros_library.h" | 8 #include "chrome/browser/chromeos/cros/cros_library.h" |
9 #include "chrome/browser/chromeos/cros/network_library.h" | 9 #include "chrome/browser/chromeos/cros/network_library.h" |
10 #include "chromeos/chromeos_switches.h" | 10 #include "chromeos/chromeos_switches.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 ConnectivityStateHelperObserver* observer) { | 121 ConnectivityStateHelperObserver* observer) { |
122 connectivity_observers_.AddObserver(observer); | 122 connectivity_observers_.AddObserver(observer); |
123 } | 123 } |
124 | 124 |
125 void ConnectivityStateHelper::RemoveNetworkManagerObserver( | 125 void ConnectivityStateHelper::RemoveNetworkManagerObserver( |
126 ConnectivityStateHelperObserver* observer) { | 126 ConnectivityStateHelperObserver* observer) { |
127 connectivity_observers_.RemoveObserver(observer); | 127 connectivity_observers_.RemoveObserver(observer); |
128 } | 128 } |
129 | 129 |
130 ConnectivityStateHelperImpl::ConnectivityStateHelperImpl() { | 130 ConnectivityStateHelperImpl::ConnectivityStateHelperImpl() { |
131 network_state_handler_ = NetworkStateHandler::Get(); | 131 network_state_handler_ = NetworkHandler::Get()->network_state_handler(); |
132 network_state_handler_->AddObserver(this); | 132 network_state_handler_->AddObserver(this); |
133 } | 133 } |
134 | 134 |
135 ConnectivityStateHelperImpl::~ConnectivityStateHelperImpl() { | 135 ConnectivityStateHelperImpl::~ConnectivityStateHelperImpl() { |
136 NetworkStateHandler::Get()->RemoveObserver(this); | 136 network_state_handler_->RemoveObserver(this); |
137 } | 137 } |
138 | 138 |
139 bool ConnectivityStateHelperImpl::IsConnected() { | 139 bool ConnectivityStateHelperImpl::IsConnected() { |
140 return network_state_handler_->ConnectedNetworkByType( | 140 return network_state_handler_->ConnectedNetworkByType( |
141 NetworkStateHandler::kMatchTypeDefault) != NULL; | 141 NetworkStateHandler::kMatchTypeDefault) != NULL; |
142 } | 142 } |
143 | 143 |
144 bool ConnectivityStateHelperImpl::IsConnecting() { | 144 bool ConnectivityStateHelperImpl::IsConnecting() { |
145 return network_state_handler_->ConnectingNetworkByType( | 145 return network_state_handler_->ConnectingNetworkByType( |
146 NetworkStateHandler::kMatchTypeDefault) != NULL; | 146 NetworkStateHandler::kMatchTypeDefault) != NULL; |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 network_library_->RequestNetworkScan(); | 279 network_library_->RequestNetworkScan(); |
280 } | 280 } |
281 | 281 |
282 void ConnectivityStateHelperNetworkLibrary::OnNetworkManagerChanged( | 282 void ConnectivityStateHelperNetworkLibrary::OnNetworkManagerChanged( |
283 NetworkLibrary* network_library) { | 283 NetworkLibrary* network_library) { |
284 FOR_EACH_OBSERVER(ConnectivityStateHelperObserver, connectivity_observers_, | 284 FOR_EACH_OBSERVER(ConnectivityStateHelperObserver, connectivity_observers_, |
285 NetworkManagerChanged()); | 285 NetworkManagerChanged()); |
286 } | 286 } |
287 | 287 |
288 } // namespace chromeos | 288 } // namespace chromeos |
OLD | NEW |