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

Side by Side Diff: chromeos/network/network_state_handler.h

Issue 2819383002: [CrOS Tether] Update NetworkState to include tether properties and integrate into NetworkStateHandl… (Closed)
Patch Set: Comments. Created 3 years, 8 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
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 #ifndef CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_H_ 5 #ifndef CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_H_
6 #define CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_H_ 6 #define CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 // found. This returns all entries (IsInProfile() may be true or false). 201 // found. This returns all entries (IsInProfile() may be true or false).
202 const NetworkState* GetNetworkStateFromGuid(const std::string& guid) const; 202 const NetworkState* GetNetworkStateFromGuid(const std::string& guid) const;
203 203
204 // Creates a Tether NetworkState that has no underlying shill type or 204 // Creates a Tether NetworkState that has no underlying shill type or
205 // service. When initially created, it does not actually represent a real 205 // service. When initially created, it does not actually represent a real
206 // network. The |guid| provided must be non-empty. If a network with |guid| 206 // network. The |guid| provided must be non-empty. If a network with |guid|
207 // already exists, this method will do nothing. Use the provided |guid| to 207 // already exists, this method will do nothing. Use the provided |guid| to
208 // refer to and fetch this NetworkState in the future. 208 // refer to and fetch this NetworkState in the future.
209 // NOTE: only GetNetworkStateFromGuid is supported to fetch "tether" 209 // NOTE: only GetNetworkStateFromGuid is supported to fetch "tether"
210 // NetworkStates. 210 // NetworkStates.
211 void AddTetherNetworkState(const std::string& guid, const std::string& name); 211 void AddTetherNetworkState(const std::string& guid,
212 const std::string& name,
213 const std::string& carrier,
214 int battery_percentage,
215 int signal_strength);
216
217 // Updates the tether properties (carrier, battery percentage, and signal
218 // strength) for a network which has already been added via
219 // AddTetherNetworkState. Returns whether the update was successful.
220 bool UpdateTetherNetworkProperties(const std::string& guid,
221 const std::string& carrier,
222 int battery_percentage,
223 int signal_strength);
212 224
213 // Remove a Tether NetworkState, using the same |guid| passed to 225 // Remove a Tether NetworkState, using the same |guid| passed to
214 // AddTetherNetworkState. 226 // AddTetherNetworkState.
215 void RemoveTetherNetworkState(const std::string& guid); 227 void RemoveTetherNetworkState(const std::string& guid);
216 228
217 // Inform NetworkStateHandler that the provided Tether network with the 229 // Inform NetworkStateHandler that the provided Tether network with the
218 // provided guid |tether_guid| is associated with the Wi-Fi network with the 230 // provided guid |tether_guid| is associated with the Wi-Fi network with the
219 // provided guid |wifi_ssid|. This Wi-Fi network can now be hidden in the UI, 231 // provided guid |wifi_ssid|. This Wi-Fi network can now be hidden in the UI,
220 // and the Tether network will act as its proxy. Returns false if the 232 // and the Tether network will act as its proxy. Returns false if the
221 // association failed (e.g. one or both networks don't exist). 233 // association failed (e.g. one or both networks don't exist).
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 void SetTetherNetworkStateConnectionState( 484 void SetTetherNetworkStateConnectionState(
473 const std::string& guid, 485 const std::string& guid,
474 const std::string& connection_state); 486 const std::string& connection_state);
475 487
476 DISALLOW_COPY_AND_ASSIGN(NetworkStateHandler); 488 DISALLOW_COPY_AND_ASSIGN(NetworkStateHandler);
477 }; 489 };
478 490
479 } // namespace chromeos 491 } // namespace chromeos
480 492
481 #endif // CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_H_ 493 #endif // CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698