OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chromeos/dbus/fake_modem_messaging_client.h" | 5 #include "chromeos/dbus/fake_modem_messaging_client.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "dbus/object_path.h" | 12 #include "dbus/object_path.h" |
13 | 13 |
14 namespace chromeos { | 14 namespace chromeos { |
15 | 15 |
16 FakeModemMessagingClient::FakeModemMessagingClient() {} | 16 FakeModemMessagingClient::FakeModemMessagingClient() {} |
17 FakeModemMessagingClient::~FakeModemMessagingClient() {} | 17 FakeModemMessagingClient::~FakeModemMessagingClient() {} |
18 | 18 |
19 void FakeModemMessagingClient::Init(dbus::Bus* bus) {} | 19 void FakeModemMessagingClient::Init(dbus::Bus* bus) {} |
20 | 20 |
21 void FakeModemMessagingClient::SetSmsReceivedHandler( | 21 void FakeModemMessagingClient::SetSmsReceivedHandler( |
22 const std::string& service_name, | 22 const std::string& service_name, |
23 const dbus::ObjectPath& object_path, | 23 const dbus::ObjectPath& object_path, |
24 const SmsReceivedHandler& handler) { | 24 const SmsReceivedHandler& handler) { |
25 DCHECK(sms_received_handler_.is_null()); | |
26 sms_received_handler_ = handler; | 25 sms_received_handler_ = handler; |
27 } | 26 } |
28 | 27 |
29 void FakeModemMessagingClient::ResetSmsReceivedHandler( | 28 void FakeModemMessagingClient::ResetSmsReceivedHandler( |
30 const std::string& service_name, | 29 const std::string& service_name, |
31 const dbus::ObjectPath& object_path) { | 30 const dbus::ObjectPath& object_path) { |
32 sms_received_handler_.Reset(); | 31 sms_received_handler_.Reset(); |
33 } | 32 } |
34 | 33 |
35 void FakeModemMessagingClient::Delete(const std::string& service_name, | 34 void FakeModemMessagingClient::Delete(const std::string& service_name, |
(...skipping 19 matching lines...) Expand all Loading... |
55 message_paths_.push_back(kSmsPath); | 54 message_paths_.push_back(kSmsPath); |
56 if (!sms_received_handler_.is_null()) | 55 if (!sms_received_handler_.is_null()) |
57 sms_received_handler_.Run(kSmsPath, true); | 56 sms_received_handler_.Run(kSmsPath, true); |
58 callback.Run(no_paths); | 57 callback.Run(no_paths); |
59 } else { | 58 } else { |
60 callback.Run(message_paths_); | 59 callback.Run(message_paths_); |
61 } | 60 } |
62 } | 61 } |
63 | 62 |
64 } // namespace chromeos | 63 } // namespace chromeos |
OLD | NEW |