OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_SMS_WATCHER_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_CROS_SMS_WATCHER_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "base/memory/weak_ptr.h" | |
12 #include "chrome/browser/chromeos/cros/cros_network_functions.h" | |
13 #include "chromeos/dbus/dbus_method_call_status.h" | |
14 #include "dbus/object_path.h" | |
15 | |
16 namespace base { | |
17 | |
18 class DictionaryValue; | |
19 | |
20 } // namespace base | |
21 | |
22 namespace chromeos { | |
23 | |
24 // Class to watch sms without Libcros. | |
25 class SMSWatcher : public CrosNetworkWatcher { | |
26 public: | |
27 // Dictionary key constants. | |
28 static const char kNumberKey[]; | |
29 static const char kTextKey[]; | |
30 static const char kTimestampKey[]; | |
31 static const char kSmscKey[]; | |
32 static const char kValidityKey[]; | |
33 static const char kClassKey[]; | |
34 static const char kIndexKey[]; | |
35 | |
36 static const char kModemManager1NumberKey[]; | |
37 static const char kModemManager1TextKey[]; | |
38 static const char kModemManager1TimestampKey[]; | |
39 static const char kModemManager1SmscKey[]; | |
40 static const char kModemManager1ValidityKey[]; | |
41 static const char kModemManager1ClassKey[]; | |
42 static const char kModemManager1IndexKey[]; | |
43 | |
44 // Base class of watcher implementation classes. Public to allow | |
45 // derived classes in the anonymous namespace to inherit from it. | |
46 class WatcherBase; | |
47 | |
48 SMSWatcher(const std::string& modem_device_path, | |
49 MonitorSMSCallback callback); | |
50 virtual ~SMSWatcher(); | |
51 | |
52 private: | |
53 // Callback for shill device's GetProperties() method. | |
54 void DevicePropertiesCallback(DBusMethodCallStatus call_status, | |
55 const base::DictionaryValue& properties); | |
56 | |
57 base::WeakPtrFactory<SMSWatcher> weak_ptr_factory_; | |
58 std::string device_path_; | |
59 MonitorSMSCallback callback_; | |
60 scoped_ptr<WatcherBase> watcher_; | |
61 | |
62 DISALLOW_COPY_AND_ASSIGN(SMSWatcher); | |
63 }; | |
64 | |
65 } // namespace | |
66 | |
67 #endif // CHROME_BROWSER_CHROMEOS_CROS_SMS_WATCHER_H_ | |
OLD | NEW |