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