| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 const WebFloatSize& elasticOverscrollDelta, | 134 const WebFloatSize& elasticOverscrollDelta, |
| 135 float scaleFactor, | 135 float scaleFactor, |
| 136 float browserControlsShownRatioDelta) {} | 136 float browserControlsShownRatioDelta) {} |
| 137 | 137 |
| 138 // Called to inform the WebWidget that mouse capture was lost. | 138 // Called to inform the WebWidget that mouse capture was lost. |
| 139 virtual void mouseCaptureLost() {} | 139 virtual void mouseCaptureLost() {} |
| 140 | 140 |
| 141 // Called to inform the WebWidget that it has gained or lost keyboard focus. | 141 // Called to inform the WebWidget that it has gained or lost keyboard focus. |
| 142 virtual void setFocus(bool) {} | 142 virtual void setFocus(bool) {} |
| 143 | 143 |
| 144 // Called to inform the WebWidget of a new composition text. | |
| 145 // If selectionStart and selectionEnd has the same value, then it indicates | |
| 146 // the input caret position. If the text is empty, then the existing | |
| 147 // composition text will be cancelled. | |
| 148 // Returns true if the composition text was set successfully. | |
| 149 virtual bool setComposition( | |
| 150 const WebString& text, | |
| 151 const WebVector<WebCompositionUnderline>& underlines, | |
| 152 int selectionStart, | |
| 153 int selectionEnd) { | |
| 154 return false; | |
| 155 } | |
| 156 | |
| 157 enum ConfirmCompositionBehavior { | |
| 158 DoNotKeepSelection, | |
| 159 KeepSelection, | |
| 160 }; | |
| 161 | |
| 162 // Called to inform the WebWidget that deleting the ongoing composition if | |
| 163 // any, inserting the specified text, and moving the caret according to | |
| 164 // relativeCaretPosition. | |
| 165 virtual bool commitText(const WebString& text, int relativeCaretPosition) { | |
| 166 return false; | |
| 167 } | |
| 168 | |
| 169 // Called to inform the WebWidget to confirm an ongoing composition. | |
| 170 virtual bool finishComposingText( | |
| 171 ConfirmCompositionBehavior selectionBehavior) { | |
| 172 return false; | |
| 173 } | |
| 174 | |
| 175 // Fetches the character range of the current composition, also called the | 144 // Fetches the character range of the current composition, also called the |
| 176 // "marked range." | 145 // "marked range." |
| 177 virtual WebRange compositionRange() { return WebRange(); } | 146 virtual WebRange compositionRange() { return WebRange(); } |
| 178 | 147 |
| 179 // Returns information about the current text input of this WebWidget. | 148 // Returns information about the current text input of this WebWidget. |
| 180 // Note that this query can be expensive for long fields, as it returns the | 149 // Note that this query can be expensive for long fields, as it returns the |
| 181 // plain-text representation of the current editable element. Consider using | 150 // plain-text representation of the current editable element. Consider using |
| 182 // the lighter-weight textInputType() when appropriate. | 151 // the lighter-weight textInputType() when appropriate. |
| 183 virtual WebTextInputInfo textInputInfo() { return WebTextInputInfo(); } | 152 virtual WebTextInputInfo textInputInfo() { return WebTextInputInfo(); } |
| 184 | 153 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 // replaced. | 232 // replaced. |
| 264 virtual void applyReplacementRange(const WebRange&) {} | 233 virtual void applyReplacementRange(const WebRange&) {} |
| 265 | 234 |
| 266 protected: | 235 protected: |
| 267 ~WebWidget() {} | 236 ~WebWidget() {} |
| 268 }; | 237 }; |
| 269 | 238 |
| 270 } // namespace blink | 239 } // namespace blink |
| 271 | 240 |
| 272 #endif | 241 #endif |
| OLD | NEW |