| 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 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/gfx/native_widget_types.h" | 10 #include "app/gfx/native_widget_types.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // Called when a plugin window has been destroyed, to make sure the currently | 98 // Called when a plugin window has been destroyed, to make sure the currently |
| 99 // pending moves don't try to reference it. | 99 // pending moves don't try to reference it. |
| 100 void CleanupWindowInPluginMoves(gfx::PluginWindowHandle window); | 100 void CleanupWindowInPluginMoves(gfx::PluginWindowHandle window); |
| 101 | 101 |
| 102 // Invalidates entire widget rect to generate a full repaint. | 102 // Invalidates entire widget rect to generate a full repaint. |
| 103 void GenerateFullRepaint(); | 103 void GenerateFullRepaint(); |
| 104 | 104 |
| 105 // Close the underlying WebWidget. | 105 // Close the underlying WebWidget. |
| 106 virtual void Close(); | 106 virtual void Close(); |
| 107 | 107 |
| 108 // Set owner widget who creates this popup menu. This is used to inform | |
| 109 // owner that popup menu is closed. | |
| 110 void SetPopupMenuOwnerWidget(RenderWidget* widget); | |
| 111 | |
| 112 protected: | 108 protected: |
| 113 // Friend RefCounted so that the dtor can be non-public. Using this class | 109 // Friend RefCounted so that the dtor can be non-public. Using this class |
| 114 // without ref-counting is an error. | 110 // without ref-counting is an error. |
| 115 friend class base::RefCounted<RenderWidget>; | 111 friend class base::RefCounted<RenderWidget>; |
| 116 | 112 |
| 117 RenderWidget(RenderThreadBase* render_thread, bool activatable); | 113 RenderWidget(RenderThreadBase* render_thread, bool activatable); |
| 118 virtual ~RenderWidget(); | 114 virtual ~RenderWidget(); |
| 119 | 115 |
| 120 // Initializes this view with the given opener. CompleteInit must be called | 116 // Initializes this view with the given opener. CompleteInit must be called |
| 121 // later. | 117 // later. |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 // a time period where we may have set a new window rect which has not yet | 199 // a time period where we may have set a new window rect which has not yet |
| 204 // been processed by the browser. So we maintain a pending window rect | 200 // been processed by the browser. So we maintain a pending window rect |
| 205 // size. If JS code sets the WindowRect, and then immediately calls | 201 // size. If JS code sets the WindowRect, and then immediately calls |
| 206 // GetWindowRect() we'll use this pending window rect as the size. | 202 // GetWindowRect() we'll use this pending window rect as the size. |
| 207 void SetPendingWindowRect(const WebKit::WebRect& r); | 203 void SetPendingWindowRect(const WebKit::WebRect& r); |
| 208 | 204 |
| 209 // Called by OnHandleInputEvent() to notify subclasses that a key event was | 205 // Called by OnHandleInputEvent() to notify subclasses that a key event was |
| 210 // just handled. | 206 // just handled. |
| 211 virtual void DidHandleKeyEvent() {} | 207 virtual void DidHandleKeyEvent() {} |
| 212 | 208 |
| 213 // Reset the popup menu state when it is closed. | |
| 214 void PopupMenuClosed(); | |
| 215 | |
| 216 // Routing ID that allows us to communicate to the parent browser process | 209 // Routing ID that allows us to communicate to the parent browser process |
| 217 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent. | 210 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent. |
| 218 int32 routing_id_; | 211 int32 routing_id_; |
| 219 | 212 |
| 220 // We are responsible for destroying this object via its Close method. | 213 // We are responsible for destroying this object via its Close method. |
| 221 WebKit::WebWidget* webwidget_; | 214 WebKit::WebWidget* webwidget_; |
| 222 | 215 |
| 223 // Set to the ID of the view that initiated creating this view, if any. When | 216 // Set to the ID of the view that initiated creating this view, if any. When |
| 224 // the view was initiated by the browser (the common case), this will be | 217 // the view was initiated by the browser (the common case), this will be |
| 225 // MSG_ROUTING_NONE. This is used in determining ownership when opening | 218 // MSG_ROUTING_NONE. This is used in determining ownership when opening |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 int pending_window_rect_count_; | 310 int pending_window_rect_count_; |
| 318 WebKit::WebRect pending_window_rect_; | 311 WebKit::WebRect pending_window_rect_; |
| 319 | 312 |
| 320 scoped_ptr<ViewHostMsg_ShowPopup_Params> popup_params_; | 313 scoped_ptr<ViewHostMsg_ShowPopup_Params> popup_params_; |
| 321 | 314 |
| 322 scoped_ptr<IPC::Message> pending_input_event_ack_; | 315 scoped_ptr<IPC::Message> pending_input_event_ack_; |
| 323 | 316 |
| 324 // Indicates if the next sequence of Char events should be suppressed or not. | 317 // Indicates if the next sequence of Char events should be suppressed or not. |
| 325 bool suppress_next_char_events_; | 318 bool suppress_next_char_events_; |
| 326 | 319 |
| 327 // These are for popup menu so the focus and blur events can be dispatched | |
| 328 // properly. | |
| 329 // | |
| 330 // Whether this RenderWidget is showing a popup menu widget. | |
| 331 bool showing_popup_menu_; | |
| 332 // This is for popup menu RenderWidget to remember its owner so it could | |
| 333 // inform the owner that popup menu is closed. | |
| 334 scoped_refptr<RenderWidget> popup_menu_owner_widget_; | |
| 335 | |
| 336 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 320 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
| 337 }; | 321 }; |
| 338 | 322 |
| 339 #endif // CHROME_RENDERER_RENDER_WIDGET_H_ | 323 #endif // CHROME_RENDERER_RENDER_WIDGET_H_ |
| OLD | NEW |