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 CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
6 #define CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 bool activated() const { | 881 bool activated() const { |
882 return activation_state() == ACTIVATION_STATE_ACTIVATED; | 882 return activation_state() == ACTIVATION_STATE_ACTIVATED; |
883 } | 883 } |
884 const NetworkTechnology network_technology() const { | 884 const NetworkTechnology network_technology() const { |
885 return network_technology_; | 885 return network_technology_; |
886 } | 886 } |
887 const NetworkRoamingState roaming_state() const { return roaming_state_; } | 887 const NetworkRoamingState roaming_state() const { return roaming_state_; } |
888 const std::string& operator_name() const { return operator_name_; } | 888 const std::string& operator_name() const { return operator_name_; } |
889 const std::string& operator_code() const { return operator_code_; } | 889 const std::string& operator_code() const { return operator_code_; } |
890 const std::string& operator_country() const { return operator_country_; } | 890 const std::string& operator_country() const { return operator_country_; } |
| 891 bool out_of_credits() const { return out_of_credits_; } |
891 const std::string& payment_url() const { return payment_url_; } | 892 const std::string& payment_url() const { return payment_url_; } |
892 const std::string& usage_url() const { return usage_url_; } | 893 const std::string& usage_url() const { return usage_url_; } |
893 const std::string& post_data() const { return post_data_; } | 894 const std::string& post_data() const { return post_data_; } |
894 const bool using_post() const { return using_post_; } | 895 const bool using_post() const { return using_post_; } |
895 const CellularApn& apn() const { return apn_; } | 896 const CellularApn& apn() const { return apn_; } |
896 const CellularApn& last_good_apn() const { return last_good_apn_; } | 897 const CellularApn& last_good_apn() const { return last_good_apn_; } |
897 | 898 |
898 // Sets the APN to use in establishing data connections. Only | 899 // Sets the APN to use in establishing data connections. Only |
899 // the fields of the APN that are needed for making connections | 900 // the fields of the APN that are needed for making connections |
900 // are passed to shill. The name, localized_name, and language | 901 // are passed to shill. The name, localized_name, and language |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
948 } | 949 } |
949 void set_operator_name(const std::string& operator_name) { | 950 void set_operator_name(const std::string& operator_name) { |
950 operator_name_ = operator_name; | 951 operator_name_ = operator_name; |
951 } | 952 } |
952 void set_operator_code(const std::string& operator_code) { | 953 void set_operator_code(const std::string& operator_code) { |
953 operator_code_ = operator_code; | 954 operator_code_ = operator_code; |
954 } | 955 } |
955 void set_operator_country(const std::string& operator_country) { | 956 void set_operator_country(const std::string& operator_country) { |
956 operator_country_ = operator_country; | 957 operator_country_ = operator_country; |
957 } | 958 } |
| 959 void set_out_of_credits(bool out_of_credits) { |
| 960 out_of_credits_ = out_of_credits; |
| 961 } |
958 void set_payment_url(const std::string& payment_url) { | 962 void set_payment_url(const std::string& payment_url) { |
959 payment_url_ = payment_url; | 963 payment_url_ = payment_url; |
960 } | 964 } |
961 void set_post_data(const std::string& post_data) { | 965 void set_post_data(const std::string& post_data) { |
962 post_data_ = post_data; | 966 post_data_ = post_data; |
963 } | 967 } |
964 void set_using_post(bool using_post) { | 968 void set_using_post(bool using_post) { |
965 using_post_ = using_post; | 969 using_post_ = using_post; |
966 } | 970 } |
967 void set_usage_url(const std::string& usage_url) { usage_url_ = usage_url; } | 971 void set_usage_url(const std::string& usage_url) { usage_url_ = usage_url; } |
968 void set_apn(const base::DictionaryValue& apn) { apn_.Set(apn); } | 972 void set_apn(const base::DictionaryValue& apn) { apn_.Set(apn); } |
969 void set_last_good_apn(const base::DictionaryValue& last_good_apn) { | 973 void set_last_good_apn(const base::DictionaryValue& last_good_apn) { |
970 last_good_apn_.Set(last_good_apn); | 974 last_good_apn_.Set(last_good_apn); |
971 } | 975 } |
972 | 976 |
973 bool activate_over_non_cellular_network_; | 977 bool activate_over_non_cellular_network_; |
| 978 bool out_of_credits_; |
974 ActivationState activation_state_; | 979 ActivationState activation_state_; |
975 NetworkTechnology network_technology_; | 980 NetworkTechnology network_technology_; |
976 NetworkRoamingState roaming_state_; | 981 NetworkRoamingState roaming_state_; |
977 // Carrier Info | 982 // Carrier Info |
978 std::string operator_name_; | 983 std::string operator_name_; |
979 std::string operator_code_; | 984 std::string operator_code_; |
980 std::string operator_country_; | 985 std::string operator_country_; |
981 std::string payment_url_; | 986 std::string payment_url_; |
982 std::string usage_url_; | 987 std::string usage_url_; |
983 std::string post_data_; | 988 std::string post_data_; |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1734 const std::string& service_path) = 0; | 1739 const std::string& service_path) = 0; |
1735 | 1740 |
1736 // Factory function, creates a new instance and returns ownership. | 1741 // Factory function, creates a new instance and returns ownership. |
1737 // For normal usage, access the singleton via CrosLibrary::Get(). | 1742 // For normal usage, access the singleton via CrosLibrary::Get(). |
1738 static NetworkLibrary* GetImpl(bool stub); | 1743 static NetworkLibrary* GetImpl(bool stub); |
1739 }; | 1744 }; |
1740 | 1745 |
1741 } // namespace chromeos | 1746 } // namespace chromeos |
1742 | 1747 |
1743 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 1748 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
OLD | NEW |