| 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 <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 | 284 |
| 285 // |show_ime| should be SHOW_IME_IF_NEEDED iff the update may cause the ime to | 285 // |show_ime| should be SHOW_IME_IF_NEEDED iff the update may cause the ime to |
| 286 // be displayed, e.g. after a tap on an input field on mobile. | 286 // be displayed, e.g. after a tap on an input field on mobile. |
| 287 // |change_source| should be FROM_NON_IME when the renderer has to wait for | 287 // |change_source| should be FROM_NON_IME when the renderer has to wait for |
| 288 // the browser to acknowledge the change before the renderer handles any more | 288 // the browser to acknowledge the change before the renderer handles any more |
| 289 // IME events. This is when the text change did not originate from the IME in | 289 // IME events. This is when the text change did not originate from the IME in |
| 290 // the browser side, such as changes by JavaScript or autofill. | 290 // the browser side, such as changes by JavaScript or autofill. |
| 291 void UpdateTextInputState(ShowIme show_ime, ChangeSource change_source); | 291 void UpdateTextInputState(ShowIme show_ime, ChangeSource change_source); |
| 292 #endif | 292 #endif |
| 293 | 293 |
| 294 #if defined(OS_MACOSX) || defined(USE_AURA) || defined(OS_ANDROID) | |
| 295 // Checks if the composition range or composition character bounds have been | 294 // Checks if the composition range or composition character bounds have been |
| 296 // changed. If they are changed, the new value will be sent to the browser | 295 // changed. If they are changed, the new value will be sent to the browser |
| 297 // process. This method does nothing when the browser process is not able to | 296 // process. This method does nothing when the browser process is not able to |
| 298 // handle composition range and composition character bounds. | 297 // handle composition range and composition character bounds. |
| 299 void UpdateCompositionInfo(bool should_update_range); | 298 void UpdateCompositionInfo(bool should_update_range); |
| 300 #endif | |
| 301 | 299 |
| 302 #if defined(OS_ANDROID) | 300 #if defined(OS_ANDROID) |
| 303 void DidChangeBodyBackgroundColor(SkColor bg_color); | 301 void DidChangeBodyBackgroundColor(SkColor bg_color); |
| 304 bool DoesRecordFullLayer() const; | 302 bool DoesRecordFullLayer() const; |
| 305 #endif | 303 #endif |
| 306 | 304 |
| 307 protected: | 305 protected: |
| 308 // Friend RefCounted so that the dtor can be non-public. Using this class | 306 // Friend RefCounted so that the dtor can be non-public. Using this class |
| 309 // without ref-counting is an error. | 307 // without ref-counting is an error. |
| 310 friend class base::RefCounted<RenderWidget>; | 308 friend class base::RefCounted<RenderWidget>; |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter, | 466 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter, |
| 469 bool commit_requested, | 467 bool commit_requested, |
| 470 int source_frame_number); | 468 int source_frame_number); |
| 471 | 469 |
| 472 // Override point to obtain that the current input method state and caret | 470 // Override point to obtain that the current input method state and caret |
| 473 // position. | 471 // position. |
| 474 virtual ui::TextInputType GetTextInputType(); | 472 virtual ui::TextInputType GetTextInputType(); |
| 475 virtual ui::TextInputType WebKitToUiTextInputType( | 473 virtual ui::TextInputType WebKitToUiTextInputType( |
| 476 blink::WebTextInputType type); | 474 blink::WebTextInputType type); |
| 477 | 475 |
| 478 #if defined(OS_MACOSX) || defined(USE_AURA) || defined(OS_ANDROID) | |
| 479 // Override point to obtain that the current composition character bounds. | 476 // Override point to obtain that the current composition character bounds. |
| 480 // In the case of surrogate pairs, the character is treated as two characters: | 477 // In the case of surrogate pairs, the character is treated as two characters: |
| 481 // the bounds for first character is actual one, and the bounds for second | 478 // the bounds for first character is actual one, and the bounds for second |
| 482 // character is zero width rectangle. | 479 // character is zero width rectangle. |
| 483 virtual void GetCompositionCharacterBounds( | 480 virtual void GetCompositionCharacterBounds( |
| 484 std::vector<gfx::Rect>* character_bounds); | 481 std::vector<gfx::Rect>* character_bounds); |
| 485 | 482 |
| 486 // Returns the range of the text that is being composed or the selection if | 483 // Returns the range of the text that is being composed or the selection if |
| 487 // the composition does not exist. | 484 // the composition does not exist. |
| 488 virtual void GetCompositionRange(gfx::Range* range); | 485 virtual void GetCompositionRange(gfx::Range* range); |
| 489 | 486 |
| 490 // Returns true if the composition range or composition character bounds | 487 // Returns true if the composition range or composition character bounds |
| 491 // should be sent to the browser process. | 488 // should be sent to the browser process. |
| 492 bool ShouldUpdateCompositionInfo( | 489 bool ShouldUpdateCompositionInfo( |
| 493 const gfx::Range& range, | 490 const gfx::Range& range, |
| 494 const std::vector<gfx::Rect>& bounds); | 491 const std::vector<gfx::Rect>& bounds); |
| 495 #endif | |
| 496 | 492 |
| 497 // Override point to obtain that the current input method state about | 493 // Override point to obtain that the current input method state about |
| 498 // composition text. | 494 // composition text. |
| 499 virtual bool CanComposeInline(); | 495 virtual bool CanComposeInline(); |
| 500 | 496 |
| 501 // Tells the renderer it does not have focus. Used to prevent us from getting | 497 // Tells the renderer it does not have focus. Used to prevent us from getting |
| 502 // the focus on our own when the browser did not focus us. | 498 // the focus on our own when the browser did not focus us. |
| 503 void ClearFocus(); | 499 void ClearFocus(); |
| 504 | 500 |
| 505 // Set the pending window rect. | 501 // Set the pending window rect. |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 ui::MenuSourceType context_menu_source_type_; | 762 ui::MenuSourceType context_menu_source_type_; |
| 767 bool has_host_context_menu_location_; | 763 bool has_host_context_menu_location_; |
| 768 gfx::Point host_context_menu_location_; | 764 gfx::Point host_context_menu_location_; |
| 769 | 765 |
| 770 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 766 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
| 771 }; | 767 }; |
| 772 | 768 |
| 773 } // namespace content | 769 } // namespace content |
| 774 | 770 |
| 775 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 771 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
| OLD | NEW |