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

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

Issue 18348016: If requested, report network interfaces to management server. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address feedback. Created 7 years, 5 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) 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 <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 // * kMatchTypeDefault returns the default (active) network 54 // * kMatchTypeDefault returns the default (active) network
55 // * kMatchTypeNonVirtual returns the primary non virtual network 55 // * kMatchTypeNonVirtual returns the primary non virtual network
56 // * kMatchTypeWireless returns the primary wireless network 56 // * kMatchTypeWireless returns the primary wireless network
57 // * kMatchTypeMobile returns the primary cellular or wimax network 57 // * kMatchTypeMobile returns the primary cellular or wimax network
58 58
59 class CHROMEOS_EXPORT NetworkStateHandler 59 class CHROMEOS_EXPORT NetworkStateHandler
60 : public internal::ShillPropertyHandler::Listener { 60 : public internal::ShillPropertyHandler::Listener {
61 public: 61 public:
62 typedef std::vector<ManagedState*> ManagedStateList; 62 typedef std::vector<ManagedState*> ManagedStateList;
63 typedef std::vector<const NetworkState*> NetworkStateList; 63 typedef std::vector<const NetworkState*> NetworkStateList;
64 typedef std::vector<const DeviceState*> DeviceStateList;
64 typedef std::vector<const FavoriteState*> FavoriteStateList; 65 typedef std::vector<const FavoriteState*> FavoriteStateList;
65 66
66 enum TechnologyState { 67 enum TechnologyState {
67 TECHNOLOGY_UNAVAILABLE, 68 TECHNOLOGY_UNAVAILABLE,
68 TECHNOLOGY_AVAILABLE, 69 TECHNOLOGY_AVAILABLE,
69 TECHNOLOGY_UNINITIALIZED, 70 TECHNOLOGY_UNINITIALIZED,
70 TECHNOLOGY_ENABLING, 71 TECHNOLOGY_ENABLING,
71 TECHNOLOGY_ENABLED 72 TECHNOLOGY_ENABLED
72 }; 73 };
73 74
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 std::string HardwareAddressForType(const std::string& type) const; 140 std::string HardwareAddressForType(const std::string& type) const;
140 // Same as above but in aa:bb format. 141 // Same as above but in aa:bb format.
141 std::string FormattedHardwareAddressForType(const std::string& type) const; 142 std::string FormattedHardwareAddressForType(const std::string& type) const;
142 143
143 // Sets |list| to contain the list of networks. The returned list contains 144 // Sets |list| to contain the list of networks. The returned list contains
144 // a copy of NetworkState pointers which should not be stored or used beyond 145 // a copy of NetworkState pointers which should not be stored or used beyond
145 // the scope of the calling function (i.e. they may later become invalid, but 146 // the scope of the calling function (i.e. they may later become invalid, but
146 // only on the UI thread). 147 // only on the UI thread).
147 void GetNetworkList(NetworkStateList* list) const; 148 void GetNetworkList(NetworkStateList* list) const;
148 149
150 // Sets |list| to contain the list of devices. The returned list contains
151 // a copy of DeviceState pointers which should not be stored or used beyond
152 // the scope of the calling function (i.e. they may later become invalid, but
153 // only on the UI thread).
154 void GetDeviceList(DeviceStateList* list) const;
155
149 // Sets |list| to contain the list of favorite (aka "preferred") networks. 156 // Sets |list| to contain the list of favorite (aka "preferred") networks.
150 // See GetNetworkList() for usage, and notes for |favorite_list_|. 157 // See GetNetworkList() for usage, and notes for |favorite_list_|.
151 // Favorites that are visible have the same path() as the entries in 158 // Favorites that are visible have the same path() as the entries in
152 // GetNetworkList(), so GetNetworkState() can be used to determine if a 159 // GetNetworkList(), so GetNetworkState() can be used to determine if a
153 // favorite is visible and retrieve the complete properties (and vice-versa). 160 // favorite is visible and retrieve the complete properties (and vice-versa).
154 void GetFavoriteList(FavoriteStateList* list) const; 161 void GetFavoriteList(FavoriteStateList* list) const;
155 162
156 // Finds and returns a favorite state by |service_path| or NULL if not found. 163 // Finds and returns a favorite state by |service_path| or NULL if not found.
157 const FavoriteState* GetFavoriteState(const std::string& service_path) const; 164 const FavoriteState* GetFavoriteState(const std::string& service_path) const;
158 165
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 335
329 // Callbacks to run when a scan for the technology type completes. 336 // Callbacks to run when a scan for the technology type completes.
330 ScanCompleteCallbackMap scan_complete_callbacks_; 337 ScanCompleteCallbackMap scan_complete_callbacks_;
331 338
332 DISALLOW_COPY_AND_ASSIGN(NetworkStateHandler); 339 DISALLOW_COPY_AND_ASSIGN(NetworkStateHandler);
333 }; 340 };
334 341
335 } // namespace chromeos 342 } // namespace chromeos
336 343
337 #endif // CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_H_ 344 #endif // CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698