OLD | NEW |
| (Empty) |
1 // Copyright 2015 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 CONTENT_RENDERER_ANDROID_APP_WEB_MESSAGE_PORT_CLIENT_H_ | |
6 #define CONTENT_RENDERER_ANDROID_APP_WEB_MESSAGE_PORT_CLIENT_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "base/macros.h" | |
11 #include "base/strings/string16.h" | |
12 #include "content/public/renderer/render_frame_observer.h" | |
13 | |
14 namespace content { | |
15 | |
16 // Renderer side of Android webview specific message port service. This service | |
17 // is used to convert messages from WebSerializedScriptValue to a base value. | |
18 class AppWebMessagePortClient : public content::RenderFrameObserver { | |
19 public: | |
20 explicit AppWebMessagePortClient(content::RenderFrame* render_frame); | |
21 | |
22 private: | |
23 ~AppWebMessagePortClient() override; | |
24 | |
25 // RenderFrameObserver | |
26 bool OnMessageReceived(const IPC::Message& message) override; | |
27 void OnDestruct() override; | |
28 | |
29 void OnWebToAppMessage(int message_port_id, | |
30 const base::string16& message, | |
31 const std::vector<int>& sent_message_port_ids); | |
32 void OnAppToWebMessage(int message_port_id, | |
33 const base::string16& message, | |
34 const std::vector<int>& sent_message_port_ids); | |
35 void OnClosePort(int message_port_id); | |
36 | |
37 DISALLOW_COPY_AND_ASSIGN(AppWebMessagePortClient); | |
38 }; | |
39 } | |
40 | |
41 #endif // CONTENT_RENDERER_ANDROID_APP_WEB_MESSAGE_PORT_CLIENT_H_ | |
OLD | NEW |