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.
5 #ifndef CHROMEOS_NETWORK_SMS_WATCHER_H_
6 #define CHROMEOS_NETWORK_SMS_WATCHER_H_
11 #include "base/memory/weak_ptr.h"
12 #include "chromeos/chromeos_export.h"
13 #include "chromeos/dbus/dbus_method_call_status.h"
14 #include "chromeos/network/cros_network_functions.h"
15 #include "dbus/object_path.h"
19 class DictionaryValue
;
25 // Class to watch sms without Libcros.
26 class CHROMEOS_EXPORT SMSWatcher
: public CrosNetworkWatcher
{
28 // Dictionary key constants.
29 static const char kNumberKey
[];
30 static const char kTextKey
[];
31 static const char kTimestampKey
[];
32 static const char kSmscKey
[];
33 static const char kValidityKey
[];
34 static const char kClassKey
[];
35 static const char kIndexKey
[];
37 static const char kModemManager1NumberKey
[];
38 static const char kModemManager1TextKey
[];
39 static const char kModemManager1TimestampKey
[];
40 static const char kModemManager1SmscKey
[];
41 static const char kModemManager1ValidityKey
[];
42 static const char kModemManager1ClassKey
[];
43 static const char kModemManager1IndexKey
[];
45 // Base class of watcher implementation classes. Public to allow
46 // derived classes in the anonymous namespace to inherit from it.
49 SMSWatcher(const std::string
& modem_device_path
,
50 MonitorSMSCallback callback
);
51 virtual ~SMSWatcher();
54 // Callback for shill device's GetProperties() method.
55 void DevicePropertiesCallback(DBusMethodCallStatus call_status
,
56 const base::DictionaryValue
& properties
);
58 base::WeakPtrFactory
<SMSWatcher
> weak_ptr_factory_
;
59 std::string device_path_
;
60 MonitorSMSCallback callback_
;
61 scoped_ptr
<WatcherBase
> watcher_
;
63 DISALLOW_COPY_AND_ASSIGN(SMSWatcher
);
68 #endif // CHROMEOS_NETWORK_SMS_WATCHER_H_