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_EXTENSIONS_GUEST_VIEW_CONTAINER_H_
6 #define EXTENSIONS_RENDERER_GUEST_VIEW_EXTENSIONS_GUEST_VIEW_CONTAINER_H_
10 #include "components/guest_view/renderer/guest_view_container.h"
11 #include "v8/include/v8.h"
17 namespace extensions
{
19 class ExtensionsGuestViewContainer
: public guest_view::GuestViewContainer
{
21 explicit ExtensionsGuestViewContainer(content::RenderFrame
* render_frame
);
23 void RegisterElementResizeCallback(v8::Local
<v8::Function
> callback
,
24 v8::Isolate
* isolate
);
26 // BrowserPluginDelegate implementation.
27 void DidResizeElement(const gfx::Size
& new_size
) override
;
30 ~ExtensionsGuestViewContainer() override
;
33 void CallElementResizeCallback(const gfx::Size
& new_size
);
35 // GuestViewContainer implementation.
36 void OnDestroy(bool embedder_frame_destroyed
) override
;
38 v8::Global
<v8::Function
> element_resize_callback_
;
39 v8::Isolate
* element_resize_isolate_
;
41 // Weak pointer factory used for calling the element resize callback.
42 base::WeakPtrFactory
<ExtensionsGuestViewContainer
> weak_ptr_factory_
;
44 DISALLOW_COPY_AND_ASSIGN(ExtensionsGuestViewContainer
);
47 } // namespace extensions
49 #endif // EXTENSIONS_RENDERER_GUEST_VIEW_EXTENSIONS_GUEST_VIEW_CONTAINER_H_