Chromium Code Reviews| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 class Function; | 45 class Function; |
| 46 class Value; | 46 class Value; |
| 47 template <class T> | 47 template <class T> |
| 48 class Local; | 48 class Local; |
| 49 } | 49 } |
| 50 | 50 |
| 51 namespace blink { | 51 namespace blink { |
| 52 | 52 |
| 53 class Frame; | 53 class Frame; |
| 54 class OpenedFrameTracker; | 54 class OpenedFrameTracker; |
| 55 class Page; | |
| 55 class Visitor; | 56 class Visitor; |
| 56 class WebAssociatedURLLoader; | 57 class WebAssociatedURLLoader; |
| 57 struct WebAssociatedURLLoaderOptions; | 58 struct WebAssociatedURLLoaderOptions; |
| 58 class WebDOMEvent; | 59 class WebDOMEvent; |
| 59 class WebData; | 60 class WebData; |
| 60 class WebDataSource; | 61 class WebDataSource; |
| 61 class WebDocument; | 62 class WebDocument; |
| 62 class WebElement; | 63 class WebElement; |
| 63 class WebFrameImplBase; | |
| 64 class WebLocalFrame; | 64 class WebLocalFrame; |
| 65 class WebPerformance; | 65 class WebPerformance; |
| 66 class WebRemoteFrame; | 66 class WebRemoteFrame; |
| 67 class WebSecurityOrigin; | 67 class WebSecurityOrigin; |
| 68 class WebSharedWorkerRepositoryClient; | 68 class WebSharedWorkerRepositoryClient; |
| 69 class WebString; | 69 class WebString; |
| 70 class WebURL; | 70 class WebURL; |
| 71 class WebURLRequest; | 71 class WebURLRequest; |
| 72 class WebView; | 72 class WebView; |
| 73 enum class WebSandboxFlags; | 73 enum class WebSandboxFlags; |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 410 // Returns the bounds rect for current selection. If selection is performed | 410 // Returns the bounds rect for current selection. If selection is performed |
| 411 // on transformed text, the rect will still bound the selection but will | 411 // on transformed text, the rect will still bound the selection but will |
| 412 // not be transformed itself. If no selection is present, the rect will be | 412 // not be transformed itself. If no selection is present, the rect will be |
| 413 // empty ((0,0), (0,0)). | 413 // empty ((0,0), (0,0)). |
| 414 virtual WebRect SelectionBoundsRect() const = 0; | 414 virtual WebRect SelectionBoundsRect() const = 0; |
| 415 | 415 |
| 416 // Dumps the layer tree, used by the accelerated compositor, in | 416 // Dumps the layer tree, used by the accelerated compositor, in |
| 417 // text form. This is used only by layout tests. | 417 // text form. This is used only by layout tests. |
| 418 virtual WebString LayerTreeAsText(bool show_debug_info = false) const = 0; | 418 virtual WebString LayerTreeAsText(bool show_debug_info = false) const = 0; |
| 419 | 419 |
| 420 virtual WebFrameImplBase* ToImplBase() = 0; | |
| 421 // TODO(dcheng): Fix const-correctness issues and remove this overload. | |
| 422 virtual const WebFrameImplBase* ToImplBase() const { | |
| 423 return const_cast<WebFrame*>(this)->ToImplBase(); | |
| 424 } | |
| 425 | |
| 426 // Returns the frame inside a given frame or iframe element. Returns 0 if | 420 // Returns the frame inside a given frame or iframe element. Returns 0 if |
| 427 // the given element is not a frame, iframe or if the frame is empty. | 421 // the given element is not a frame, iframe or if the frame is empty. |
| 428 BLINK_EXPORT static WebFrame* FromFrameOwnerElement(const WebElement&); | 422 BLINK_EXPORT static WebFrame* FromFrameOwnerElement(const WebElement&); |
| 429 | 423 |
| 430 #if BLINK_IMPLEMENTATION | 424 #if BLINK_IMPLEMENTATION |
| 431 static WebFrame* FromFrame(Frame*); | 425 static WebFrame* FromFrame(Frame*); |
| 432 | 426 |
| 427 static void InitializeCoreFrame(WebFrame*, Page&); | |
|
dcheng
2017/04/26 11:45:36
Nit: WebFrame&, as the frame parameter should neve
mustaq
2017/04/26 18:12:48
Done #2.
#1: Ref params must be const ref accordi
dcheng
2017/04/27 02:22:36
Mutable references are fine in Blink though: this
mustaq
2017/04/27 14:21:21
Done.
| |
| 428 static Frame* CoreFrame(const WebFrame*); | |
|
dcheng
2017/04/26 11:45:37
Nit: ToCoreFrame
mustaq
2017/04/26 18:12:48
Done.
But it seems |FromFrame| should now be call
dcheng
2017/04/27 02:22:36
Sure, we can do that in a separate change though.
mustaq
2017/04/27 14:21:21
Added a TODO.
| |
| 429 | |
| 433 bool InShadowTree() const { return scope_ == WebTreeScopeType::kShadow; } | 430 bool InShadowTree() const { return scope_ == WebTreeScopeType::kShadow; } |
| 434 | 431 |
| 435 static void TraceFrames(Visitor*, WebFrame*); | 432 static void TraceFrames(Visitor*, WebFrame*); |
| 436 #endif | 433 #endif |
| 437 | 434 |
| 438 protected: | 435 protected: |
| 439 explicit WebFrame(WebTreeScopeType); | 436 explicit WebFrame(WebTreeScopeType); |
| 440 virtual ~WebFrame(); | 437 virtual ~WebFrame(); |
| 441 | 438 |
| 442 // Sets the parent WITHOUT fulling adding it to the frame tree. | 439 // Sets the parent WITHOUT fulling adding it to the frame tree. |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 461 WebFrame* first_child_; | 458 WebFrame* first_child_; |
| 462 WebFrame* last_child_; | 459 WebFrame* last_child_; |
| 463 | 460 |
| 464 WebFrame* opener_; | 461 WebFrame* opener_; |
| 465 std::unique_ptr<OpenedFrameTracker> opened_frame_tracker_; | 462 std::unique_ptr<OpenedFrameTracker> opened_frame_tracker_; |
| 466 }; | 463 }; |
| 467 | 464 |
| 468 } // namespace blink | 465 } // namespace blink |
| 469 | 466 |
| 470 #endif | 467 #endif |
| OLD | NEW |