OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ |
6 #define CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "content/public/browser/keyboard_listener.h" | 10 #include "content/public/browser/keyboard_listener.h" |
(...skipping 17 matching lines...) Expand all Loading... | |
28 class Rect; | 28 class Rect; |
29 } | 29 } |
30 | 30 |
31 namespace WebKit { | 31 namespace WebKit { |
32 struct WebScreenInfo; | 32 struct WebScreenInfo; |
33 } | 33 } |
34 | 34 |
35 namespace content { | 35 namespace content { |
36 | 36 |
37 class RenderProcessHost; | 37 class RenderProcessHost; |
38 class RenderWidgetHost; | |
38 class RenderWidgetHostImpl; | 39 class RenderWidgetHostImpl; |
39 class RenderWidgetHostView; | 40 class RenderWidgetHostView; |
40 | 41 |
42 typedef std::vector<RenderWidgetHost*> RenderWidgetHostList; | |
dcheng
2013/06/11 00:34:58
I think this typedef is unused.
| |
43 | |
41 // A RenderWidgetHost manages the browser side of a browser<->renderer | 44 // A RenderWidgetHost manages the browser side of a browser<->renderer |
42 // HWND connection. The HWND lives in the browser process, and | 45 // HWND connection. The HWND lives in the browser process, and |
43 // windows events are sent over IPC to the corresponding object in the | 46 // windows events are sent over IPC to the corresponding object in the |
44 // renderer. The renderer paints into shared memory, which we | 47 // renderer. The renderer paints into shared memory, which we |
45 // transfer to a backing store and blit to the screen when Windows | 48 // transfer to a backing store and blit to the screen when Windows |
46 // sends us a WM_PAINT message. | 49 // sends us a WM_PAINT message. |
47 // | 50 // |
48 // How Shutdown Works | 51 // How Shutdown Works |
49 // | 52 // |
50 // There are two situations in which this object, a RenderWidgetHost, can be | 53 // There are two situations in which this object, a RenderWidgetHost, can be |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
110 static void RemoveAllBackingStores(); | 113 static void RemoveAllBackingStores(); |
111 | 114 |
112 // Returns the size of all the backing stores used for rendering | 115 // Returns the size of all the backing stores used for rendering |
113 static size_t BackingStoreMemorySize(); | 116 static size_t BackingStoreMemorySize(); |
114 | 117 |
115 // Adds/removes a callback called on creation of each new RenderWidgetHost. | 118 // Adds/removes a callback called on creation of each new RenderWidgetHost. |
116 typedef base::Callback<void(RenderWidgetHost*)> CreatedCallback; | 119 typedef base::Callback<void(RenderWidgetHost*)> CreatedCallback; |
117 static void AddCreatedCallback(const CreatedCallback& callback); | 120 static void AddCreatedCallback(const CreatedCallback& callback); |
118 static void RemoveCreatedCallback(const CreatedCallback& callback); | 121 static void RemoveCreatedCallback(const CreatedCallback& callback); |
119 | 122 |
123 // Returns the RenderWidgetHost given its ID and the ID of its render process. | |
124 // Returns NULL if the IDs do not correspond to a live RenderWidgetHost. | |
125 static RenderWidgetHost* FromID(int32 process_id, int32 routing_id); | |
126 | |
127 typedef std::vector<RenderWidgetHost*> List; | |
128 static scoped_ptr<RenderWidgetHost::List> GetRenderWidgetHosts(); | |
129 | |
120 virtual ~RenderWidgetHost() {} | 130 virtual ~RenderWidgetHost() {} |
121 | 131 |
122 // Edit operations. | 132 // Edit operations. |
123 virtual void Undo() = 0; | 133 virtual void Undo() = 0; |
124 virtual void Redo() = 0; | 134 virtual void Redo() = 0; |
125 virtual void Cut() = 0; | 135 virtual void Cut() = 0; |
126 virtual void Copy() = 0; | 136 virtual void Copy() = 0; |
127 virtual void CopyToFindPboard() = 0; | 137 virtual void CopyToFindPboard() = 0; |
128 virtual void Paste() = 0; | 138 virtual void Paste() = 0; |
129 virtual void PasteAndMatchStyle() = 0; | 139 virtual void PasteAndMatchStyle() = 0; |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
306 // within content/. This method is necessary because | 316 // within content/. This method is necessary because |
307 // RenderWidgetHost is the root of a diamond inheritance pattern, so | 317 // RenderWidgetHost is the root of a diamond inheritance pattern, so |
308 // subclasses inherit it virtually, which removes our ability to | 318 // subclasses inherit it virtually, which removes our ability to |
309 // static_cast to the subclass. | 319 // static_cast to the subclass. |
310 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; | 320 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; |
311 }; | 321 }; |
312 | 322 |
313 } // namespace content | 323 } // namespace content |
314 | 324 |
315 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ | 325 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ |
OLD | NEW |