| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 // This mechanism is not a drop-in replacement for IPC: messages sent this way | 349 // This mechanism is not a drop-in replacement for IPC: messages sent this way |
| 350 // will not be automatically available to BrowserMessageFilter, for example. | 350 // will not be automatically available to BrowserMessageFilter, for example. |
| 351 // FIFO ordering is preserved between messages enqueued with the same | 351 // FIFO ordering is preserved between messages enqueued with the same |
| 352 // |policy|, the ordering between messages enqueued for different policies is | 352 // |policy|, the ordering between messages enqueued for different policies is |
| 353 // undefined. | 353 // undefined. |
| 354 // | 354 // |
| 355 // |msg| message to send, ownership of |msg| is transferred. | 355 // |msg| message to send, ownership of |msg| is transferred. |
| 356 // |policy| see the comment on MessageDeliveryPolicy. | 356 // |policy| see the comment on MessageDeliveryPolicy. |
| 357 void QueueMessage(IPC::Message* msg, MessageDeliveryPolicy policy); | 357 void QueueMessage(IPC::Message* msg, MessageDeliveryPolicy policy); |
| 358 | 358 |
| 359 // Check whether IME thread is being used or not. | |
| 360 bool IsUsingImeThread(); | |
| 361 | |
| 362 // Handle start and finish of IME event guard. | 359 // Handle start and finish of IME event guard. |
| 363 void OnImeEventGuardStart(ImeEventGuard* guard); | 360 void OnImeEventGuardStart(ImeEventGuard* guard); |
| 364 void OnImeEventGuardFinish(ImeEventGuard* guard); | 361 void OnImeEventGuardFinish(ImeEventGuard* guard); |
| 365 | 362 |
| 366 // Returns whether we currently should handle an IME event. | |
| 367 bool ShouldHandleImeEvent(); | |
| 368 | |
| 369 void SetPopupOriginAdjustmentsForEmulation( | 363 void SetPopupOriginAdjustmentsForEmulation( |
| 370 RenderWidgetScreenMetricsEmulator* emulator); | 364 RenderWidgetScreenMetricsEmulator* emulator); |
| 371 | 365 |
| 372 gfx::Rect AdjustValidationMessageAnchor(const gfx::Rect& anchor); | 366 gfx::Rect AdjustValidationMessageAnchor(const gfx::Rect& anchor); |
| 373 | 367 |
| 374 | |
| 375 void ScheduleComposite(); | 368 void ScheduleComposite(); |
| 376 void ScheduleCompositeWithForcedRedraw(); | 369 void ScheduleCompositeWithForcedRedraw(); |
| 377 | 370 |
| 378 // Checks if the selection bounds have been changed. If they are changed, | 371 // Checks if the selection bounds have been changed. If they are changed, |
| 379 // the new value will be sent to the browser process. | 372 // the new value will be sent to the browser process. |
| 380 void UpdateSelectionBounds(); | 373 void UpdateSelectionBounds(); |
| 381 | 374 |
| 382 virtual void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end); | 375 virtual void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end); |
| 383 | 376 |
| 384 void OnShowHostContextMenu(ContextMenuParams* params); | 377 void OnShowHostContextMenu(ContextMenuParams* params); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 void OnDragTargetDrop(const DropData& drop_data, | 523 void OnDragTargetDrop(const DropData& drop_data, |
| 531 const gfx::Point& client_pt, | 524 const gfx::Point& client_pt, |
| 532 const gfx::Point& screen_pt, | 525 const gfx::Point& screen_pt, |
| 533 int key_modifiers); | 526 int key_modifiers); |
| 534 void OnDragSourceEnded(const gfx::Point& client_point, | 527 void OnDragSourceEnded(const gfx::Point& client_point, |
| 535 const gfx::Point& screen_point, | 528 const gfx::Point& screen_point, |
| 536 blink::WebDragOperation drag_operation); | 529 blink::WebDragOperation drag_operation); |
| 537 void OnDragSourceSystemDragEnded(); | 530 void OnDragSourceSystemDragEnded(); |
| 538 | 531 |
| 539 #if defined(OS_ANDROID) | 532 #if defined(OS_ANDROID) |
| 540 // Called when we send IME event that expects an ACK. | |
| 541 void OnImeEventSentForAck(const blink::WebTextInputInfo& info); | |
| 542 | |
| 543 // Called by the browser process for every required IME acknowledgement. | |
| 544 void OnImeEventAck(); | |
| 545 | |
| 546 // Called by the browser process to update text input state. | 533 // Called by the browser process to update text input state. |
| 547 void OnRequestTextInputStateUpdate(); | 534 void OnRequestTextInputStateUpdate(); |
| 548 #endif | 535 #endif |
| 549 | 536 |
| 550 // Called by the browser process to update the cursor and composition | 537 // Called by the browser process to update the cursor and composition |
| 551 // information. | 538 // information. |
| 552 void OnRequestCompositionUpdate(bool immediate_request, bool monitor_request); | 539 void OnRequestCompositionUpdate(bool immediate_request, bool monitor_request); |
| 553 | 540 |
| 554 // Notify the compositor about a change in viewport size. This should be | 541 // Notify the compositor about a change in viewport size. This should be |
| 555 // used only with auto resize mode WebWidgets, as normal WebWidgets should | 542 // used only with auto resize mode WebWidgets, as normal WebWidgets should |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 // size. If JS code sets the WindowRect, and then immediately calls | 603 // size. If JS code sets the WindowRect, and then immediately calls |
| 617 // GetWindowRect() we'll use this pending window rect as the size. | 604 // GetWindowRect() we'll use this pending window rect as the size. |
| 618 void SetPendingWindowRect(const blink::WebRect& r); | 605 void SetPendingWindowRect(const blink::WebRect& r); |
| 619 | 606 |
| 620 // Check whether the WebWidget has any touch event handlers registered. | 607 // Check whether the WebWidget has any touch event handlers registered. |
| 621 void hasTouchEventHandlers(bool has_handlers) override; | 608 void hasTouchEventHandlers(bool has_handlers) override; |
| 622 | 609 |
| 623 // Tell the browser about the actions permitted for a new touch point. | 610 // Tell the browser about the actions permitted for a new touch point. |
| 624 void setTouchAction(blink::WebTouchAction touch_action) override; | 611 void setTouchAction(blink::WebTouchAction touch_action) override; |
| 625 | 612 |
| 626 // Called when value of focused text field gets dirty, e.g. value is modified | |
| 627 // by script, not by user input. | |
| 628 void didUpdateTextOfFocusedElementByNonUserInput() override; | |
| 629 | |
| 630 // Sends an ACK to the browser process during the next compositor frame. | 613 // Sends an ACK to the browser process during the next compositor frame. |
| 631 void OnWaitNextFrameForTests(int routing_id); | 614 void OnWaitNextFrameForTests(int routing_id); |
| 632 | 615 |
| 633 // Routing ID that allows us to communicate to the parent browser process | 616 // Routing ID that allows us to communicate to the parent browser process |
| 634 // RenderWidgetHost. | 617 // RenderWidgetHost. |
| 635 const int32_t routing_id_; | 618 const int32_t routing_id_; |
| 636 | 619 |
| 637 // Dependencies for initializing a compositor, including flags for optional | 620 // Dependencies for initializing a compositor, including flags for optional |
| 638 // features. | 621 // features. |
| 639 CompositorDependencies* const compositor_deps_; | 622 CompositorDependencies* const compositor_deps_; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 | 744 |
| 762 // The device color profile on supported platforms. | 745 // The device color profile on supported platforms. |
| 763 std::vector<char> device_color_profile_; | 746 std::vector<char> device_color_profile_; |
| 764 | 747 |
| 765 // State associated with synthetic gestures. Synthetic gestures are processed | 748 // State associated with synthetic gestures. Synthetic gestures are processed |
| 766 // in-order, so a queue is sufficient to identify the correct state for a | 749 // in-order, so a queue is sufficient to identify the correct state for a |
| 767 // completed gesture. | 750 // completed gesture. |
| 768 std::queue<SyntheticGestureCompletionCallback> | 751 std::queue<SyntheticGestureCompletionCallback> |
| 769 pending_synthetic_gesture_callbacks_; | 752 pending_synthetic_gesture_callbacks_; |
| 770 | 753 |
| 771 #if defined(OS_ANDROID) | |
| 772 // Indicates value in the focused text field is in dirty state, i.e. modified | |
| 773 // by script etc., not by user input. | |
| 774 bool text_field_is_dirty_; | |
| 775 | |
| 776 // Stores the history of text input infos from the last ACK'ed one from the | |
| 777 // current one. The size is the number of pending ACKs plus one, since we | |
| 778 // intentionally keep the last ack'd value to know what the browser is | |
| 779 // currently aware of. | |
| 780 std::deque<blink::WebTextInputInfo> text_input_info_history_; | |
| 781 #endif | |
| 782 | |
| 783 // True if the IME requests updated composition info. | 754 // True if the IME requests updated composition info. |
| 784 bool monitor_composition_info_; | 755 bool monitor_composition_info_; |
| 785 | 756 |
| 786 std::unique_ptr<RenderWidgetScreenMetricsEmulator> screen_metrics_emulator_; | 757 std::unique_ptr<RenderWidgetScreenMetricsEmulator> screen_metrics_emulator_; |
| 787 | 758 |
| 788 // Popups may be displaced when screen metrics emulation is enabled. | 759 // Popups may be displaced when screen metrics emulation is enabled. |
| 789 // These values are used to properly adjust popup position. | 760 // These values are used to properly adjust popup position. |
| 790 gfx::Point popup_view_origin_for_emulation_; | 761 gfx::Point popup_view_origin_for_emulation_; |
| 791 gfx::Point popup_screen_origin_for_emulation_; | 762 gfx::Point popup_screen_origin_for_emulation_; |
| 792 float popup_origin_scale_for_emulation_; | 763 float popup_origin_scale_for_emulation_; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 // being handled. If the current event results in starting a drag/drop | 828 // being handled. If the current event results in starting a drag/drop |
| 858 // session, this info is sent to the browser along with other drag/drop info. | 829 // session, this info is sent to the browser along with other drag/drop info. |
| 859 DragEventSourceInfo possible_drag_event_info_; | 830 DragEventSourceInfo possible_drag_event_info_; |
| 860 | 831 |
| 861 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 832 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
| 862 }; | 833 }; |
| 863 | 834 |
| 864 } // namespace content | 835 } // namespace content |
| 865 | 836 |
| 866 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 837 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
| OLD | NEW |