| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 int selectionEnd) { return false; } | 149 int selectionEnd) { return false; } |
| 150 | 150 |
| 151 enum ConfirmCompositionBehavior { | 151 enum ConfirmCompositionBehavior { |
| 152 DoNotKeepSelection, | 152 DoNotKeepSelection, |
| 153 KeepSelection, | 153 KeepSelection, |
| 154 }; | 154 }; |
| 155 | 155 |
| 156 // Called to inform the WebWidget to confirm an ongoing composition. | 156 // Called to inform the WebWidget to confirm an ongoing composition. |
| 157 // This method is same as confirmComposition(WebString()); | 157 // This method is same as confirmComposition(WebString()); |
| 158 // Returns true if there is an ongoing composition. | 158 // Returns true if there is an ongoing composition. |
| 159 virtual bool confirmComposition() { return false; } // Deprecated | 159 virtual bool confirmComposition(int newCursorPosition = 1) { return false; }
// Deprecated |
| 160 virtual bool confirmComposition(ConfirmCompositionBehavior selectionBehavior
) { return false; } | 160 virtual bool confirmComposition(ConfirmCompositionBehavior selectionBehavior
, int newCursorPosition = 1) { return false; } |
| 161 | 161 |
| 162 // Called to inform the WebWidget to confirm an ongoing composition with a | 162 // Called to inform the WebWidget to confirm an ongoing composition with a |
| 163 // new composition text. If the text is empty then the current composition | 163 // new composition text. If the text is empty then the current composition |
| 164 // text is confirmed. If there is no ongoing composition, then deletes the | 164 // text is confirmed. If there is no ongoing composition, then deletes the |
| 165 // current selection and inserts the text. This method has no effect if | 165 // current selection and inserts the text. This method has no effect if |
| 166 // there is no ongoing composition and the text is empty. | 166 // there is no ongoing composition and the text is empty. |
| 167 // Returns true if there is an ongoing composition or the text is inserted. | 167 // Returns true if there is an ongoing composition or the text is inserted. |
| 168 virtual bool confirmComposition(const WebString& text) { return false; } | 168 virtual bool confirmComposition(const WebString& text, int newCursorPosition
= 1) { return false; } |
| 169 | 169 |
| 170 // Fetches the character range of the current composition, also called the | 170 // Fetches the character range of the current composition, also called the |
| 171 // "marked range." Returns true and fills the out-paramters on success; | 171 // "marked range." Returns true and fills the out-paramters on success; |
| 172 // returns false on failure. | 172 // returns false on failure. |
| 173 virtual bool compositionRange(size_t* location, size_t* length) { return fal
se; } | 173 virtual bool compositionRange(size_t* location, size_t* length) { return fal
se; } |
| 174 | 174 |
| 175 // Returns information about the current text input of this WebWidget. | 175 // Returns information about the current text input of this WebWidget. |
| 176 // Note that this query can be expensive for long fields, as it returns the | 176 // Note that this query can be expensive for long fields, as it returns the |
| 177 // plain-text representation of the current editable element. Consider using | 177 // plain-text representation of the current editable element. Consider using |
| 178 // the lighter-weight textInputType() when appropriate. | 178 // the lighter-weight textInputType() when appropriate. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 // or potential performance issues. | 247 // or potential performance issues. |
| 248 virtual void reportFixedRasterScaleUseCounters(bool hasBlurryContent, bool h
asPotentialPerformanceRegression) {} | 248 virtual void reportFixedRasterScaleUseCounters(bool hasBlurryContent, bool h
asPotentialPerformanceRegression) {} |
| 249 | 249 |
| 250 protected: | 250 protected: |
| 251 ~WebWidget() { } | 251 ~WebWidget() { } |
| 252 }; | 252 }; |
| 253 | 253 |
| 254 } // namespace blink | 254 } // namespace blink |
| 255 | 255 |
| 256 #endif | 256 #endif |
| OLD | NEW |