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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 #include "content/public/browser/keyboard_listener.h" | 11 #include "content/public/browser/keyboard_listener.h" |
12 #include "content/public/browser/native_web_keyboard_event.h" | 12 #include "content/public/browser/native_web_keyboard_event.h" |
13 #include "ipc/ipc_channel.h" | 13 #include "ipc/ipc_channel.h" |
| 14 #include "ipc/ipc_sender.h" |
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" |
16 #include "ui/gfx/size.h" | 17 #include "ui/gfx/size.h" |
17 #include "ui/surface/transport_dib.h" | 18 #include "ui/surface/transport_dib.h" |
18 | 19 |
19 #if defined(TOOLKIT_GTK) | 20 #if defined(TOOLKIT_GTK) |
20 #include "ui/base/x/x11_util.h" | 21 #include "ui/base/x/x11_util.h" |
21 #elif defined(OS_MACOSX) | 22 #elif defined(OS_MACOSX) |
22 #include "skia/ext/platform_device.h" | 23 #include "skia/ext/platform_device.h" |
23 #endif | 24 #endif |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // deletes itself, which is safe because no one else should have any references | 96 // deletes itself, which is safe because no one else should have any references |
96 // to it (the WebContents does not). | 97 // to it (the WebContents does not). |
97 // | 98 // |
98 // It should be noted that the RenderViewHost, not the RenderWidgetHost, | 99 // It should be noted that the RenderViewHost, not the RenderWidgetHost, |
99 // handles IPC messages relating to the render process going away, since the | 100 // handles IPC messages relating to the render process going away, since the |
100 // way a RenderViewHost (WebContents) handles the process dying is different to | 101 // way a RenderViewHost (WebContents) handles the process dying is different to |
101 // the way a select popup does. As such the RenderWidgetHostView handles these | 102 // the way a select popup does. As such the RenderWidgetHostView handles these |
102 // messages for select popups. This placement is more out of convenience than | 103 // messages for select popups. This placement is more out of convenience than |
103 // anything else. When the view is live, these messages are forwarded to it by | 104 // anything else. When the view is live, these messages are forwarded to it by |
104 // the RenderWidgetHost's IPC message map. | 105 // the RenderWidgetHost's IPC message map. |
105 class CONTENT_EXPORT RenderWidgetHost : public IPC::Channel::Sender { | 106 class CONTENT_EXPORT RenderWidgetHost : public IPC::Sender { |
106 public: | 107 public: |
107 // Free all backing stores used for rendering to drop memory usage. | 108 // Free all backing stores used for rendering to drop memory usage. |
108 static void RemoveAllBackingStores(); | 109 static void RemoveAllBackingStores(); |
109 | 110 |
110 // Returns the size of all the backing stores used for rendering | 111 // Returns the size of all the backing stores used for rendering |
111 static size_t BackingStoreMemorySize(); | 112 static size_t BackingStoreMemorySize(); |
112 | 113 |
113 virtual ~RenderWidgetHost() {} | 114 virtual ~RenderWidgetHost() {} |
114 | 115 |
115 // Edit operations. | 116 // Edit operations. |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 // within content/. This method is necessary because | 278 // within content/. This method is necessary because |
278 // RenderWidgetHost is the root of a diamond inheritance pattern, so | 279 // RenderWidgetHost is the root of a diamond inheritance pattern, so |
279 // subclasses inherit it virtually, which removes our ability to | 280 // subclasses inherit it virtually, which removes our ability to |
280 // static_cast to the subclass. | 281 // static_cast to the subclass. |
281 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; | 282 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; |
282 }; | 283 }; |
283 | 284 |
284 } // namespace content | 285 } // namespace content |
285 | 286 |
286 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ | 287 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ |
OLD | NEW |