| 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_RENDERER_RENDER_WIDGET_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_WIDGET_H_ |
| 6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ | 6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 27 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
| 28 #include "third_party/WebKit/public/web/WebPopupType.h" | 28 #include "third_party/WebKit/public/web/WebPopupType.h" |
| 29 #include "third_party/WebKit/public/web/WebTextDirection.h" | 29 #include "third_party/WebKit/public/web/WebTextDirection.h" |
| 30 #include "third_party/WebKit/public/web/WebTextInputInfo.h" | 30 #include "third_party/WebKit/public/web/WebTextInputInfo.h" |
| 31 #include "third_party/WebKit/public/web/WebTouchAction.h" | 31 #include "third_party/WebKit/public/web/WebTouchAction.h" |
| 32 #include "third_party/WebKit/public/web/WebWidget.h" | 32 #include "third_party/WebKit/public/web/WebWidget.h" |
| 33 #include "third_party/WebKit/public/web/WebWidgetClient.h" | 33 #include "third_party/WebKit/public/web/WebWidgetClient.h" |
| 34 #include "third_party/skia/include/core/SkBitmap.h" | 34 #include "third_party/skia/include/core/SkBitmap.h" |
| 35 #include "ui/base/ime/text_input_mode.h" | 35 #include "ui/base/ime/text_input_mode.h" |
| 36 #include "ui/base/ime/text_input_type.h" | 36 #include "ui/base/ime/text_input_type.h" |
| 37 #include "ui/base/ui_base_types.h" |
| 37 #include "ui/gfx/native_widget_types.h" | 38 #include "ui/gfx/native_widget_types.h" |
| 38 #include "ui/gfx/range/range.h" | 39 #include "ui/gfx/range/range.h" |
| 39 #include "ui/gfx/rect.h" | 40 #include "ui/gfx/rect.h" |
| 40 #include "ui/gfx/vector2d.h" | 41 #include "ui/gfx/vector2d.h" |
| 41 #include "ui/gfx/vector2d_f.h" | 42 #include "ui/gfx/vector2d_f.h" |
| 42 #include "ui/surface/transport_dib.h" | 43 #include "ui/surface/transport_dib.h" |
| 43 #include "webkit/common/cursors/webcursor.h" | 44 #include "webkit/common/cursors/webcursor.h" |
| 44 | 45 |
| 45 struct ViewHostMsg_UpdateRect_Params; | 46 struct ViewHostMsg_UpdateRect_Params; |
| 46 struct ViewMsg_Resize_Params; | 47 struct ViewMsg_Resize_Params; |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 void OnSwapBuffersAborted(); | 242 void OnSwapBuffersAborted(); |
| 242 | 243 |
| 243 // Checks if the text input state and compose inline mode have been changed. | 244 // Checks if the text input state and compose inline mode have been changed. |
| 244 // If they are changed, the new value will be sent to the browser process. | 245 // If they are changed, the new value will be sent to the browser process. |
| 245 void UpdateTextInputType(); | 246 void UpdateTextInputType(); |
| 246 | 247 |
| 247 // Checks if the selection bounds have been changed. If they are changed, | 248 // Checks if the selection bounds have been changed. If they are changed, |
| 248 // the new value will be sent to the browser process. | 249 // the new value will be sent to the browser process. |
| 249 void UpdateSelectionBounds(); | 250 void UpdateSelectionBounds(); |
| 250 | 251 |
| 252 void OnShowHostContextMenu(ContextMenuParams* params); |
| 251 | 253 |
| 252 #if defined(OS_MACOSX) || defined(OS_WIN) || defined(USE_AURA) | 254 #if defined(OS_MACOSX) || defined(OS_WIN) || defined(USE_AURA) |
| 253 // Checks if the composition range or composition character bounds have been | 255 // Checks if the composition range or composition character bounds have been |
| 254 // changed. If they are changed, the new value will be sent to the browser | 256 // changed. If they are changed, the new value will be sent to the browser |
| 255 // process. | 257 // process. |
| 256 void UpdateCompositionInfo(bool should_update_range); | 258 void UpdateCompositionInfo(bool should_update_range); |
| 257 #endif | 259 #endif |
| 258 | 260 |
| 259 // Temporary for debugging purposes... | 261 // Temporary for debugging purposes... |
| 260 bool closing() const { return closing_; } | 262 bool closing() const { return closing_; } |
| 261 | 263 |
| 264 ui::MenuSourceType context_menu_source_type() { |
| 265 return context_menu_source_type_; } |
| 266 gfx::Point touch_editing_context_menu_location() { |
| 267 return touch_editing_context_menu_location_; |
| 268 } |
| 269 |
| 262 protected: | 270 protected: |
| 263 // Friend RefCounted so that the dtor can be non-public. Using this class | 271 // Friend RefCounted so that the dtor can be non-public. Using this class |
| 264 // without ref-counting is an error. | 272 // without ref-counting is an error. |
| 265 friend class base::RefCounted<RenderWidget>; | 273 friend class base::RefCounted<RenderWidget>; |
| 266 // For unit tests. | 274 // For unit tests. |
| 267 friend class RenderWidgetTest; | 275 friend class RenderWidgetTest; |
| 268 | 276 |
| 269 enum ResizeAck { | 277 enum ResizeAck { |
| 270 SEND_RESIZE_ACK, | 278 SEND_RESIZE_ACK, |
| 271 NO_RESIZE_ACK, | 279 NO_RESIZE_ACK, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 bool is_fullscreen, | 337 bool is_fullscreen, |
| 330 ResizeAck resize_ack); | 338 ResizeAck resize_ack); |
| 331 // Used to force the size of a window when running layout tests. | 339 // Used to force the size of a window when running layout tests. |
| 332 void ResizeSynchronously(const gfx::Rect& new_position); | 340 void ResizeSynchronously(const gfx::Rect& new_position); |
| 333 virtual void SetScreenMetricsEmulationParameters( | 341 virtual void SetScreenMetricsEmulationParameters( |
| 334 float device_scale_factor, | 342 float device_scale_factor, |
| 335 const gfx::Point& root_layer_offset, | 343 const gfx::Point& root_layer_offset, |
| 336 float root_layer_scale); | 344 float root_layer_scale); |
| 337 void SetExternalPopupOriginAdjustmentsForEmulation( | 345 void SetExternalPopupOriginAdjustmentsForEmulation( |
| 338 ExternalPopupMenu* popup, ScreenMetricsEmulator* emulator); | 346 ExternalPopupMenu* popup, ScreenMetricsEmulator* emulator); |
| 339 virtual void OnShowHostContextMenu(ContextMenuParams* params); | |
| 340 | 347 |
| 341 // RenderWidget IPC message handlers | 348 // RenderWidget IPC message handlers |
| 342 void OnHandleInputEvent(const blink::WebInputEvent* event, | 349 void OnHandleInputEvent(const blink::WebInputEvent* event, |
| 343 ui::LatencyInfo latency_info, | 350 ui::LatencyInfo latency_info, |
| 344 bool keyboard_shortcut); | 351 bool keyboard_shortcut); |
| 345 void OnCursorVisibilityChange(bool is_visible); | 352 void OnCursorVisibilityChange(bool is_visible); |
| 346 void OnMouseCaptureLost(); | 353 void OnMouseCaptureLost(); |
| 347 virtual void OnSetFocus(bool enable); | 354 virtual void OnSetFocus(bool enable); |
| 348 void OnClose(); | 355 void OnClose(); |
| 349 void OnCreatingNewAck(); | 356 void OnCreatingNewAck(); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 // Called by OnHandleInputEvent() to notify subclasses that a key event was | 519 // Called by OnHandleInputEvent() to notify subclasses that a key event was |
| 513 // just handled. | 520 // just handled. |
| 514 virtual void DidHandleKeyEvent() {} | 521 virtual void DidHandleKeyEvent() {} |
| 515 | 522 |
| 516 // Called by OnHandleInputEvent() to notify subclasses that a mouse event is | 523 // Called by OnHandleInputEvent() to notify subclasses that a mouse event is |
| 517 // about to be handled. | 524 // about to be handled. |
| 518 // Returns true if no further handling is needed. In that case, the event | 525 // Returns true if no further handling is needed. In that case, the event |
| 519 // won't be sent to WebKit or trigger DidHandleMouseEvent(). | 526 // won't be sent to WebKit or trigger DidHandleMouseEvent(). |
| 520 virtual bool WillHandleMouseEvent(const blink::WebMouseEvent& event); | 527 virtual bool WillHandleMouseEvent(const blink::WebMouseEvent& event); |
| 521 | 528 |
| 522 // Called by OnHandleInputEvent() to notify subclasses that a key event is | |
| 523 // about to be handled. | |
| 524 // Returns true if no further handling is needed. In that case, the event | |
| 525 // won't be sent to WebKit or trigger DidHandleKeyEvent(). | |
| 526 virtual bool WillHandleKeyEvent(const blink::WebKeyboardEvent& event); | |
| 527 | |
| 528 // Called by OnHandleInputEvent() to notify subclasses that a gesture event is | 529 // Called by OnHandleInputEvent() to notify subclasses that a gesture event is |
| 529 // about to be handled. | 530 // about to be handled. |
| 530 // Returns true if no further handling is needed. In that case, the event | 531 // Returns true if no further handling is needed. In that case, the event |
| 531 // won't be sent to WebKit. | 532 // won't be sent to WebKit. |
| 532 virtual bool WillHandleGestureEvent(const blink::WebGestureEvent& event); | 533 virtual bool WillHandleGestureEvent(const blink::WebGestureEvent& event); |
| 533 | 534 |
| 534 // Called by OnHandleInputEvent() to notify subclasses that a mouse event was | 535 // Called by OnHandleInputEvent() to notify subclasses that a mouse event was |
| 535 // just handled. | 536 // just handled. |
| 536 virtual void DidHandleMouseEvent(const blink::WebMouseEvent& event) {} | 537 virtual void DidHandleMouseEvent(const blink::WebMouseEvent& event) {} |
| 537 | 538 |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 gfx::Point popup_view_origin_for_emulation_; | 797 gfx::Point popup_view_origin_for_emulation_; |
| 797 gfx::Point popup_screen_origin_for_emulation_; | 798 gfx::Point popup_screen_origin_for_emulation_; |
| 798 float popup_origin_scale_for_emulation_; | 799 float popup_origin_scale_for_emulation_; |
| 799 | 800 |
| 800 scoped_ptr<ResizingModeSelector> resizing_mode_selector_; | 801 scoped_ptr<ResizingModeSelector> resizing_mode_selector_; |
| 801 | 802 |
| 802 // A list of swapped out RenderFrames that need to be notified | 803 // A list of swapped out RenderFrames that need to be notified |
| 803 // of compositing-related events (e.g. DidCommitCompositorFrame). | 804 // of compositing-related events (e.g. DidCommitCompositorFrame). |
| 804 ObserverList<RenderFrameImpl> swapped_out_frames_; | 805 ObserverList<RenderFrameImpl> swapped_out_frames_; |
| 805 | 806 |
| 807 ui::MenuSourceType context_menu_source_type_; |
| 808 gfx::Point touch_editing_context_menu_location_; |
| 809 |
| 806 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 810 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
| 807 }; | 811 }; |
| 808 | 812 |
| 809 } // namespace content | 813 } // namespace content |
| 810 | 814 |
| 811 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 815 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
| OLD | NEW |