Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "base/memory/scoped_ptr.h" | |
| 8 #include "chromeos/network/managed_state.h" | 9 #include "chromeos/network/managed_state.h" |
| 9 | 10 |
| 11 namespace base { | |
| 12 class DictionaryValue; | |
| 13 } | |
| 14 | |
| 10 namespace chromeos { | 15 namespace chromeos { |
| 11 | 16 |
| 12 // Simple class to provide network state information about a network service. | 17 // 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 | 18 // 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 | 19 // on to. Store network_state->path() (defined in ManagedState) instead and |
| 15 // call NetworkStateHandler::GetNetworkState(path) to retrieve the state for | 20 // call NetworkStateHandler::GetNetworkState(path) to retrieve the state for |
| 16 // the network. | 21 // the network. |
| 17 class CHROMEOS_EXPORT NetworkState : public ManagedState { | 22 class CHROMEOS_EXPORT NetworkState : public ManagedState { |
| 18 public: | 23 public: |
| 19 explicit NetworkState(const std::string& path); | 24 explicit NetworkState(const std::string& path); |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 33 // Wireless property accessors | 38 // Wireless property accessors |
| 34 int signal_strength() const { return signal_strength_; } | 39 int signal_strength() const { return signal_strength_; } |
| 35 // Cellular property accessors | 40 // Cellular property accessors |
| 36 const std::string& technology() const { return technology_; } | 41 const std::string& technology() const { return technology_; } |
| 37 const std::string& activation_state() const { return activation_state_; } | 42 const std::string& activation_state() const { return activation_state_; } |
| 38 const std::string& roaming() const { return roaming_; } | 43 const std::string& roaming() const { return roaming_; } |
| 39 | 44 |
| 40 bool IsConnectedState() const; | 45 bool IsConnectedState() const; |
| 41 bool IsConnectingState() const; | 46 bool IsConnectingState() const; |
| 42 | 47 |
| 48 scoped_ptr<base::DictionaryValue> TranslateToONC() const; | |
|
stevenjb
2013/03/04 18:57:58
I don't like having this here. I would rather we h
pneubeck (no reviews)
2013/03/05 13:11:55
Done.
| |
| 49 | |
| 43 // Helpers (used e.g. when a state is cached) | 50 // Helpers (used e.g. when a state is cached) |
| 44 static bool StateIsConnected(const std::string& connection_state); | 51 static bool StateIsConnected(const std::string& connection_state); |
| 45 static bool StateIsConnecting(const std::string& connection_state); | 52 static bool StateIsConnecting(const std::string& connection_state); |
| 46 | 53 |
| 47 private: | 54 private: |
| 48 friend class NetworkStateHandler; | 55 friend class NetworkStateHandler; |
| 49 friend class NetworkChangeNotifierChromeosUpdateTest; | 56 friend class NetworkChangeNotifierChromeosUpdateTest; |
| 50 | 57 |
| 51 // Called by NetworkStateHandler when the ip config changes. | 58 // Called by NetworkStateHandler when the ip config changes. |
| 52 void set_ip_address(const std::string& ip_address) { | 59 void set_ip_address(const std::string& ip_address) { |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 66 std::string technology_; | 73 std::string technology_; |
| 67 std::string activation_state_; | 74 std::string activation_state_; |
| 68 std::string roaming_; | 75 std::string roaming_; |
| 69 | 76 |
| 70 DISALLOW_COPY_AND_ASSIGN(NetworkState); | 77 DISALLOW_COPY_AND_ASSIGN(NetworkState); |
| 71 }; | 78 }; |
| 72 | 79 |
| 73 } // namespace chromeos | 80 } // namespace chromeos |
| 74 | 81 |
| 75 #endif // CHROMEOS_NETWORK_NETWORK_STATE_H_ | 82 #endif // CHROMEOS_NETWORK_NETWORK_STATE_H_ |
| OLD | NEW |