| 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 // within content/. This method is necessary because | 315 // within content/. This method is necessary because |
| 308 // RenderWidgetHost is the root of a diamond inheritance pattern, so | 316 // RenderWidgetHost is the root of a diamond inheritance pattern, so |
| 309 // subclasses inherit it virtually, which removes our ability to | 317 // subclasses inherit it virtually, which removes our ability to |
| 310 // static_cast to the subclass. | 318 // static_cast to the subclass. |
| 311 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; | 319 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; |
| 312 }; | 320 }; |
| 313 | 321 |
| 314 } // namespace content | 322 } // namespace content |
| 315 | 323 |
| 316 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ | 324 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ |
| OLD | NEW |