| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 WebLocalFrame_h | 5 #ifndef WebLocalFrame_h |
| 6 #define WebLocalFrame_h | 6 #define WebLocalFrame_h |
| 7 | 7 |
| 8 #include "WebFrame.h" | 8 #include "WebFrame.h" |
| 9 #include "WebFrameLoadType.h" | 9 #include "WebFrameLoadType.h" |
| 10 | 10 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 // Run the task when the context of the current page is not suspended | 185 // Run the task when the context of the current page is not suspended |
| 186 // otherwise run it on context resumed. | 186 // otherwise run it on context resumed. |
| 187 // Method takes ownership of the passed task. | 187 // Method takes ownership of the passed task. |
| 188 virtual void requestRunTask(WebSuspendableTask*) const = 0; | 188 virtual void requestRunTask(WebSuspendableTask*) const = 0; |
| 189 | 189 |
| 190 // Associates an isolated world with human-readable name which is useful for | 190 // Associates an isolated world with human-readable name which is useful for |
| 191 // extension debugging. | 191 // extension debugging. |
| 192 virtual void setIsolatedWorldHumanReadableName(int worldID, const WebString&
) = 0; | 192 virtual void setIsolatedWorldHumanReadableName(int worldID, const WebString&
) = 0; |
| 193 | 193 |
| 194 // Editing ------------------------------------------------------------- |
| 194 | 195 |
| 195 // Selection -------------------------------------------------------------- | 196 virtual void insertText(const WebString& text) = 0; |
| 197 |
| 198 virtual void setMarkedText(const WebString& text, unsigned location, unsigne
d length) = 0; |
| 199 virtual void unmarkText() = 0; |
| 200 virtual bool hasMarkedText() const = 0; |
| 201 |
| 202 virtual WebRange markedRange() const = 0; |
| 203 |
| 204 // Returns the text range rectangle in the viepwort coordinate space. |
| 205 virtual bool firstRectForCharacterRange(unsigned location, unsigned length,
WebRect&) const = 0; |
| 206 |
| 207 // Returns the index of a character in the Frame's text stream at the given |
| 208 // point. The point is in the viewport coordinate space. Will return |
| 209 // WTF::notFound if the point is invalid. |
| 210 virtual size_t characterIndexForPoint(const WebPoint&) const = 0; |
| 211 |
| 212 // Supports commands like Undo, Redo, Cut, Copy, Paste, SelectAll, |
| 213 // Unselect, etc. See EditorCommand.cpp for the full list of supported |
| 214 // commands. |
| 215 virtual bool executeCommand(const WebString&) = 0; |
| 216 virtual bool executeCommand(const WebString&, const WebString& value) = 0; |
| 217 virtual bool isCommandEnabled(const WebString&) const = 0; |
| 218 |
| 219 // Selection ----------------------------------------------------------- |
| 220 |
| 221 virtual bool hasSelection() const = 0; |
| 222 |
| 223 virtual WebRange selectionRange() const = 0; |
| 224 |
| 225 virtual WebString selectionAsText() const = 0; |
| 226 virtual WebString selectionAsMarkup() const = 0; |
| 227 |
| 228 // Expands the selection to a word around the caret and returns |
| 229 // true. Does nothing and returns false if there is no caret or |
| 230 // there is ranged selection. |
| 231 virtual bool selectWordAroundCaret() = 0; |
| 232 |
| 233 // DEPRECATED: Use moveRangeSelection. |
| 234 virtual void selectRange(const WebPoint& base, const WebPoint& extent) = 0; |
| 235 |
| 236 virtual void selectRange(const WebRange&) = 0; |
| 237 |
| 238 // Move the current selection to the provided viewport point/points. If the |
| 239 // current selection is editable, the new selection will be restricted to |
| 240 // the root editable element. |
| 241 // |TextGranularity| represents character wrapping granularity. If |
| 242 // WordGranularity is set, WebFrame extends selection to wrap word. |
| 243 virtual void moveRangeSelection(const WebPoint& base, const WebPoint& extent
, WebFrame::TextGranularity = CharacterGranularity) = 0; |
| 244 virtual void moveCaretSelection(const WebPoint&) = 0; |
| 245 |
| 246 virtual bool setEditableSelectionOffsets(int start, int end) = 0; |
| 247 virtual bool setCompositionFromExistingText(int compositionStart, int compos
itionEnd, const WebVector<WebCompositionUnderline>& underlines) = 0; |
| 248 virtual void extendSelectionAndDelete(int before, int after) = 0; |
| 249 |
| 250 virtual void setCaretVisible(bool) = 0; |
| 196 | 251 |
| 197 // Moves the selection extent point. This function does not allow the | 252 // Moves the selection extent point. This function does not allow the |
| 198 // selection to collapse. If the new extent is set to the same position as | 253 // selection to collapse. If the new extent is set to the same position as |
| 199 // the current base, this function will do nothing. | 254 // the current base, this function will do nothing. |
| 200 virtual void moveRangeSelectionExtent(const WebPoint&) = 0; | 255 virtual void moveRangeSelectionExtent(const WebPoint&) = 0; |
| 201 // Replaces the selection with the input string. | 256 // Replaces the selection with the input string. |
| 202 virtual void replaceSelection(const WebString&) = 0; | 257 virtual void replaceSelection(const WebString&) = 0; |
| 203 | 258 |
| 204 // Spell-checking support ------------------------------------------------- | 259 // Spell-checking support ------------------------------------------------- |
| 205 virtual void replaceMisspelledRange(const WebString&) = 0; | 260 virtual void replaceMisspelledRange(const WebString&) = 0; |
| 261 virtual void enableContinuousSpellChecking(bool) = 0; |
| 262 virtual bool isContinuousSpellCheckingEnabled() const = 0; |
| 263 virtual void requestTextChecking(const WebElement&) = 0; |
| 264 virtual void removeSpellingMarkers() = 0; |
| 206 | 265 |
| 207 // Content Settings ------------------------------------------------------- | 266 // Content Settings ------------------------------------------------------- |
| 208 | 267 |
| 209 virtual void setContentSettingsClient(WebContentSettingsClient*) = 0; | 268 virtual void setContentSettingsClient(WebContentSettingsClient*) = 0; |
| 210 | 269 |
| 211 // App banner ------------------------------------------------------------- | 270 // App banner ------------------------------------------------------------- |
| 212 | 271 |
| 213 // Request to show an application install banner for the given |platforms|. | 272 // Request to show an application install banner for the given |platforms|. |
| 214 // The implementation can request the embedder to cancel the call by setting | 273 // The implementation can request the embedder to cancel the call by setting |
| 215 // |cancel| to true. | 274 // |cancel| to true. |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 // to call these on a WebLocalFrame. | 428 // to call these on a WebLocalFrame. |
| 370 bool isWebLocalFrame() const override = 0; | 429 bool isWebLocalFrame() const override = 0; |
| 371 WebLocalFrame* toWebLocalFrame() override = 0; | 430 WebLocalFrame* toWebLocalFrame() override = 0; |
| 372 bool isWebRemoteFrame() const override = 0; | 431 bool isWebRemoteFrame() const override = 0; |
| 373 WebRemoteFrame* toWebRemoteFrame() override = 0; | 432 WebRemoteFrame* toWebRemoteFrame() override = 0; |
| 374 }; | 433 }; |
| 375 | 434 |
| 376 } // namespace blink | 435 } // namespace blink |
| 377 | 436 |
| 378 #endif // WebLocalFrame_h | 437 #endif // WebLocalFrame_h |
| OLD | NEW |