OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/push_messaging_message_filter.h" | 5 #include "content/browser/push_messaging_message_filter.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "content/common/push_messaging_messages.h" | 9 #include "content/common/push_messaging_messages.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 PushMessagingMessageFilter::PushMessagingMessageFilter() | 14 PushMessagingMessageFilter::PushMessagingMessageFilter() |
15 : BrowserMessageFilter(PushMessagingMsgStart) {} | 15 : BrowserMessageFilter(PushMessagingMsgStart) {} |
16 | 16 |
17 PushMessagingMessageFilter::~PushMessagingMessageFilter() {} | 17 PushMessagingMessageFilter::~PushMessagingMessageFilter() {} |
18 | 18 |
19 bool PushMessagingMessageFilter::OnMessageReceived(const IPC::Message& message, | 19 bool PushMessagingMessageFilter::OnMessageReceived( |
20 bool* message_was_ok) { | 20 const IPC::Message& message) { |
21 bool handled = true; | 21 bool handled = true; |
22 IPC_BEGIN_MESSAGE_MAP_EX(PushMessagingMessageFilter, message, *message_was_ok) | 22 IPC_BEGIN_MESSAGE_MAP(PushMessagingMessageFilter, message) |
23 IPC_MESSAGE_HANDLER(PushMessagingHostMsg_Register, OnRegister) | 23 IPC_MESSAGE_HANDLER(PushMessagingHostMsg_Register, OnRegister) |
24 IPC_MESSAGE_UNHANDLED(handled = false) | 24 IPC_MESSAGE_UNHANDLED(handled = false) |
25 IPC_END_MESSAGE_MAP() | 25 IPC_END_MESSAGE_MAP() |
26 return handled; | 26 return handled; |
27 } | 27 } |
28 | 28 |
29 void PushMessagingMessageFilter::OnRegister(int routing_id, | 29 void PushMessagingMessageFilter::OnRegister(int routing_id, |
30 int callbacks_id, | 30 int callbacks_id, |
31 const std::string& sender_id) { | 31 const std::string& sender_id) { |
32 // TODO(mvanouwerkerk): Really implement, the below simply returns an error. | 32 // TODO(mvanouwerkerk): Really implement, the below simply returns an error. |
(...skipping 21 matching lines...) Expand all Loading... |
54 Send(new PushMessagingMsg_RegisterSuccess(routing_id, | 54 Send(new PushMessagingMsg_RegisterSuccess(routing_id, |
55 callbacks_id, | 55 callbacks_id, |
56 endpoint, | 56 endpoint, |
57 registration_id)); | 57 registration_id)); |
58 } else { | 58 } else { |
59 Send(new PushMessagingMsg_RegisterError(routing_id, callbacks_id)); | 59 Send(new PushMessagingMsg_RegisterError(routing_id, callbacks_id)); |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 } // namespace content | 63 } // namespace content |
OLD | NEW |