Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Side by Side Diff: content/renderer/render_widget.h

Issue 2121953002: Do not calculate composition bounds until IME requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 // the new value will be sent to the browser process. 344 // the new value will be sent to the browser process.
345 void UpdateSelectionBounds(); 345 void UpdateSelectionBounds();
346 346
347 virtual void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end); 347 virtual void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end);
348 348
349 void OnShowHostContextMenu(ContextMenuParams* params); 349 void OnShowHostContextMenu(ContextMenuParams* params);
350 350
351 // Checks if the composition range or composition character bounds have been 351 // Checks if the composition range or composition character bounds have been
352 // changed. If they are changed, the new value will be sent to the browser 352 // changed. If they are changed, the new value will be sent to the browser
353 // process. This method does nothing when the browser process is not able to 353 // process. This method does nothing when the browser process is not able to
354 // handle composition range and composition character bounds. 354 // handle composition range and composition character bounds. If force_update
355 void UpdateCompositionInfo(bool should_update_range); 355 // is true, render sends the latest composition info to the browser even if
356 // the composition info is not changed.
357 void UpdateCompositionInfo(bool should_update_range, bool force_update);
356 358
357 // Change the device ICC color profile while running a layout test. 359 // Change the device ICC color profile while running a layout test.
358 void SetDeviceColorProfileForTesting(const std::vector<char>& color_profile); 360 void SetDeviceColorProfileForTesting(const std::vector<char>& color_profile);
359 void ResetDeviceColorProfileForTesting(); 361 void ResetDeviceColorProfileForTesting();
360 362
361 // Indicates whether this widget has focus. 363 // Indicates whether this widget has focus.
362 bool has_focus() const { return has_focus_; } 364 bool has_focus() const { return has_focus_; }
363 365
364 MouseLockDispatcher* mouse_lock_dispatcher() { 366 MouseLockDispatcher* mouse_lock_dispatcher() {
365 return mouse_lock_dispatcher_.get(); 367 return mouse_lock_dispatcher_.get();
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 476
475 #if defined(OS_ANDROID) 477 #if defined(OS_ANDROID)
476 // Called when we send IME event that expects an ACK. 478 // Called when we send IME event that expects an ACK.
477 void OnImeEventSentForAck(const blink::WebTextInputInfo& info); 479 void OnImeEventSentForAck(const blink::WebTextInputInfo& info);
478 480
479 // Called by the browser process for every required IME acknowledgement. 481 // Called by the browser process for every required IME acknowledgement.
480 void OnImeEventAck(); 482 void OnImeEventAck();
481 483
482 // Called by the browser process to update text input state. 484 // Called by the browser process to update text input state.
483 void OnRequestTextInputStateUpdate(); 485 void OnRequestTextInputStateUpdate();
486
487 // Called by the browser process to update the cursor and composition
488 // information.
489 void OnRequestCompositionUpdate(bool immediate_request, bool monitor_request);
484 #endif 490 #endif
485 491
486 // Notify the compositor about a change in viewport size. This should be 492 // Notify the compositor about a change in viewport size. This should be
487 // used only with auto resize mode WebWidgets, as normal WebWidgets should 493 // used only with auto resize mode WebWidgets, as normal WebWidgets should
488 // go through OnResize. 494 // go through OnResize.
489 void AutoResizeCompositor(); 495 void AutoResizeCompositor();
490 496
491 virtual void SetDeviceScaleFactor(float device_scale_factor); 497 virtual void SetDeviceScaleFactor(float device_scale_factor);
492 bool SetDeviceColorProfile(const std::vector<char>& color_profile); 498 bool SetDeviceColorProfile(const std::vector<char>& color_profile);
493 499
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 #if defined(OS_ANDROID) 724 #if defined(OS_ANDROID)
719 // Indicates value in the focused text field is in dirty state, i.e. modified 725 // Indicates value in the focused text field is in dirty state, i.e. modified
720 // by script etc., not by user input. 726 // by script etc., not by user input.
721 bool text_field_is_dirty_; 727 bool text_field_is_dirty_;
722 728
723 // Stores the history of text input infos from the last ACK'ed one from the 729 // Stores the history of text input infos from the last ACK'ed one from the
724 // current one. The size is the number of pending ACKs plus one, since we 730 // current one. The size is the number of pending ACKs plus one, since we
725 // intentionally keep the last ack'd value to know what the browser is 731 // intentionally keep the last ack'd value to know what the browser is
726 // currently aware of. 732 // currently aware of.
727 std::deque<blink::WebTextInputInfo> text_input_info_history_; 733 std::deque<blink::WebTextInputInfo> text_input_info_history_;
734
735 // True if the IME requests updated composition info.
736 bool monitor_composition_info_;
728 #endif 737 #endif
729 738
730 std::unique_ptr<RenderWidgetScreenMetricsEmulator> screen_metrics_emulator_; 739 std::unique_ptr<RenderWidgetScreenMetricsEmulator> screen_metrics_emulator_;
731 740
732 // Popups may be displaced when screen metrics emulation is enabled. 741 // Popups may be displaced when screen metrics emulation is enabled.
733 // These values are used to properly adjust popup position. 742 // These values are used to properly adjust popup position.
734 gfx::Point popup_view_origin_for_emulation_; 743 gfx::Point popup_view_origin_for_emulation_;
735 gfx::Point popup_screen_origin_for_emulation_; 744 gfx::Point popup_screen_origin_for_emulation_;
736 float popup_origin_scale_for_emulation_; 745 float popup_origin_scale_for_emulation_;
737 746
(...skipping 30 matching lines...) Expand all
768 777
769 // Indicates whether this widget has focus. 778 // Indicates whether this widget has focus.
770 bool has_focus_; 779 bool has_focus_;
771 780
772 DISALLOW_COPY_AND_ASSIGN(RenderWidget); 781 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
773 }; 782 };
774 783
775 } // namespace content 784 } // namespace content
776 785
777 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ 786 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698