| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 // } | 274 // } |
| 275 // Once we cancel updating the text direction, we have to ignore all | 275 // Once we cancel updating the text direction, we have to ignore all |
| 276 // succeeding UpdateTextDirection() requests until calling | 276 // succeeding UpdateTextDirection() requests until calling |
| 277 // NotifyTextDirection(). (We may receive keydown events even after we | 277 // NotifyTextDirection(). (We may receive keydown events even after we |
| 278 // canceled updating the text direction because of auto-repeat.) | 278 // canceled updating the text direction because of auto-repeat.) |
| 279 // Note: we cannot undo this change for compatibility with Firefox and IE. | 279 // Note: we cannot undo this change for compatibility with Firefox and IE. |
| 280 void UpdateTextDirection(WebTextDirection direction); | 280 void UpdateTextDirection(WebTextDirection direction); |
| 281 void CancelUpdateTextDirection(); | 281 void CancelUpdateTextDirection(); |
| 282 void NotifyTextDirection(); | 282 void NotifyTextDirection(); |
| 283 | 283 |
| 284 // Notifies the renderer whether or not the IME attached to this process is |
| 285 // activated. |
| 286 // When the IME is activated, a renderer process sends IPC messages to notify |
| 287 // the status of its composition node. (This message is mainly used for |
| 288 // notifying the position of the input cursor so that the browser can |
| 289 // display IME windows under the cursor.) |
| 290 void ImeSetInputMode(bool activate); |
| 291 |
| 292 // Update the composition node of the renderer (or WebKit). |
| 293 // WebKit has a special node (a composition node) for IMEs to change its text |
| 294 // without affecting any other DOM nodes. When the IME (attached to the |
| 295 // browser) updates its text, the browser sends IPC messages to update the |
| 296 // composition node of the renderer. |
| 297 // (Read the comments of each function for its detail.) |
| 298 |
| 299 // Sets the text of the composition node. |
| 300 // This function can also update the cursor position and mark the specified |
| 301 // range in the composition node. |
| 302 // A browser should call this function: |
| 303 // * when it receives a WM_IME_COMPOSITION message with a GCS_COMPSTR flag |
| 304 // (on Windows); |
| 305 // * when it receives a "preedit_changed" signal of GtkIMContext (on Linux); |
| 306 // * when markedText of NSTextInput is called (on Mac). |
| 307 void ImeSetComposition(const std::wstring& ime_string, |
| 308 int cursor_position, |
| 309 int target_start, |
| 310 int target_end); |
| 311 |
| 312 // Finishes an ongoing composition with the specified text. |
| 313 // A browser should call this function: |
| 314 // * when it receives a WM_IME_COMPOSITION message with a GCS_RESULTSTR flag |
| 315 // (on Windows); |
| 316 // * when it receives a "commit" signal of GtkIMContext (on Linux); |
| 317 // * when insertText of NSTextInput is called (on Mac). |
| 318 void ImeConfirmComposition(const std::wstring& ime_string); |
| 319 |
| 320 // Cancels an ongoing composition. |
| 321 void ImeCancelComposition(); |
| 322 |
| 284 // This is for derived classes to give us access to the resizer rect. | 323 // This is for derived classes to give us access to the resizer rect. |
| 285 // And to also expose it to the RenderWidgetHostView. | 324 // And to also expose it to the RenderWidgetHostView. |
| 286 virtual gfx::Rect GetRootWindowResizerRect() const; | 325 virtual gfx::Rect GetRootWindowResizerRect() const; |
| 287 | 326 |
| 288 protected: | 327 protected: |
| 289 // Internal implementation of the public Forward*Event() methods. | 328 // Internal implementation of the public Forward*Event() methods. |
| 290 void ForwardInputEvent( | 329 void ForwardInputEvent( |
| 291 const WebKit::WebInputEvent& input_event, int event_size); | 330 const WebKit::WebInputEvent& input_event, int event_size); |
| 292 | 331 |
| 293 // Called when we receive a notification indicating that the renderer | 332 // Called when we receive a notification indicating that the renderer |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 | 498 |
| 460 // Set when we cancel updating the text direction. | 499 // Set when we cancel updating the text direction. |
| 461 // This flag also ignores succeeding update requests until we call | 500 // This flag also ignores succeeding update requests until we call |
| 462 // NotifyTextDirection(). | 501 // NotifyTextDirection(). |
| 463 bool text_direction_canceled_; | 502 bool text_direction_canceled_; |
| 464 | 503 |
| 465 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); | 504 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); |
| 466 }; | 505 }; |
| 467 | 506 |
| 468 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 507 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
| OLD | NEW |