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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 static void RemoveAllBackingStores(); | 110 static void RemoveAllBackingStores(); |
111 | 111 |
112 // Returns the size of all the backing stores used for rendering | 112 // Returns the size of all the backing stores used for rendering |
113 static size_t BackingStoreMemorySize(); | 113 static size_t BackingStoreMemorySize(); |
114 | 114 |
115 // Adds/removes a callback called on creation of each new RenderWidgetHost. | 115 // Adds/removes a callback called on creation of each new RenderWidgetHost. |
116 typedef base::Callback<void(RenderWidgetHost*)> CreatedCallback; | 116 typedef base::Callback<void(RenderWidgetHost*)> CreatedCallback; |
117 static void AddCreatedCallback(const CreatedCallback& callback); | 117 static void AddCreatedCallback(const CreatedCallback& callback); |
118 static void RemoveCreatedCallback(const CreatedCallback& callback); | 118 static void RemoveCreatedCallback(const CreatedCallback& callback); |
119 | 119 |
| 120 // Returns the RenderWidgetHost given its ID and the ID of its render process. |
| 121 // Returns NULL if the IDs do not correspond to a live RenderWidgetHost. |
| 122 static RenderWidgetHost* FromID(int32 process_id, int32 routing_id); |
| 123 |
| 124 typedef std::vector<RenderWidgetHost*> List; |
| 125 // Returns the global list of render widget hosts. |
| 126 static RenderWidgetHost::List GetRenderWidgetHosts(); |
| 127 |
120 virtual ~RenderWidgetHost() {} | 128 virtual ~RenderWidgetHost() {} |
121 | 129 |
122 // Edit operations. | 130 // Edit operations. |
123 virtual void Undo() = 0; | 131 virtual void Undo() = 0; |
124 virtual void Redo() = 0; | 132 virtual void Redo() = 0; |
125 virtual void Cut() = 0; | 133 virtual void Cut() = 0; |
126 virtual void Copy() = 0; | 134 virtual void Copy() = 0; |
127 virtual void CopyToFindPboard() = 0; | 135 virtual void CopyToFindPboard() = 0; |
128 virtual void Paste() = 0; | 136 virtual void Paste() = 0; |
129 virtual void PasteAndMatchStyle() = 0; | 137 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 | 314 // within content/. This method is necessary because |
307 // RenderWidgetHost is the root of a diamond inheritance pattern, so | 315 // RenderWidgetHost is the root of a diamond inheritance pattern, so |
308 // subclasses inherit it virtually, which removes our ability to | 316 // subclasses inherit it virtually, which removes our ability to |
309 // static_cast to the subclass. | 317 // static_cast to the subclass. |
310 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; | 318 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; |
311 }; | 319 }; |
312 | 320 |
313 } // namespace content | 321 } // namespace content |
314 | 322 |
315 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ | 323 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ |
OLD | NEW |