forked from adamlaska/electron
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathguest_view_container.h
More file actions
47 lines (32 loc) · 1.18 KB
/
guest_view_container.h
File metadata and controls
47 lines (32 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) 2015 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ELECTRON_SHELL_RENDERER_GUEST_VIEW_CONTAINER_H_
#define ELECTRON_SHELL_RENDERER_GUEST_VIEW_CONTAINER_H_
#include "base/callback.h"
namespace content {
class RenderFrame;
}
namespace gfx {
class Size;
}
namespace electron {
class GuestViewContainer {
public:
typedef base::RepeatingCallback<void(const gfx::Size&)> ResizeCallback;
explicit GuestViewContainer(content::RenderFrame* render_frame);
virtual ~GuestViewContainer();
// disable copy
GuestViewContainer(const GuestViewContainer&) = delete;
GuestViewContainer& operator=(const GuestViewContainer&) = delete;
static GuestViewContainer* FromID(int element_instance_id);
void RegisterElementResizeCallback(const ResizeCallback& callback);
void SetElementInstanceID(int element_instance_id);
void DidResizeElement(const gfx::Size& new_size);
private:
int element_instance_id_;
ResizeCallback element_resize_callback_;
base::WeakPtrFactory<GuestViewContainer> weak_ptr_factory_{this};
};
} // namespace electron
#endif // ELECTRON_SHELL_RENDERER_GUEST_VIEW_CONTAINER_H_