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
3 // found in the LICENSE file.
5 #ifndef EXTENSIONS_RENDERER_GUEST_VIEW_GUEST_VIEW_CONTAINER_H_
6 #define EXTENSIONS_RENDERER_GUEST_VIEW_GUEST_VIEW_CONTAINER_H_
8 #include "content/public/renderer/browser_plugin_delegate.h"
9 #include "content/public/renderer/render_frame_observer.h"
10 #include "ipc/ipc_message.h"
12 namespace extensions {
14 class GuestViewContainer : public content::BrowserPluginDelegate,
15 public content::RenderFrameObserver {
17 explicit GuestViewContainer(content::RenderFrame* render_frame);
18 ~GuestViewContainer() override;
20 // BrowserPluginDelegate implementation.
21 void SetElementInstanceID(int element_instance_id) override;
23 // RenderFrameObserver override.
24 void OnDestruct() override;
25 bool OnMessageReceived(const IPC::Message& message) override;
27 virtual bool HandlesMessage(const IPC::Message& message) = 0;
28 virtual bool OnMessage(const IPC::Message& message) = 0;
31 int element_instance_id() const { return element_instance_id_; }
32 int render_view_routing_id() const { return render_view_routing_id_; }
35 int element_instance_id_;
36 int render_view_routing_id_;
38 DISALLOW_COPY_AND_ASSIGN(GuestViewContainer);
41 } // namespace extensions
43 #endif // EXTENSIONS_RENDERER_GUEST_VIEW_GUEST_VIEW_CONTAINER_H_