| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 876 enum HardwareAddressFormat { | 876 enum HardwareAddressFormat { |
| 877 FORMAT_RAW_HEX, | 877 FORMAT_RAW_HEX, |
| 878 FORMAT_COLON_SEPARATED_HEX | 878 FORMAT_COLON_SEPARATED_HEX |
| 879 }; | 879 }; |
| 880 | 880 |
| 881 class NetworkManagerObserver { | 881 class NetworkManagerObserver { |
| 882 public: | 882 public: |
| 883 // Called when the state of the network manager has changed, | 883 // Called when the state of the network manager has changed, |
| 884 // for example, networks have appeared or disappeared. | 884 // for example, networks have appeared or disappeared. |
| 885 virtual void OnNetworkManagerChanged(NetworkLibrary* obj) = 0; | 885 virtual void OnNetworkManagerChanged(NetworkLibrary* obj) = 0; |
| 886 protected: |
| 887 ~NetworkManagerObserver() { } |
| 886 }; | 888 }; |
| 887 | 889 |
| 888 class NetworkObserver { | 890 class NetworkObserver { |
| 889 public: | 891 public: |
| 890 // Called when the state of a single network has changed, | 892 // Called when the state of a single network has changed, |
| 891 // for example signal strength or connection state. | 893 // for example signal strength or connection state. |
| 892 virtual void OnNetworkChanged(NetworkLibrary* cros, | 894 virtual void OnNetworkChanged(NetworkLibrary* cros, |
| 893 const Network* network) = 0; | 895 const Network* network) = 0; |
| 896 protected: |
| 897 ~NetworkObserver() {} |
| 894 }; | 898 }; |
| 895 | 899 |
| 896 class NetworkDeviceObserver { | 900 class NetworkDeviceObserver { |
| 897 public: | 901 public: |
| 898 // Called when the state of a single device has changed, | 902 // Called when the state of a single device has changed, |
| 899 // for example SIMLock state for cellular. | 903 // for example SIMLock state for cellular. |
| 900 virtual void OnNetworkDeviceChanged(NetworkLibrary* cros, | 904 virtual void OnNetworkDeviceChanged(NetworkLibrary* cros, |
| 901 const NetworkDevice* device) = 0; | 905 const NetworkDevice* device) = 0; |
| 906 protected: |
| 907 ~NetworkDeviceObserver() {} |
| 902 }; | 908 }; |
| 903 | 909 |
| 904 class CellularDataPlanObserver { | 910 class CellularDataPlanObserver { |
| 905 public: | 911 public: |
| 906 // Called when the cellular data plan has changed. | 912 // Called when the cellular data plan has changed. |
| 907 virtual void OnCellularDataPlanChanged(NetworkLibrary* obj) = 0; | 913 virtual void OnCellularDataPlanChanged(NetworkLibrary* obj) = 0; |
| 914 protected: |
| 915 ~CellularDataPlanObserver() {} |
| 908 }; | 916 }; |
| 909 | 917 |
| 910 class PinOperationObserver { | 918 class PinOperationObserver { |
| 911 public: | 919 public: |
| 912 // Called when pin async operation has completed. | 920 // Called when pin async operation has completed. |
| 913 // Network is NULL when we don't have an associated Network object. | 921 // Network is NULL when we don't have an associated Network object. |
| 914 virtual void OnPinOperationCompleted(NetworkLibrary* cros, | 922 virtual void OnPinOperationCompleted(NetworkLibrary* cros, |
| 915 PinOperationError error) = 0; | 923 PinOperationError error) = 0; |
| 924 protected: |
| 925 ~PinOperationObserver() {} |
| 916 }; | 926 }; |
| 917 | 927 |
| 918 class UserActionObserver { | 928 class UserActionObserver { |
| 919 public: | 929 public: |
| 920 // Called when user initiates a new connection. | 930 // Called when user initiates a new connection. |
| 921 // Network is NULL when we don't have an associated Network object. | 931 // Network is NULL when we don't have an associated Network object. |
| 922 virtual void OnConnectionInitiated(NetworkLibrary* cros, | 932 virtual void OnConnectionInitiated(NetworkLibrary* cros, |
| 923 const Network* network) = 0; | 933 const Network* network) = 0; |
| 934 protected: |
| 935 ~UserActionObserver() {} |
| 924 }; | 936 }; |
| 925 | 937 |
| 926 virtual ~NetworkLibrary() {} | 938 virtual ~NetworkLibrary() {} |
| 927 | 939 |
| 928 virtual void AddNetworkManagerObserver(NetworkManagerObserver* observer) = 0; | 940 virtual void AddNetworkManagerObserver(NetworkManagerObserver* observer) = 0; |
| 929 virtual void RemoveNetworkManagerObserver( | 941 virtual void RemoveNetworkManagerObserver( |
| 930 NetworkManagerObserver* observer) = 0; | 942 NetworkManagerObserver* observer) = 0; |
| 931 | 943 |
| 932 // An attempt to add an observer that has already been added for a | 944 // An attempt to add an observer that has already been added for a |
| 933 // give service path will be ignored. | 945 // give service path will be ignored. |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1209 virtual void SetIPConfig(const NetworkIPConfig& ipconfig) = 0; | 1221 virtual void SetIPConfig(const NetworkIPConfig& ipconfig) = 0; |
| 1210 | 1222 |
| 1211 // Factory function, creates a new instance and returns ownership. | 1223 // Factory function, creates a new instance and returns ownership. |
| 1212 // For normal usage, access the singleton via CrosLibrary::Get(). | 1224 // For normal usage, access the singleton via CrosLibrary::Get(). |
| 1213 static NetworkLibrary* GetImpl(bool stub); | 1225 static NetworkLibrary* GetImpl(bool stub); |
| 1214 }; | 1226 }; |
| 1215 | 1227 |
| 1216 } // namespace chromeos | 1228 } // namespace chromeos |
| 1217 | 1229 |
| 1218 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 1230 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
| OLD | NEW |