| 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_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 // (on Windows); | 361 // (on Windows); |
| 362 // * when it receives a "preedit_changed" signal of GtkIMContext (on Linux); | 362 // * when it receives a "preedit_changed" signal of GtkIMContext (on Linux); |
| 363 // * when markedText of NSTextInput is called (on Mac). | 363 // * when markedText of NSTextInput is called (on Mac). |
| 364 void ImeSetComposition( | 364 void ImeSetComposition( |
| 365 const base::string16& text, | 365 const base::string16& text, |
| 366 const std::vector<blink::WebCompositionUnderline>& underlines, | 366 const std::vector<blink::WebCompositionUnderline>& underlines, |
| 367 const gfx::Range& replacement_range, | 367 const gfx::Range& replacement_range, |
| 368 int selection_start, | 368 int selection_start, |
| 369 int selection_end); | 369 int selection_end); |
| 370 | 370 |
| 371 // Finishes an ongoing composition with the specified text. | 371 // Deletes the ongoing composition if any, inserts the specified text, and |
| 372 // A browser should call this function: | 372 // moves the cursor. |
| 373 // A browser should call this function or ImeFinishComposingText: |
| 373 // * when it receives a WM_IME_COMPOSITION message with a GCS_RESULTSTR flag | 374 // * when it receives a WM_IME_COMPOSITION message with a GCS_RESULTSTR flag |
| 374 // (on Windows); | 375 // (on Windows); |
| 375 // * when it receives a "commit" signal of GtkIMContext (on Linux); | 376 // * when it receives a "commit" signal of GtkIMContext (on Linux); |
| 376 // * when insertText of NSTextInput is called (on Mac). | 377 // * when insertText of NSTextInput is called (on Mac). |
| 377 void ImeConfirmComposition(const base::string16& text, | 378 void ImeCommitText(const base::string16& text, |
| 378 const gfx::Range& replacement_range, | 379 const gfx::Range& replacement_range, |
| 379 bool keep_selection); | 380 int relative_cursor_pos); |
| 381 |
| 382 // Finishes an ongoing composition. |
| 383 // A browser should call this function or ImeCommitText: |
| 384 // * when it receives a WM_IME_COMPOSITION message with a GCS_RESULTSTR flag |
| 385 // (on Windows); |
| 386 // * when it receives a "commit" signal of GtkIMContext (on Linux); |
| 387 // * when insertText of NSTextInput is called (on Mac). |
| 388 void ImeFinishComposingText(bool keep_selection); |
| 380 | 389 |
| 381 // Cancels an ongoing composition. | 390 // Cancels an ongoing composition. |
| 382 void ImeCancelComposition(); | 391 void ImeCancelComposition(); |
| 383 | 392 |
| 384 bool ignore_input_events() const { | 393 bool ignore_input_events() const { |
| 385 return ignore_input_events_; | 394 return ignore_input_events_; |
| 386 } | 395 } |
| 387 | 396 |
| 388 // Whether forwarded WebInputEvents should be dropped. | 397 // Whether forwarded WebInputEvents should be dropped. |
| 389 bool ShouldDropInputEvents() const; | 398 bool ShouldDropInputEvents() const; |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 #endif | 846 #endif |
| 838 | 847 |
| 839 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 848 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
| 840 | 849 |
| 841 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 850 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 842 }; | 851 }; |
| 843 | 852 |
| 844 } // namespace content | 853 } // namespace content |
| 845 | 854 |
| 846 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 855 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |