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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 | 400 |
401 // When emulated, this returns original device scale factor. | 401 // When emulated, this returns original device scale factor. |
402 float GetOriginalDeviceScaleFactor() const; | 402 float GetOriginalDeviceScaleFactor() const; |
403 | 403 |
404 protected: | 404 protected: |
405 // Friend RefCounted so that the dtor can be non-public. Using this class | 405 // Friend RefCounted so that the dtor can be non-public. Using this class |
406 // without ref-counting is an error. | 406 // without ref-counting is an error. |
407 friend class base::RefCounted<RenderWidget>; | 407 friend class base::RefCounted<RenderWidget>; |
408 | 408 |
409 // For unit tests. | 409 // For unit tests. |
| 410 friend class RenderViewImplTest; |
410 friend class RenderWidgetTest; | 411 friend class RenderWidgetTest; |
411 | 412 |
412 enum ResizeAck { | 413 enum ResizeAck { |
413 SEND_RESIZE_ACK, | 414 SEND_RESIZE_ACK, |
414 NO_RESIZE_ACK, | 415 NO_RESIZE_ACK, |
415 }; | 416 }; |
416 | 417 |
417 RenderWidget(CompositorDependencies* compositor_deps, | 418 RenderWidget(CompositorDependencies* compositor_deps, |
418 blink::WebPopupType popup_type, | 419 blink::WebPopupType popup_type, |
419 const ScreenInfo& screen_info, | 420 const ScreenInfo& screen_info, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 virtual void OnResize(const ResizeParams& params); | 478 virtual void OnResize(const ResizeParams& params); |
478 void OnEnableDeviceEmulation(const blink::WebDeviceEmulationParams& params); | 479 void OnEnableDeviceEmulation(const blink::WebDeviceEmulationParams& params); |
479 void OnDisableDeviceEmulation(); | 480 void OnDisableDeviceEmulation(); |
480 void OnChangeResizeRect(const gfx::Rect& resizer_rect); | 481 void OnChangeResizeRect(const gfx::Rect& resizer_rect); |
481 virtual void OnWasHidden(); | 482 virtual void OnWasHidden(); |
482 virtual void OnWasShown(bool needs_repainting, | 483 virtual void OnWasShown(bool needs_repainting, |
483 const ui::LatencyInfo& latency_info); | 484 const ui::LatencyInfo& latency_info); |
484 void OnCreateVideoAck(int32_t video_id); | 485 void OnCreateVideoAck(int32_t video_id); |
485 void OnUpdateVideoAck(int32_t video_id); | 486 void OnUpdateVideoAck(int32_t video_id); |
486 void OnRequestMoveAck(); | 487 void OnRequestMoveAck(); |
487 virtual void OnImeSetComposition( | 488 |
| 489 // IME-related methods. |
| 490 void OnImeSetComposition( |
488 const base::string16& text, | 491 const base::string16& text, |
489 const std::vector<blink::WebCompositionUnderline>& underlines, | 492 const std::vector<blink::WebCompositionUnderline>& underlines, |
490 const gfx::Range& replacement_range, | 493 const gfx::Range& replacement_range, |
491 int selection_start, | 494 int selection_start, |
492 int selection_end); | 495 int selection_end); |
493 virtual void OnImeConfirmComposition(const base::string16& text, | 496 void OnImeConfirmComposition(const base::string16& text, |
494 const gfx::Range& replacement_range, | 497 const gfx::Range& replacement_range, |
495 bool keep_selection); | 498 bool keep_selection); |
| 499 void OnImeExtendSelectionAndDelete(int before, int after); |
| 500 void OnImeSetEditableSelectionOffsets(int start, int end); |
| 501 void OnImeSetCompositionFromExistingText( |
| 502 int start, int end, |
| 503 const std::vector<blink::WebCompositionUnderline>& underlines); |
| 504 void OnImeBatchEdit(const std::vector<IPC::Message>& messages); |
| 505 // Called by the browser process to update the cursor and composition |
| 506 // information. |
| 507 void OnImeRequestCompositionUpdate(bool immediate_request, |
| 508 bool monitor_request); |
| 509 |
496 // Called when the device scale factor is changed, or the layer tree is | 510 // Called when the device scale factor is changed, or the layer tree is |
497 // initialized. | 511 // initialized. |
498 virtual void OnDeviceScaleFactorChanged(); | 512 virtual void OnDeviceScaleFactorChanged(); |
499 | 513 |
500 void OnRepaint(gfx::Size size_to_paint); | 514 void OnRepaint(gfx::Size size_to_paint); |
501 void OnSyntheticGestureCompleted(); | 515 void OnSyntheticGestureCompleted(); |
502 void OnSetTextDirection(blink::WebTextDirection direction); | 516 void OnSetTextDirection(blink::WebTextDirection direction); |
503 void OnGetFPS(); | 517 void OnGetFPS(); |
504 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect, | 518 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect, |
505 const gfx::Rect& window_screen_rect); | 519 const gfx::Rect& window_screen_rect); |
506 void OnUpdateWindowScreenRect(const gfx::Rect& window_screen_rect); | 520 void OnUpdateWindowScreenRect(const gfx::Rect& window_screen_rect); |
507 void OnShowImeIfNeeded(); | 521 void OnShowImeIfNeeded(); |
508 void OnSetSurfaceClientId(uint32_t surface_id_namespace); | 522 void OnSetSurfaceClientId(uint32_t surface_id_namespace); |
509 void OnHandleCompositorProto(const std::vector<uint8_t>& proto); | 523 void OnHandleCompositorProto(const std::vector<uint8_t>& proto); |
510 | 524 |
511 #if defined(OS_ANDROID) | 525 #if defined(OS_ANDROID) |
512 // Called when we send IME event that expects an ACK. | 526 // Called when we send IME event that expects an ACK. |
513 void OnImeEventSentForAck(const blink::WebTextInputInfo& info); | 527 void OnImeEventSentForAck(const blink::WebTextInputInfo& info); |
514 | 528 |
515 // Called by the browser process for every required IME acknowledgement. | 529 // Called by the browser process for every required IME acknowledgement. |
516 void OnImeEventAck(); | 530 void OnImeEventAck(); |
517 | 531 |
518 // Called by the browser process to update text input state. | 532 // Called by the browser process to update text input state. |
519 void OnRequestTextInputStateUpdate(); | 533 void OnImeRequestTextInputStateUpdate(); |
520 #endif | 534 #endif |
521 | 535 |
522 // Called by the browser process to update the cursor and composition | |
523 // information. | |
524 void OnRequestCompositionUpdate(bool immediate_request, bool monitor_request); | |
525 | |
526 // Notify the compositor about a change in viewport size. This should be | 536 // Notify the compositor about a change in viewport size. This should be |
527 // used only with auto resize mode WebWidgets, as normal WebWidgets should | 537 // used only with auto resize mode WebWidgets, as normal WebWidgets should |
528 // go through OnResize. | 538 // go through OnResize. |
529 void AutoResizeCompositor(); | 539 void AutoResizeCompositor(); |
530 | 540 |
531 virtual void OnSetDeviceScaleFactor(float device_scale_factor); | 541 virtual void OnSetDeviceScaleFactor(float device_scale_factor); |
532 bool SetDeviceColorProfile(const std::vector<char>& color_profile); | 542 bool SetDeviceColorProfile(const std::vector<char>& color_profile); |
533 | 543 |
534 virtual void OnOrientationChange(); | 544 virtual void OnOrientationChange(); |
535 | 545 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 // This reference is set by the RenderFrame and is used to query the IME- | 819 // This reference is set by the RenderFrame and is used to query the IME- |
810 // related state from the plugin to later send to the browser. | 820 // related state from the plugin to later send to the browser. |
811 PepperPluginInstanceImpl* focused_pepper_plugin_; | 821 PepperPluginInstanceImpl* focused_pepper_plugin_; |
812 | 822 |
813 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 823 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
814 }; | 824 }; |
815 | 825 |
816 } // namespace content | 826 } // namespace content |
817 | 827 |
818 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 828 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
OLD | NEW |