| 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/native_web_keyboard_event.h" | 10 #include "content/public/browser/native_web_keyboard_event.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 // anything else. When the view is live, these messages are forwarded to it by | 106 // anything else. When the view is live, these messages are forwarded to it by |
| 107 // the RenderWidgetHost's IPC message map. | 107 // the RenderWidgetHost's IPC message map. |
| 108 class CONTENT_EXPORT RenderWidgetHost : public IPC::Sender { | 108 class CONTENT_EXPORT RenderWidgetHost : public IPC::Sender { |
| 109 public: | 109 public: |
| 110 // Free all backing stores used for rendering to drop memory usage. | 110 // Free all backing stores used for rendering to drop memory usage. |
| 111 static void RemoveAllBackingStores(); | 111 static void RemoveAllBackingStores(); |
| 112 | 112 |
| 113 // Returns the size of all the backing stores used for rendering | 113 // Returns the size of all the backing stores used for rendering |
| 114 static size_t BackingStoreMemorySize(); | 114 static size_t BackingStoreMemorySize(); |
| 115 | 115 |
| 116 // Adds/removes a callback called on creation of each new RenderWidgetHost. | |
| 117 typedef base::Callback<void(RenderWidgetHost*)> CreatedCallback; | |
| 118 static void AddCreatedCallback(const CreatedCallback& callback); | |
| 119 static void RemoveCreatedCallback(const CreatedCallback& callback); | |
| 120 | |
| 121 // Returns the RenderWidgetHost given its ID and the ID of its render process. | 116 // Returns the RenderWidgetHost given its ID and the ID of its render process. |
| 122 // Returns NULL if the IDs do not correspond to a live RenderWidgetHost. | 117 // Returns NULL if the IDs do not correspond to a live RenderWidgetHost. |
| 123 static RenderWidgetHost* FromID(int32 process_id, int32 routing_id); | 118 static RenderWidgetHost* FromID(int32 process_id, int32 routing_id); |
| 124 | 119 |
| 125 // Returns an iterator to iterate over the global list of active render widget | 120 // Returns an iterator to iterate over the global list of active render widget |
| 126 // hosts. | 121 // hosts. |
| 127 static scoped_ptr<RenderWidgetHostIterator> GetRenderWidgetHosts(); | 122 static scoped_ptr<RenderWidgetHostIterator> GetRenderWidgetHosts(); |
| 128 | 123 |
| 129 virtual ~RenderWidgetHost() {} | 124 virtual ~RenderWidgetHost() {} |
| 130 | 125 |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 // within content/. This method is necessary because | 317 // within content/. This method is necessary because |
| 323 // RenderWidgetHost is the root of a diamond inheritance pattern, so | 318 // RenderWidgetHost is the root of a diamond inheritance pattern, so |
| 324 // subclasses inherit it virtually, which removes our ability to | 319 // subclasses inherit it virtually, which removes our ability to |
| 325 // static_cast to the subclass. | 320 // static_cast to the subclass. |
| 326 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; | 321 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; |
| 327 }; | 322 }; |
| 328 | 323 |
| 329 } // namespace content | 324 } // namespace content |
| 330 | 325 |
| 331 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ | 326 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ |
| OLD | NEW |