| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 // Basic properties --------------------------------------------------- | 65 // Basic properties --------------------------------------------------- |
| 66 | 66 |
| 67 // Updates the scrolling and margin properties in the frame's FrameOwner. | 67 // Updates the scrolling and margin properties in the frame's FrameOwner. |
| 68 // This is used when this frame's parent is in another process and it | 68 // This is used when this frame's parent is in another process and it |
| 69 // dynamically updates these properties. | 69 // dynamically updates these properties. |
| 70 // TODO(dcheng): Currently, the update only takes effect on next frame | 70 // TODO(dcheng): Currently, the update only takes effect on next frame |
| 71 // navigation. This matches the in-process frame behavior. | 71 // navigation. This matches the in-process frame behavior. |
| 72 virtual void setFrameOwnerProperties(const WebFrameOwnerProperties&) = 0; | 72 virtual void setFrameOwnerProperties(const WebFrameOwnerProperties&) = 0; |
| 73 | 73 |
| 74 // Returns true if the frame is focused. |
| 75 virtual bool isFocused() const = 0; |
| 76 |
| 74 // Hierarchy ---------------------------------------------------------- | 77 // Hierarchy ---------------------------------------------------------- |
| 75 | 78 |
| 76 // Get the highest-level LocalFrame in this frame's in-process subtree. | 79 // Get the highest-level LocalFrame in this frame's in-process subtree. |
| 77 virtual WebLocalFrame* localRoot() = 0; | 80 virtual WebLocalFrame* localRoot() = 0; |
| 78 | 81 |
| 79 // Returns the previous/next local frame in "frame traversal order", | 82 // Returns the previous/next local frame in "frame traversal order", |
| 80 // optionally wrapping around. | 83 // optionally wrapping around. |
| 81 virtual WebLocalFrame* traversePreviousLocal(bool wrap) const = 0; | 84 virtual WebLocalFrame* traversePreviousLocal(bool wrap) const = 0; |
| 82 virtual WebLocalFrame* traverseNextLocal(bool wrap) const = 0; | 85 virtual WebLocalFrame* traverseNextLocal(bool wrap) const = 0; |
| 83 | 86 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 // current version. Should be called only on the main frame. | 290 // current version. Should be called only on the main frame. |
| 288 virtual int findMatchMarkersVersion() const = 0; | 291 virtual int findMatchMarkersVersion() const = 0; |
| 289 | 292 |
| 290 // Returns the bounding box of the active find-in-page match marker or an | 293 // Returns the bounding box of the active find-in-page match marker or an |
| 291 // empty rect if no such marker exists. The rect is returned in find-in-page | 294 // empty rect if no such marker exists. The rect is returned in find-in-page |
| 292 // coordinates whatever frame the active marker is. | 295 // coordinates whatever frame the active marker is. |
| 293 // Should be called only on the main frame. | 296 // Should be called only on the main frame. |
| 294 virtual WebFloatRect activeFindMatchRect() = 0; | 297 virtual WebFloatRect activeFindMatchRect() = 0; |
| 295 | 298 |
| 296 // Swaps the contents of the provided vector with the bounding boxes of the | 299 // Swaps the contents of the provided vector with the bounding boxes of the |
| 297 // find-in-page match markers from all frames. The bounding boxes are return
ed | 300 // find-in-page match markers from all frames. The bounding boxes are |
| 298 // in find-in-page coordinates. This method should be called only on the mai
n frame. | 301 // returned in find-in-page coordinates. This method should be called only |
| 302 // on the main frame. |
| 299 virtual void findMatchRects(WebVector<WebFloatRect>&) = 0; | 303 virtual void findMatchRects(WebVector<WebFloatRect>&) = 0; |
| 300 | 304 |
| 301 // Selects the find-in-page match in the appropriate frame closest to the | 305 // Selects the find-in-page match closest to the provided point in |
| 302 // provided point in find-in-page coordinates. Returns the ordinal of such | 306 // find-in-page coordinates. Returns the ordinal of such match or -1 if none |
| 303 // match or -1 if none could be found. If not null, selectionRect is set to | 307 // could be found. If not null, selectionRect is set to the bounding box of |
| 304 // the bounding box of the selected match in window coordinates. | 308 // the selected match in window coordinates. This method should be called |
| 305 // This method should be called only on the main frame. | 309 // only on the main frame. |
| 306 virtual int selectNearestFindMatch(const WebFloatPoint&, | 310 virtual int selectNearestFindMatch(const WebFloatPoint&, |
| 307 WebRect* selectionRect) | 311 WebRect* selectionRect) |
| 308 = 0; | 312 = 0; |
| 309 | 313 |
| 314 // Returns the distance (squared) to the closest find-in-page match from the |
| 315 // provided point, in find-in-page coordinates. |
| 316 virtual float nearestFindMatch(const WebFloatPoint&) = 0; |
| 317 |
| 310 // Set the tickmarks for the frame. This will override the default tickmarks | 318 // Set the tickmarks for the frame. This will override the default tickmarks |
| 311 // generated by find results. If this is called with an empty array, the | 319 // generated by find results. If this is called with an empty array, the |
| 312 // default behavior will be restored. | 320 // default behavior will be restored. |
| 313 virtual void setTickmarks(const WebVector<WebRect>&) = 0; | 321 virtual void setTickmarks(const WebVector<WebRect>&) = 0; |
| 314 | 322 |
| 323 // Clears the active find match in the frame, if one exists. |
| 324 virtual void clearActiveFindMatch() = 0; |
| 325 |
| 315 // Context menu ----------------------------------------------------------- | 326 // Context menu ----------------------------------------------------------- |
| 316 | 327 |
| 317 // Returns the node that the context menu opened over. | 328 // Returns the node that the context menu opened over. |
| 318 virtual WebNode contextMenuNode() const = 0; | 329 virtual WebNode contextMenuNode() const = 0; |
| 319 | 330 |
| 320 // Returns the WebFrameWidget associated with this frame if there is one or | 331 // Returns the WebFrameWidget associated with this frame if there is one or |
| 321 // nullptr otherwise. | 332 // nullptr otherwise. |
| 322 virtual WebWidget* frameWidget() const = 0; | 333 virtual WebWidget* frameWidget() const = 0; |
| 323 | 334 |
| 324 protected: | 335 protected: |
| 325 explicit WebLocalFrame(WebTreeScopeType scope) : WebFrame(scope) { } | 336 explicit WebLocalFrame(WebTreeScopeType scope) : WebFrame(scope) { } |
| 326 | 337 |
| 327 // Inherited from WebFrame, but intentionally hidden: it never makes sense | 338 // Inherited from WebFrame, but intentionally hidden: it never makes sense |
| 328 // to call these on a WebLocalFrame. | 339 // to call these on a WebLocalFrame. |
| 329 bool isWebLocalFrame() const override = 0; | 340 bool isWebLocalFrame() const override = 0; |
| 330 WebLocalFrame* toWebLocalFrame() override = 0; | 341 WebLocalFrame* toWebLocalFrame() override = 0; |
| 331 bool isWebRemoteFrame() const override = 0; | 342 bool isWebRemoteFrame() const override = 0; |
| 332 WebRemoteFrame* toWebRemoteFrame() override = 0; | 343 WebRemoteFrame* toWebRemoteFrame() override = 0; |
| 333 }; | 344 }; |
| 334 | 345 |
| 335 } // namespace blink | 346 } // namespace blink |
| 336 | 347 |
| 337 #endif // WebLocalFrame_h | 348 #endif // WebLocalFrame_h |
| OLD | NEW |