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_SMS_HANDLER_H_ | 5 #ifndef CHROMEOS_NETWORK_NETWORK_SMS_HANDLER_H_ |
6 #define CHROMEOS_NETWORK_NETWORK_SMS_HANDLER_H_ | 6 #define CHROMEOS_NETWORK_NETWORK_SMS_HANDLER_H_ |
7 | 7 |
| 8 #include <string> |
| 9 |
8 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
9 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
10 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
11 #include "base/values.h" | 13 #include "base/values.h" |
12 #include "chromeos/chromeos_export.h" | 14 #include "chromeos/chromeos_export.h" |
13 #include "chromeos/dbus/dbus_method_call_status.h" | 15 #include "chromeos/dbus/dbus_method_call_status.h" |
14 | 16 |
15 namespace chromeos { | 17 namespace chromeos { |
16 | 18 |
17 // Class to watch sms without Libcros. | 19 // Class to watch sms without Libcros. |
(...skipping 21 matching lines...) Expand all Loading... |
39 void Init(); | 41 void Init(); |
40 | 42 |
41 // Requests an immediate check for new messages. | 43 // Requests an immediate check for new messages. |
42 void RequestUpdate(); | 44 void RequestUpdate(); |
43 | 45 |
44 void AddObserver(Observer* observer); | 46 void AddObserver(Observer* observer); |
45 void RemoveObserver(Observer* observer); | 47 void RemoveObserver(Observer* observer); |
46 | 48 |
47 private: | 49 private: |
48 class NetworkSmsDeviceHandler; | 50 class NetworkSmsDeviceHandler; |
| 51 class ModemManagerNetworkSmsDeviceHandler; |
| 52 class ModemManager1NetworkSmsDeviceHandler; |
49 | 53 |
50 // Called from NetworkSmsDeviceHandler when a message is received. | 54 // Called from NetworkSmsDeviceHandler when a message is received. |
51 void NotifyMessageReceived(const base::DictionaryValue& message); | 55 void NotifyMessageReceived(const base::DictionaryValue& message); |
52 | 56 |
53 // Callback to handle the manager properties with the list of devices. | 57 // Callback to handle the manager properties with the list of devices. |
54 void ManagerPropertiesCallback(DBusMethodCallStatus call_status, | 58 void ManagerPropertiesCallback(DBusMethodCallStatus call_status, |
55 const base::DictionaryValue& properties); | 59 const base::DictionaryValue& properties); |
56 | 60 |
57 // Callback to handle the device properties for |device_path|. | 61 // Callback to handle the device properties for |device_path|. |
58 // A NetworkSmsDeviceHandler will be instantiated for each cellular device. | 62 // A NetworkSmsDeviceHandler will be instantiated for each cellular device. |
59 void DevicePropertiesCallback(const std::string& device_path, | 63 void DevicePropertiesCallback(const std::string& device_path, |
60 DBusMethodCallStatus call_status, | 64 DBusMethodCallStatus call_status, |
61 const base::DictionaryValue& properties); | 65 const base::DictionaryValue& properties); |
62 | 66 |
63 ObserverList<Observer> observers_; | 67 ObserverList<Observer> observers_; |
64 ScopedVector<NetworkSmsDeviceHandler> device_handlers_; | 68 ScopedVector<NetworkSmsDeviceHandler> device_handlers_; |
65 base::WeakPtrFactory<NetworkSmsHandler> weak_ptr_factory_; | 69 base::WeakPtrFactory<NetworkSmsHandler> weak_ptr_factory_; |
66 | 70 |
67 DISALLOW_COPY_AND_ASSIGN(NetworkSmsHandler); | 71 DISALLOW_COPY_AND_ASSIGN(NetworkSmsHandler); |
68 }; | 72 }; |
69 | 73 |
70 } // namespace | 74 } // namespace |
71 | 75 |
72 #endif // CHROMEOS_NETWORK_NETWORK_SMS_HANDLER_H_ | 76 #endif // CHROMEOS_NETWORK_NETWORK_SMS_HANDLER_H_ |
OLD | NEW |