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

Side by Side Diff: chrome/browser/chromeos/net/connectivity_state_helper.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
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/imageburner/burn_manager.cc ('k') | chrome/browser/chromeos/net/network_portal_detector_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698