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