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 #ifndef EXTENSIONS_RENDERER_GUEST_VIEW_GUEST_VIEW_CONTAINER_H_ | 5 #ifndef EXTENSIONS_RENDERER_GUEST_VIEW_GUEST_VIEW_CONTAINER_H_ |
6 #define EXTENSIONS_RENDERER_GUEST_VIEW_GUEST_VIEW_CONTAINER_H_ | 6 #define EXTENSIONS_RENDERER_GUEST_VIEW_GUEST_VIEW_CONTAINER_H_ |
7 | 7 |
8 #include "content/public/renderer/browser_plugin_delegate.h" | 8 #include "content/public/renderer/browser_plugin_delegate.h" |
9 #include "content/public/renderer/render_frame_observer.h" | 9 #include "content/public/renderer/render_frame_observer.h" |
10 #include "ipc/ipc_message.h" | 10 #include "ipc/ipc_message.h" |
11 | 11 |
12 namespace extensions { | 12 namespace extensions { |
13 | 13 |
14 class GuestViewContainer : public content::BrowserPluginDelegate, | 14 class GuestViewContainer : public content::BrowserPluginDelegate { |
15 public content::RenderFrameObserver { | |
16 public: | 15 public: |
17 explicit GuestViewContainer(content::RenderFrame* render_frame); | 16 explicit GuestViewContainer(content::RenderFrame* render_frame); |
18 ~GuestViewContainer() override; | 17 ~GuestViewContainer() override; |
19 | 18 |
| 19 // Queries whether GuestViewContainer is interested in the |message|. |
| 20 static bool HandlesMessage(const IPC::Message& message); |
| 21 |
20 // BrowserPluginDelegate implementation. | 22 // BrowserPluginDelegate implementation. |
21 void SetElementInstanceID(int element_instance_id) override; | 23 void SetElementInstanceID(int element_instance_id) override; |
22 | 24 |
23 // RenderFrameObserver override. | |
24 void OnDestruct() override; | |
25 bool OnMessageReceived(const IPC::Message& message) override; | |
26 | |
27 virtual bool HandlesMessage(const IPC::Message& message) = 0; | |
28 virtual bool OnMessage(const IPC::Message& message) = 0; | |
29 | |
30 int element_instance_id() const { return element_instance_id_; } | 25 int element_instance_id() const { return element_instance_id_; } |
31 int render_view_routing_id() const { return render_view_routing_id_; } | 26 int render_view_routing_id() const { return render_view_routing_id_; } |
| 27 content::RenderFrame* render_frame() const { return render_frame_; } |
32 | 28 |
33 private: | 29 private: |
34 int element_instance_id_; | 30 int element_instance_id_; |
35 int render_view_routing_id_; | 31 const int render_view_routing_id_; |
| 32 content::RenderFrame* const render_frame_; |
36 | 33 |
37 DISALLOW_COPY_AND_ASSIGN(GuestViewContainer); | 34 DISALLOW_COPY_AND_ASSIGN(GuestViewContainer); |
38 }; | 35 }; |
39 | 36 |
40 } // namespace extensions | 37 } // namespace extensions |
41 | 38 |
42 #endif // EXTENSIONS_RENDERER_GUEST_VIEW_GUEST_VIEW_CONTAINER_H_ | 39 #endif // EXTENSIONS_RENDERER_GUEST_VIEW_GUEST_VIEW_CONTAINER_H_ |
OLD | NEW |