Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 129 lines (110 sloc) 4.962 kb
8206107 @pathorn Added BSD license headers
pathorn authored
1 /* Berkelium Implementation
2 * MemoryRenderViewHost.hpp
3 *
4 * Copyright (c) 2009, Patrick Reiter Horn
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
9 * met:
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
15 * distribution.
16 * * Neither the name of Sirikata nor the names of its contributors may
17 * be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
24 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
0dfd7ad @pathorn Beginning work on widget support (doesn't compile yet)
pathorn authored
33 #ifndef _BERKELIUM_MEMORYRENDERVIEWHOST_HPP_
34 #define _BERKELIUM_MEMORYRENDERVIEWHOST_HPP_
26b1193 @pathorn Added missing files.
pathorn authored
35
dce36df @pathorn Updated to chromium 11 stable on windows.
pathorn authored
36 #include "content/browser/renderer_host/render_view_host.h"
37 #include "content/browser/renderer_host/render_view_host_factory.h"
26b1193 @pathorn Added missing files.
pathorn authored
38
e1f51c7 @danielrh make the process() and routing_id() functiosn virtual so baseo f MemoryR...
danielrh authored
39 class RenderWidgetHostView;
26b1193 @pathorn Added missing files.
pathorn authored
40 namespace Berkelium {
41 class WindowImpl;
97483e9 @pathorn Forgot to add Widget.hpp because of ambiguous rule in .gitignore
pathorn authored
42 class RenderWidget;
26b1193 @pathorn Added missing files.
pathorn authored
43
0dfd7ad @pathorn Beginning work on widget support (doesn't compile yet)
pathorn authored
44 class MemoryRenderHostBase {
45 MemoryRenderHostBase() {}
90940dc @danielrh closer to widget support
danielrh authored
46 virtual ~MemoryRenderHostBase() {}
47
c591879 @pathorn Updated most files to 48564 -- still need to update virtual functions in...
pathorn authored
48 virtual void Memory_OnMsgUpdateRect(const ViewHostMsg_UpdateRect_Params&params)=0;
49 virtual void Memory_PaintBackingStoreRect(TransportDIB* bitmap,
90940dc @danielrh closer to widget support
danielrh authored
50 const gfx::Rect& bitmap_rect,
c591879 @pathorn Updated most files to 48564 -- still need to update virtual functions in...
pathorn authored
51 const std::vector<gfx::Rect>& copy_rects,
52 const gfx::Size& view_size,
90940dc @danielrh closer to widget support
danielrh authored
53 int dx, int dy,
54 const gfx::Rect& clip_rect)=0;
55
56 };
57
58 template <class RenderXHost> class MemoryRenderHostImpl: public RenderXHost {
0ff8e85 @pathorn The dropdowns now appear on the viewTexture render surface the first tim...
pathorn authored
59 void init();
90940dc @danielrh closer to widget support
danielrh authored
60 protected:
0ff8e85 @pathorn The dropdowns now appear on the viewTexture render surface the first tim...
pathorn authored
61 template<class A, class B, class C, class D> MemoryRenderHostImpl(A a, B b, C c, D d):RenderXHost(a,b,c,d) {init();}
6b24d7d @danielrh Added new libs for 3D and native client
danielrh authored
62 template<class A, class B, class C> MemoryRenderHostImpl(A a, B b, C c):RenderXHost(a,b,c) {init();}
0ff8e85 @pathorn The dropdowns now appear on the viewTexture render surface the first tim...
pathorn authored
63 template<class A, class B> MemoryRenderHostImpl(A a, B b):RenderXHost(a,b) { init();}
90940dc @danielrh closer to widget support
danielrh authored
64 ~MemoryRenderHostImpl() {}
26b1193 @pathorn Added missing files.
pathorn authored
65
e1f51c7 @danielrh make the process() and routing_id() functiosn virtual so baseo f MemoryR...
danielrh authored
66 public:
902e9ce @pathorn Compiles with widget support, but it crashes when you create a widget.
pathorn authored
67 void Memory_WasResized();
c591879 @pathorn Updated most files to 48564 -- still need to update virtual functions in...
pathorn authored
68 void Memory_OnMsgUpdateRect(const ViewHostMsg_UpdateRect_Params&params);
69 virtual void Memory_PaintBackingStoreRect(TransportDIB* bitmap,
26b1193 @pathorn Added missing files.
pathorn authored
70 const gfx::Rect& bitmap_rect,
c591879 @pathorn Updated most files to 48564 -- still need to update virtual functions in...
pathorn authored
71 const std::vector<gfx::Rect>& copy_rects,
72 const gfx::Size& view_size,
4d59882 @pathorn Removed dependency on BackingStore, implemented scrolling. Resize is sti...
pathorn authored
73 int dx, int dy,
74 const gfx::Rect& clip_rect);
90940dc @danielrh closer to widget support
danielrh authored
75 protected:
ad8f3be @danielrh Added paint callback
danielrh authored
76 WindowImpl *mWindow;
902e9ce @pathorn Compiles with widget support, but it crashes when you create a widget.
pathorn authored
77 RenderWidget *mWidget;
4d59882 @pathorn Removed dependency on BackingStore, implemented scrolling. Resize is sti...
pathorn authored
78 gfx::Size current_size_;
e1f51c7 @danielrh make the process() and routing_id() functiosn virtual so baseo f MemoryR...
danielrh authored
79 bool mResizeAckPending;
80 gfx::Size mInFlightSize;
0dfd7ad @pathorn Beginning work on widget support (doesn't compile yet)
pathorn authored
81 };
82
90940dc @danielrh closer to widget support
danielrh authored
83 class MemoryRenderWidgetHost : public MemoryRenderHostImpl<RenderWidgetHost> {
0dfd7ad @pathorn Beginning work on widget support (doesn't compile yet)
pathorn authored
84 public:
85 MemoryRenderWidgetHost(
e1f51c7 @danielrh make the process() and routing_id() functiosn virtual so baseo f MemoryR...
danielrh authored
86 RenderViewHostDelegate *win,
87 RenderWidgetHostView*wid,
0dfd7ad @pathorn Beginning work on widget support (doesn't compile yet)
pathorn authored
88 RenderProcessHost* process,
89 int routing_id);
90 ~MemoryRenderWidgetHost();
4e00315 @pathorn Updated to version 11.0.672.2 on Linux
pathorn authored
91 virtual bool OnMessageReceived(const IPC::Message& msg);
c591879 @pathorn Updated most files to 48564 -- still need to update virtual functions in...
pathorn authored
92 virtual void Memory_OnMsgUpdateRect(const ViewHostMsg_UpdateRect_Params&params);
0ff8e85 @pathorn The dropdowns now appear on the viewTexture render surface the first tim...
pathorn authored
93
0dfd7ad @pathorn Beginning work on widget support (doesn't compile yet)
pathorn authored
94 };
95
90940dc @danielrh closer to widget support
danielrh authored
96 class MemoryRenderViewHost : public MemoryRenderHostImpl <RenderViewHost> {
0dfd7ad @pathorn Beginning work on widget support (doesn't compile yet)
pathorn authored
97 public:
98 MemoryRenderViewHost(
99 SiteInstance* instance,
100 RenderViewHostDelegate* delegate,
c591879 @pathorn Updated most files to 48564 -- still need to update virtual functions in...
pathorn authored
101 int routing_id,
47263d2 @pathorn Updated to Chromium version 9.0.566.0
pathorn authored
102 SessionStorageNamespace *session_storage_namespace_id);
0dfd7ad @pathorn Beginning work on widget support (doesn't compile yet)
pathorn authored
103 ~MemoryRenderViewHost();
0ff8e85 @pathorn The dropdowns now appear on the viewTexture render surface the first tim...
pathorn authored
104
8410c74 @pathorn Add support for history using history.go(x) in javascript, alert(), cons...
pathorn authored
105 void Memory_OnAddMessageToConsole(
106 const std::wstring& message,
107 int32 line_no,
108 const std::wstring& source_id);
4e00315 @pathorn Updated to version 11.0.672.2 on Linux
pathorn authored
109 virtual bool OnMessageReceived(const IPC::Message& msg);
26b1193 @pathorn Added missing files.
pathorn authored
110 };
111
112 class MemoryRenderViewHostFactory : public RenderViewHostFactory {
113 public:
114
115 ~MemoryRenderViewHostFactory();
116 MemoryRenderViewHostFactory();
117
118 virtual RenderViewHost* CreateRenderViewHost(
119 SiteInstance* instance,
120 RenderViewHostDelegate* delegate,
c591879 @pathorn Updated most files to 48564 -- still need to update virtual functions in...
pathorn authored
121 int routing_id,
47263d2 @pathorn Updated to Chromium version 9.0.566.0
pathorn authored
122 SessionStorageNamespace *ssn_id);
26b1193 @pathorn Added missing files.
pathorn authored
123 };
124
0dfd7ad @pathorn Beginning work on widget support (doesn't compile yet)
pathorn authored
125
26b1193 @pathorn Added missing files.
pathorn authored
126 }
127
128 #endif
Something went wrong with that request. Please try again.