OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CONTENT_PLUGIN_WEBPLUGIN_DELEGATE_STUB_H_ | 5 #ifndef CONTENT_PLUGIN_WEBPLUGIN_DELEGATE_STUB_H_ |
6 #define CONTENT_PLUGIN_WEBPLUGIN_DELEGATE_STUB_H_ | 6 #define CONTENT_PLUGIN_WEBPLUGIN_DELEGATE_STUB_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "content/common/npobject_stub.h" | 13 #include "content/common/npobject_stub.h" |
14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
15 #include "ipc/ipc_channel.h" | 15 #include "ipc/ipc_listener.h" |
| 16 #include "ipc/ipc_sender.h" |
16 #include "third_party/npapi/bindings/npapi.h" | 17 #include "third_party/npapi/bindings/npapi.h" |
17 #include "ui/gfx/native_widget_types.h" | 18 #include "ui/gfx/native_widget_types.h" |
18 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
19 | 20 |
20 class PluginChannel; | 21 class PluginChannel; |
21 class WebPluginProxy; | 22 class WebPluginProxy; |
22 struct PluginMsg_Init_Params; | 23 struct PluginMsg_Init_Params; |
23 struct PluginMsg_DidReceiveResponseParams; | 24 struct PluginMsg_DidReceiveResponseParams; |
24 struct PluginMsg_UpdateGeometry_Param; | 25 struct PluginMsg_UpdateGeometry_Param; |
25 class WebCursor; | 26 class WebCursor; |
26 | 27 |
27 namespace WebKit { | 28 namespace WebKit { |
28 class WebInputEvent; | 29 class WebInputEvent; |
29 } | 30 } |
30 | 31 |
31 namespace webkit { | 32 namespace webkit { |
32 namespace npapi { | 33 namespace npapi { |
33 class WebPluginDelegateImpl; | 34 class WebPluginDelegateImpl; |
34 } | 35 } |
35 } | 36 } |
36 | 37 |
37 // Converts the IPC messages from WebPluginDelegateProxy into calls to the | 38 // Converts the IPC messages from WebPluginDelegateProxy into calls to the |
38 // actual WebPluginDelegateImpl object. | 39 // actual WebPluginDelegateImpl object. |
39 class WebPluginDelegateStub : public IPC::Channel::Listener, | 40 class WebPluginDelegateStub : public IPC::Listener, |
40 public IPC::Message::Sender, | 41 public IPC::Sender, |
41 public base::RefCounted<WebPluginDelegateStub> { | 42 public base::RefCounted<WebPluginDelegateStub> { |
42 public: | 43 public: |
43 WebPluginDelegateStub(const std::string& mime_type, int instance_id, | 44 WebPluginDelegateStub(const std::string& mime_type, int instance_id, |
44 PluginChannel* channel); | 45 PluginChannel* channel); |
45 | 46 |
46 // IPC::Channel::Listener implementation: | 47 // IPC::Listener implementation: |
47 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 48 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
48 | 49 |
49 // IPC::Message::Sender implementation: | 50 // IPC::Sender implementation: |
50 virtual bool Send(IPC::Message* msg) OVERRIDE; | 51 virtual bool Send(IPC::Message* msg) OVERRIDE; |
51 | 52 |
52 int instance_id() { return instance_id_; } | 53 int instance_id() { return instance_id_; } |
53 WebPluginProxy* webplugin() { return webplugin_; } | 54 WebPluginProxy* webplugin() { return webplugin_; } |
54 | 55 |
55 private: | 56 private: |
56 friend class base::RefCounted<WebPluginDelegateStub>; | 57 friend class base::RefCounted<WebPluginDelegateStub>; |
57 | 58 |
58 virtual ~WebPluginDelegateStub(); | 59 virtual ~WebPluginDelegateStub(); |
59 | 60 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // window handle which is used for subsequent communication back to the | 129 // window handle which is used for subsequent communication back to the |
129 // browser. | 130 // browser. |
130 void OnSetFakeAcceleratedSurfaceWindowHandle(gfx::PluginWindowHandle window); | 131 void OnSetFakeAcceleratedSurfaceWindowHandle(gfx::PluginWindowHandle window); |
131 #endif | 132 #endif |
132 #endif | 133 #endif |
133 | 134 |
134 DISALLOW_IMPLICIT_CONSTRUCTORS(WebPluginDelegateStub); | 135 DISALLOW_IMPLICIT_CONSTRUCTORS(WebPluginDelegateStub); |
135 }; | 136 }; |
136 | 137 |
137 #endif // CONTENT_PLUGIN_WEBPLUGIN_DELEGATE_STUB_H_ | 138 #endif // CONTENT_PLUGIN_WEBPLUGIN_DELEGATE_STUB_H_ |
OLD | NEW |