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

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

Issue 2029423003: OOPIF IME: Renderer Side Changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implemented WebViewImpl::getCompositionCharacterBounds Created 4 years, 6 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 namespace scheduler { 77 namespace scheduler {
78 class RenderWidgetSchedulingState; 78 class RenderWidgetSchedulingState;
79 } 79 }
80 80
81 namespace content { 81 namespace content {
82 class CompositorDependencies; 82 class CompositorDependencies;
83 class ExternalPopupMenu; 83 class ExternalPopupMenu;
84 class FrameSwapMessageQueue; 84 class FrameSwapMessageQueue;
85 class ImeEventGuard; 85 class ImeEventGuard;
86 class PepperPluginInstanceImpl;
86 class RenderFrameImpl; 87 class RenderFrameImpl;
87 class RenderFrameProxy; 88 class RenderFrameProxy;
88 class RenderWidgetCompositor; 89 class RenderWidgetCompositor;
89 class RenderWidgetOwnerDelegate; 90 class RenderWidgetOwnerDelegate;
90 class RenderWidgetScreenMetricsEmulator; 91 class RenderWidgetScreenMetricsEmulator;
91 class ResizingModeSelector; 92 class ResizingModeSelector;
92 struct ContextMenuParams; 93 struct ContextMenuParams;
93 struct DidOverscrollParams; 94 struct DidOverscrollParams;
94 struct ResizeParams; 95 struct ResizeParams;
95 96
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 // Checks if the composition range or composition character bounds have been 356 // Checks if the composition range or composition character bounds have been
356 // changed. If they are changed, the new value will be sent to the browser 357 // changed. If they are changed, the new value will be sent to the browser
357 // process. This method does nothing when the browser process is not able to 358 // process. This method does nothing when the browser process is not able to
358 // handle composition range and composition character bounds. 359 // handle composition range and composition character bounds.
359 void UpdateCompositionInfo(bool should_update_range); 360 void UpdateCompositionInfo(bool should_update_range);
360 361
361 // Change the device ICC color profile while running a layout test. 362 // Change the device ICC color profile while running a layout test.
362 void SetDeviceColorProfileForTesting(const std::vector<char>& color_profile); 363 void SetDeviceColorProfileForTesting(const std::vector<char>& color_profile);
363 void ResetDeviceColorProfileForTesting(); 364 void ResetDeviceColorProfileForTesting();
364 365
366 // RenderWidget IME-related Methods.
367 void HandleImeSetComposition(
368 const base::string16& text,
369 const std::vector<blink::WebCompositionUnderline>& underlines,
370 const gfx::Range& replacement_range,
371 int selection_start,
372 int selection_end);
373 void HandleImeConfirmComposition(const base::string16& text,
374 const gfx::Range& replacement_range,
375 bool keep_selection);
376
365 // Indicates whether this widget has focus. 377 // Indicates whether this widget has focus.
366 bool has_focus() const { return has_focus_; } 378 bool has_focus() const { return has_focus_; }
367 379
380 void set_focused_pepper_plugin(PepperPluginInstanceImpl* plugin) {
381 focused_pepper_plugin_ = plugin;
382 }
383
368 protected: 384 protected:
369 // Friend RefCounted so that the dtor can be non-public. Using this class 385 // Friend RefCounted so that the dtor can be non-public. Using this class
370 // without ref-counting is an error. 386 // without ref-counting is an error.
371 friend class base::RefCounted<RenderWidget>; 387 friend class base::RefCounted<RenderWidget>;
372 388
373 // For unit tests. 389 // For unit tests.
374 friend class RenderWidgetTest; 390 friend class RenderWidgetTest;
375 391
376 enum ResizeAck { 392 enum ResizeAck {
377 SEND_RESIZE_ACK, 393 SEND_RESIZE_ACK,
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 void OnRequestMoveAck(); 467 void OnRequestMoveAck();
452 virtual void OnImeSetComposition( 468 virtual void OnImeSetComposition(
453 const base::string16& text, 469 const base::string16& text,
454 const std::vector<blink::WebCompositionUnderline>& underlines, 470 const std::vector<blink::WebCompositionUnderline>& underlines,
455 const gfx::Range& replacement_range, 471 const gfx::Range& replacement_range,
456 int selection_start, 472 int selection_start,
457 int selection_end); 473 int selection_end);
458 virtual void OnImeConfirmComposition(const base::string16& text, 474 virtual void OnImeConfirmComposition(const base::string16& text,
459 const gfx::Range& replacement_range, 475 const gfx::Range& replacement_range,
460 bool keep_selection); 476 bool keep_selection);
477
461 // Called when the device scale factor is changed, or the layer tree is 478 // Called when the device scale factor is changed, or the layer tree is
462 // initialized. 479 // initialized.
463 virtual void OnDeviceScaleFactorChanged(); 480 virtual void OnDeviceScaleFactorChanged();
464 481
465 void OnRepaint(gfx::Size size_to_paint); 482 void OnRepaint(gfx::Size size_to_paint);
466 void OnSyntheticGestureCompleted(); 483 void OnSyntheticGestureCompleted();
467 void OnSetTextDirection(blink::WebTextDirection direction); 484 void OnSetTextDirection(blink::WebTextDirection direction);
468 void OnGetFPS(); 485 void OnGetFPS();
469 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect, 486 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect,
470 const gfx::Rect& window_screen_rect); 487 const gfx::Rect& window_screen_rect);
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 std::unique_ptr<scheduler::RenderWidgetSchedulingState> 776 std::unique_ptr<scheduler::RenderWidgetSchedulingState>
760 render_widget_scheduling_state_; 777 render_widget_scheduling_state_;
761 778
762 private: 779 private:
763 // When emulated, this returns original device scale factor. 780 // When emulated, this returns original device scale factor.
764 float GetOriginalDeviceScaleFactor() const; 781 float GetOriginalDeviceScaleFactor() const;
765 782
766 // Indicates whether this widget has focus. 783 // Indicates whether this widget has focus.
767 bool has_focus_; 784 bool has_focus_;
768 785
786 // This reference is set by the RenderFrame and is used to query the IME-
787 // related state from the plugin to later send to the browser.
788 PepperPluginInstanceImpl* focused_pepper_plugin_;
789
769 DISALLOW_COPY_AND_ASSIGN(RenderWidget); 790 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
770 }; 791 };
771 792
772 } // namespace content 793 } // namespace content
773 794
774 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ 795 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698