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_DEVICE_STATE_H_ | 5 #ifndef CHROMEOS_NETWORK_DEVICE_STATE_H_ |
6 #define CHROMEOS_NETWORK_DEVICE_STATE_H_ | 6 #define CHROMEOS_NETWORK_DEVICE_STATE_H_ |
7 | 7 |
8 #include "chromeos/network/managed_state.h" | 8 #include "chromeos/network/managed_state.h" |
9 | 9 |
10 namespace chromeos { | 10 namespace chromeos { |
11 | 11 |
12 // Simple class to provide device state information. Similar to NetworkState; | 12 // Simple class to provide device state information. Similar to NetworkState; |
13 // see network_state.h for usage guidelines. | 13 // see network_state.h for usage guidelines. |
14 class CHROMEOS_EXPORT DeviceState : public ManagedState { | 14 class CHROMEOS_EXPORT DeviceState : public ManagedState { |
15 public: | 15 public: |
16 explicit DeviceState(const std::string& path); | 16 explicit DeviceState(const std::string& path); |
17 virtual ~DeviceState(); | 17 virtual ~DeviceState(); |
18 | 18 |
19 // ManagedState overrides | 19 // ManagedState overrides |
20 virtual bool PropertyChanged(const std::string& key, | 20 virtual bool PropertyChanged(const std::string& key, |
21 const base::Value& value) OVERRIDE; | 21 const base::Value& value) OVERRIDE; |
22 | 22 |
23 // Accessors | 23 // Accessors |
24 const std::string& mac_address() const { return mac_address_; } | 24 const std::string& mac_address() const { return mac_address_; } |
25 bool provider_requires_roaming() const { return provider_requires_roaming_; } | 25 bool provider_requires_roaming() const { return provider_requires_roaming_; } |
26 bool support_network_scan() const { return support_network_scan_; } | 26 bool support_network_scan() const { return support_network_scan_; } |
27 bool scanning() const { return scanning_; } | 27 bool scanning() const { return scanning_; } |
| 28 std::string sim_lock_type() const { return sim_lock_type_; } |
| 29 |
| 30 // Returns true if the technology family is GSM and sim_present_ is false. |
| 31 bool IsSimAbsent() const; |
28 | 32 |
29 private: | 33 private: |
30 // Common Device Properties | 34 // Common Device Properties |
31 std::string mac_address_; | 35 std::string mac_address_; |
32 // Cellular specific propeties | 36 // Cellular specific propeties |
33 std::string home_provider_id_; | 37 std::string home_provider_id_; |
34 bool provider_requires_roaming_; | 38 bool provider_requires_roaming_; |
35 bool support_network_scan_; | 39 bool support_network_scan_; |
36 bool scanning_; | 40 bool scanning_; |
| 41 std::string technology_family_; |
| 42 std::string sim_lock_type_; |
| 43 bool sim_present_; |
37 | 44 |
38 DISALLOW_COPY_AND_ASSIGN(DeviceState); | 45 DISALLOW_COPY_AND_ASSIGN(DeviceState); |
39 }; | 46 }; |
40 | 47 |
41 } // namespace chromeos | 48 } // namespace chromeos |
42 | 49 |
43 #endif // CHROMEOS_NETWORK_DEVICE_STATE_H_ | 50 #endif // CHROMEOS_NETWORK_DEVICE_STATE_H_ |
OLD | NEW |