OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_RENDERER_RENDER_WIDGET_H_ | 5 #ifndef CHROME_RENDERER_RENDER_WIDGET_H_ |
6 #define CHROME_RENDERER_RENDER_WIDGET_H_ | 6 #define CHROME_RENDERER_RENDER_WIDGET_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 namespace skia { | 39 namespace skia { |
40 class PlatformCanvas; | 40 class PlatformCanvas; |
41 } | 41 } |
42 | 42 |
43 namespace WebKit { | 43 namespace WebKit { |
44 class WebMouseEvent; | 44 class WebMouseEvent; |
45 class WebWidget; | 45 class WebWidget; |
46 struct WebPopupMenuInfo; | 46 struct WebPopupMenuInfo; |
47 } | 47 } |
48 | 48 |
49 namespace webkit_glue { | 49 namespace webkit { |
| 50 namespace npapi { |
50 struct WebPluginGeometry; | 51 struct WebPluginGeometry; |
51 } | 52 } |
| 53 } |
52 | 54 |
53 // RenderWidget provides a communication bridge between a WebWidget and | 55 // RenderWidget provides a communication bridge between a WebWidget and |
54 // a RenderWidgetHost, the latter of which lives in a different process. | 56 // a RenderWidgetHost, the latter of which lives in a different process. |
55 class RenderWidget : public IPC::Channel::Listener, | 57 class RenderWidget : public IPC::Channel::Listener, |
56 public IPC::Message::Sender, | 58 public IPC::Message::Sender, |
57 virtual public WebKit::WebWidgetClient, | 59 virtual public WebKit::WebWidgetClient, |
58 public base::RefCounted<RenderWidget> { | 60 public base::RefCounted<RenderWidget> { |
59 public: | 61 public: |
60 // Creates a new RenderWidget. The opener_id is the routing ID of the | 62 // Creates a new RenderWidget. The opener_id is the routing ID of the |
61 // RenderView that this widget lives inside. The render_thread is any | 63 // RenderView that this widget lives inside. The render_thread is any |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 virtual void runModal() {} | 106 virtual void runModal() {} |
105 virtual WebKit::WebRect windowRect(); | 107 virtual WebKit::WebRect windowRect(); |
106 virtual void setWindowRect(const WebKit::WebRect&); | 108 virtual void setWindowRect(const WebKit::WebRect&); |
107 virtual WebKit::WebRect windowResizerRect(); | 109 virtual WebKit::WebRect windowResizerRect(); |
108 virtual WebKit::WebRect rootWindowRect(); | 110 virtual WebKit::WebRect rootWindowRect(); |
109 virtual WebKit::WebScreenInfo screenInfo(); | 111 virtual WebKit::WebScreenInfo screenInfo(); |
110 virtual void resetInputMethod(); | 112 virtual void resetInputMethod(); |
111 | 113 |
112 // Called when a plugin is moved. These events are queued up and sent with | 114 // Called when a plugin is moved. These events are queued up and sent with |
113 // the next paint or scroll message to the host. | 115 // the next paint or scroll message to the host. |
114 void SchedulePluginMove(const webkit_glue::WebPluginGeometry& move); | 116 void SchedulePluginMove(const webkit::npapi::WebPluginGeometry& move); |
115 | 117 |
116 // Called when a plugin window has been destroyed, to make sure the currently | 118 // Called when a plugin window has been destroyed, to make sure the currently |
117 // pending moves don't try to reference it. | 119 // pending moves don't try to reference it. |
118 void CleanupWindowInPluginMoves(gfx::PluginWindowHandle window); | 120 void CleanupWindowInPluginMoves(gfx::PluginWindowHandle window); |
119 | 121 |
120 // Close the underlying WebWidget. | 122 // Close the underlying WebWidget. |
121 virtual void Close(); | 123 virtual void Close(); |
122 | 124 |
123 protected: | 125 protected: |
124 // Friend RefCounted so that the dtor can be non-public. Using this class | 126 // Friend RefCounted so that the dtor can be non-public. Using this class |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 // Stores the current text input type of |webwidget_|. | 332 // Stores the current text input type of |webwidget_|. |
331 WebKit::WebTextInputType text_input_type_; | 333 WebKit::WebTextInputType text_input_type_; |
332 | 334 |
333 // Stores the current caret bounds of input focus. | 335 // Stores the current caret bounds of input focus. |
334 WebKit::WebRect caret_bounds_; | 336 WebKit::WebRect caret_bounds_; |
335 | 337 |
336 // The kind of popup this widget represents, NONE if not a popup. | 338 // The kind of popup this widget represents, NONE if not a popup. |
337 WebKit::WebPopupType popup_type_; | 339 WebKit::WebPopupType popup_type_; |
338 | 340 |
339 // Holds all the needed plugin window moves for a scroll. | 341 // Holds all the needed plugin window moves for a scroll. |
340 typedef std::vector<webkit_glue::WebPluginGeometry> WebPluginGeometryVector; | 342 typedef std::vector<webkit::npapi::WebPluginGeometry> WebPluginGeometryVector; |
341 WebPluginGeometryVector plugin_window_moves_; | 343 WebPluginGeometryVector plugin_window_moves_; |
342 | 344 |
343 // A custom background for the widget. | 345 // A custom background for the widget. |
344 SkBitmap background_; | 346 SkBitmap background_; |
345 | 347 |
346 // While we are waiting for the browser to update window sizes, | 348 // While we are waiting for the browser to update window sizes, |
347 // we track the pending size temporarily. | 349 // we track the pending size temporarily. |
348 int pending_window_rect_count_; | 350 int pending_window_rect_count_; |
349 WebKit::WebRect pending_window_rect_; | 351 WebKit::WebRect pending_window_rect_; |
350 | 352 |
351 scoped_ptr<IPC::Message> pending_input_event_ack_; | 353 scoped_ptr<IPC::Message> pending_input_event_ack_; |
352 | 354 |
353 // Indicates if the next sequence of Char events should be suppressed or not. | 355 // Indicates if the next sequence of Char events should be suppressed or not. |
354 bool suppress_next_char_events_; | 356 bool suppress_next_char_events_; |
355 | 357 |
356 // Set to true if painting to the window is handled by the accelerated | 358 // Set to true if painting to the window is handled by the accelerated |
357 // compositor. | 359 // compositor. |
358 bool is_accelerated_compositing_active_; | 360 bool is_accelerated_compositing_active_; |
359 | 361 |
360 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 362 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
361 }; | 363 }; |
362 | 364 |
363 #endif // CHROME_RENDERER_RENDER_WIDGET_H_ | 365 #endif // CHROME_RENDERER_RENDER_WIDGET_H_ |
OLD | NEW |