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 "base/memory/scoped_ptr.h"
9 #include "content/public/renderer/browser_plugin_delegate.h"
10 #include "ipc/ipc_message.h"
12 namespace extensions
{
14 class GuestViewContainer
: public content::BrowserPluginDelegate
{
16 explicit GuestViewContainer(content::RenderFrame
* render_frame
);
17 ~GuestViewContainer() override
;
19 // Queries whether GuestViewContainer is interested in the |message|.
20 static bool HandlesMessage(const IPC::Message
& message
);
22 void RenderFrameDestroyed();
24 // BrowserPluginDelegate implementation.
25 void SetElementInstanceID(int element_instance_id
) override
;
27 int element_instance_id() const { return element_instance_id_
; }
28 content::RenderFrame
* render_frame() const { return render_frame_
; }
30 virtual void OnRenderFrameDestroyed() {}
33 class RenderFrameLifetimeObserver
;
35 int element_instance_id_
;
36 content::RenderFrame
* render_frame_
;
37 scoped_ptr
<RenderFrameLifetimeObserver
> render_frame_lifetime_observer_
;
39 DISALLOW_COPY_AND_ASSIGN(GuestViewContainer
);
42 } // namespace extensions
44 #endif // EXTENSIONS_RENDERER_GUEST_VIEW_GUEST_VIEW_CONTAINER_H_