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

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

Issue 11469044: Implement new network change notifier that uses NetworkStateHandler (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: address comments + move back to chromeos/ Created 8 years 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
« no previous file with comments | « chromeos/network/network_change_notifier_factory_chromeos.cc ('k') | no next file » | 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 #ifndef CHROMEOS_NETWORK_NETWORK_STATE_H_ 5 #ifndef CHROMEOS_NETWORK_NETWORK_STATE_H_
6 #define CHROMEOS_NETWORK_NETWORK_STATE_H_ 6 #define CHROMEOS_NETWORK_NETWORK_STATE_H_
7 7
8 #include "chromeos/network/managed_state.h" 8 #include "chromeos/network/managed_state.h"
9 9
10 namespace net {
11 class NetworkChangeNotifierChromeosUpdateTest;
szym 2012/12/17 06:16:53 This class is now in chromeos:: so forward declara
gauravsh 2012/12/17 21:05:12 Done.
12 }
13
10 namespace chromeos { 14 namespace chromeos {
11 15
12 // Simple class to provide network state information about a network service. 16 // Simple class to provide network state information about a network service.
13 // This class should always be passed as a const* and should never be held 17 // This class should always be passed as a const* and should never be held
14 // on to. Store network_state->path() (defined in ManagedState) instead and 18 // on to. Store network_state->path() (defined in ManagedState) instead and
15 // call NetworkStateHandler::GetNetworkState(path) to retrieve the state for 19 // call NetworkStateHandler::GetNetworkState(path) to retrieve the state for
16 // the network. 20 // the network.
17 class CHROMEOS_EXPORT NetworkState : public ManagedState { 21 class CHROMEOS_EXPORT NetworkState : public ManagedState {
18 public: 22 public:
19 explicit NetworkState(const std::string& path); 23 explicit NetworkState(const std::string& path);
(...skipping 16 matching lines...) Expand all
36 40
37 bool IsConnectedState() const; 41 bool IsConnectedState() const;
38 bool IsConnectingState() const; 42 bool IsConnectingState() const;
39 43
40 // Helpers (used e.g. when a state is cached) 44 // Helpers (used e.g. when a state is cached)
41 static bool StateIsConnected(const std::string& state); 45 static bool StateIsConnected(const std::string& state);
42 static bool StateIsConnecting(const std::string& state); 46 static bool StateIsConnecting(const std::string& state);
43 47
44 private: 48 private:
45 friend class NetworkStateHandler; 49 friend class NetworkStateHandler;
50 friend class NetworkChangeNotifierChromeosUpdateTest;
46 51
47 // Called by NetworkStateHandler when the ip config changes. 52 // Called by NetworkStateHandler when the ip config changes.
48 void set_ip_address(const std::string& ip_address) { 53 void set_ip_address(const std::string& ip_address) {
49 ip_address_ = ip_address; 54 ip_address_ = ip_address;
50 } 55 }
51 56
52 // Common Network Service properties 57 // Common Network Service properties
53 std::string security_; 58 std::string security_;
54 std::string device_path_; 59 std::string device_path_;
55 std::string ip_address_; 60 std::string ip_address_;
56 std::string state_; 61 std::string state_;
57 std::string error_; 62 std::string error_;
58 // Wireless properties 63 // Wireless properties
59 int signal_strength_; 64 int signal_strength_;
60 // Cellular properties 65 // Cellular properties
61 std::string technology_; 66 std::string technology_;
62 std::string activation_state_; 67 std::string activation_state_;
63 std::string roaming_; 68 std::string roaming_;
64 69
65 DISALLOW_COPY_AND_ASSIGN(NetworkState); 70 DISALLOW_COPY_AND_ASSIGN(NetworkState);
66 }; 71 };
67 72
68 } // namespace chromeos 73 } // namespace chromeos
69 74
70 #endif // CHROMEOS_NETWORK_NETWORK_STATE_H_ 75 #endif // CHROMEOS_NETWORK_NETWORK_STATE_H_
OLDNEW
« no previous file with comments | « chromeos/network/network_change_notifier_factory_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698