Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.h

Issue 2845583002: Remove FrameViewBase as base class of RemoteFrameView. (Closed)
Patch Set: merge Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 Copyright (C) 1997 Martin Jones (mjones@kde.org) 2 Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 (C) 1998 Waldo Bastian (bastian@kde.org) 3 (C) 1998 Waldo Bastian (bastian@kde.org)
4 (C) 1998, 1999 Torben Weis (weis@kde.org) 4 (C) 1998, 1999 Torben Weis (weis@kde.org)
5 (C) 1999 Lars Knoll (knoll@kde.org) 5 (C) 1999 Lars Knoll (knoll@kde.org)
6 (C) 1999 Antti Koivisto (koivisto@kde.org) 6 (C) 1999 Antti Koivisto (koivisto@kde.org)
7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights 7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
8 reserved. 8 reserved.
9 9
10 This library is free software; you can redistribute it and/or 10 This library is free software; you can redistribute it and/or
(...skipping 22 matching lines...) Expand all
33 #include "core/frame/FrameViewAutoSizeInfo.h" 33 #include "core/frame/FrameViewAutoSizeInfo.h"
34 #include "core/frame/LayoutSubtreeRootList.h" 34 #include "core/frame/LayoutSubtreeRootList.h"
35 #include "core/frame/RootFrameViewport.h" 35 #include "core/frame/RootFrameViewport.h"
36 #include "core/layout/MapCoordinatesFlags.h" 36 #include "core/layout/MapCoordinatesFlags.h"
37 #include "core/layout/ScrollAnchor.h" 37 #include "core/layout/ScrollAnchor.h"
38 #include "core/paint/FirstMeaningfulPaintDetector.h" 38 #include "core/paint/FirstMeaningfulPaintDetector.h"
39 #include "core/paint/ObjectPaintProperties.h" 39 #include "core/paint/ObjectPaintProperties.h"
40 #include "core/paint/PaintInvalidationCapableScrollableArea.h" 40 #include "core/paint/PaintInvalidationCapableScrollableArea.h"
41 #include "core/paint/PaintPhase.h" 41 #include "core/paint/PaintPhase.h"
42 #include "core/paint/ScrollbarManager.h" 42 #include "core/paint/ScrollbarManager.h"
43 #include "core/plugins/PluginView.h"
44 #include "platform/FrameViewBase.h" 43 #include "platform/FrameViewBase.h"
45 #include "platform/RuntimeEnabledFeatures.h" 44 #include "platform/RuntimeEnabledFeatures.h"
46 #include "platform/animation/CompositorAnimationHost.h" 45 #include "platform/animation/CompositorAnimationHost.h"
47 #include "platform/animation/CompositorAnimationTimeline.h" 46 #include "platform/animation/CompositorAnimationTimeline.h"
48 #include "platform/geometry/IntRect.h" 47 #include "platform/geometry/IntRect.h"
49 #include "platform/geometry/LayoutRect.h" 48 #include "platform/geometry/LayoutRect.h"
50 #include "platform/graphics/Color.h" 49 #include "platform/graphics/Color.h"
51 #include "platform/graphics/CompositorElementId.h" 50 #include "platform/graphics/CompositorElementId.h"
52 #include "platform/graphics/GraphicsLayerClient.h" 51 #include "platform/graphics/GraphicsLayerClient.h"
53 #include "platform/scroll/ScrollTypes.h" 52 #include "platform/scroll/ScrollTypes.h"
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 472
474 LayoutRect ScrollIntoView(const LayoutRect& rect_in_content, 473 LayoutRect ScrollIntoView(const LayoutRect& rect_in_content,
475 const ScrollAlignment& align_x, 474 const ScrollAlignment& align_x,
476 const ScrollAlignment& align_y, 475 const ScrollAlignment& align_y,
477 ScrollType = kProgrammaticScroll) override; 476 ScrollType = kProgrammaticScroll) override;
478 477
479 // The window that hosts the FrameView. The FrameView will communicate scrolls 478 // The window that hosts the FrameView. The FrameView will communicate scrolls
480 // and repaints to the host window in the window's coordinate space. 479 // and repaints to the host window in the window's coordinate space.
481 PlatformChromeClient* GetChromeClient() const; 480 PlatformChromeClient* GetChromeClient() const;
482 481
483 typedef HeapHashSet<Member<FrameViewBase>> ChildrenSet; 482 typedef HeapHashSet<Member<FrameOrPlugin>> ChildrenSet;
484 typedef HeapHashSet<Member<PluginView>> PluginsSet;
485 typedef HeapHashSet<Member<Scrollbar>> ScrollbarsSet; 483 typedef HeapHashSet<Member<Scrollbar>> ScrollbarsSet;
486 484
487 // Functions for child manipulation and inspection. 485 // Functions for child manipulation and inspection.
488 bool IsSelfVisible() const { 486 bool IsSelfVisible() const {
489 return self_visible_; 487 return self_visible_;
490 } // Whether or not we have been explicitly marked as visible or not. 488 } // Whether or not we have been explicitly marked as visible or not.
491 bool IsParentVisible() const { 489 bool IsParentVisible() const {
492 return parent_visible_; 490 return parent_visible_;
493 } // Whether or not our parent is visible. 491 } // Whether or not our parent is visible.
494 bool IsVisible() const { 492 bool IsVisible() const {
495 return self_visible_ && parent_visible_; 493 return self_visible_ && parent_visible_;
496 } // Whether or not we are actually visible. 494 } // Whether or not we are actually visible.
497 void SetParentVisible(bool); 495 void SetParentVisible(bool) override;
498 void SetSelfVisible(bool v) { self_visible_ = v; } 496 void SetSelfVisible(bool v) { self_visible_ = v; }
499 void SetParent(FrameViewBase*) override; 497 void SetParent(FrameView*) override;
500 FrameViewBase* Parent() const override { return parent_; } 498 FrameView* Parent() const override { return parent_; }
501 void RemoveChild(FrameViewBase*); 499 FrameView* Root() const;
502 void AddChild(FrameViewBase*); 500 void RemoveChild(FrameOrPlugin*);
503 const ChildrenSet* Children() const { return &children_; } 501 void AddChild(FrameOrPlugin*);
504 void RemovePlugin(PluginView*); 502 const ChildrenSet& Children() const { return children_; }
505 void AddPlugin(PluginView*);
506 const PluginsSet* Plugins() const { return &plugins_; }
507 void RemoveScrollbar(Scrollbar*); 503 void RemoveScrollbar(Scrollbar*);
508 void AddScrollbar(Scrollbar*); 504 void AddScrollbar(Scrollbar*);
509 const ScrollbarsSet* Scrollbars() const { return &scrollbars_; } 505 const ScrollbarsSet& Scrollbars() const { return scrollbars_; }
510 506
511 // If the scroll view does not use a native widget, then it will have 507 // If the scroll view does not use a native widget, then it will have
512 // cross-platform Scrollbars. These functions can be used to obtain those 508 // cross-platform Scrollbars. These functions can be used to obtain those
513 // scrollbars. 509 // scrollbars.
514 Scrollbar* HorizontalScrollbar() const override { 510 Scrollbar* HorizontalScrollbar() const override {
515 return scrollbar_manager_.HorizontalScrollbar(); 511 return scrollbar_manager_.HorizontalScrollbar();
516 } 512 }
517 Scrollbar* VerticalScrollbar() const override { 513 Scrollbar* VerticalScrollbar() const override {
518 return scrollbar_manager_.VerticalScrollbar(); 514 return scrollbar_manager_.VerticalScrollbar();
519 } 515 }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 642
647 // Functions for converting to screen coordinates. 643 // Functions for converting to screen coordinates.
648 IntRect ContentsToScreen(const IntRect&) const; 644 IntRect ContentsToScreen(const IntRect&) const;
649 645
650 // For platforms that need to hit test scrollbars from within the engine's 646 // For platforms that need to hit test scrollbars from within the engine's
651 // event handlers (like Win32). 647 // event handlers (like Win32).
652 Scrollbar* ScrollbarAtFramePoint(const IntPoint&); 648 Scrollbar* ScrollbarAtFramePoint(const IntPoint&);
653 649
654 IntRect ConvertToRootFrame(const IntRect&) const; 650 IntRect ConvertToRootFrame(const IntRect&) const;
655 IntPoint ConvertToRootFrame(const IntPoint&) const; 651 IntPoint ConvertToRootFrame(const IntPoint&) const;
656 IntPoint ConvertSelfToChild(const FrameViewBase*, const IntPoint&) const; 652 IntPoint ConvertSelfToChild(const IntPoint&, const IntPoint&) const;
657 653
658 // FrameViewBase override. Handles painting of the contents of the view as 654 // Handles painting of the contents of the view as well as the scrollbars.
659 // well as the scrollbars.
660 void Paint(GraphicsContext&, const CullRect&) const override; 655 void Paint(GraphicsContext&, const CullRect&) const override;
661 void Paint(GraphicsContext&, const GlobalPaintFlags, const CullRect&) const; 656 void Paint(GraphicsContext&, const GlobalPaintFlags, const CullRect&) const;
662 void PaintContents(GraphicsContext&, 657 void PaintContents(GraphicsContext&,
663 const GlobalPaintFlags, 658 const GlobalPaintFlags,
664 const IntRect& damage_rect) const; 659 const IntRect& damage_rect) const;
665 660
666 void Show() override; 661 void Show() override;
667 void Hide() override; 662 void Hide() override;
668 663
669 bool IsPointInScrollbarCorner(const IntPoint&); 664 bool IsPointInScrollbarCorner(const IntPoint&);
670 bool ScrollbarCornerPresent() const; 665 bool ScrollbarCornerPresent() const;
671 IntRect ScrollCornerRect() const override; 666 IntRect ScrollCornerRect() const override;
672 667
673 IntPoint ConvertFromContainingFrameViewBaseToScrollbar( 668 IntPoint ConvertFromContainingFrameViewToScrollbar(
674 const Scrollbar&, 669 const Scrollbar&,
675 const IntPoint&) const override; 670 const IntPoint&) const override;
676 671
677 bool IsFrameView() const override { return true; } 672 bool IsFrameView() const override { return true; }
678 673
679 DECLARE_VIRTUAL_TRACE(); 674 DECLARE_VIRTUAL_TRACE();
680 void NotifyPageThatContentAreaWillPaint() const; 675 void NotifyPageThatContentAreaWillPaint() const;
681 FrameView* ParentFrameView() const; 676 FrameView* ParentFrameView() const;
682 677
683 // Returns the scrollable area for the frame. For the root frame, this will 678 // Returns the scrollable area for the frame. For the root frame, this will
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 960
966 void RecordDeferredLoadingStats(); 961 void RecordDeferredLoadingStats();
967 962
968 DocumentLifecycle& Lifecycle() const; 963 DocumentLifecycle& Lifecycle() const;
969 964
970 void ContentsResized() override; 965 void ContentsResized() override;
971 void ScrollbarExistenceDidChange(); 966 void ScrollbarExistenceDidChange();
972 967
973 // Methods to do point conversion via layoutObjects, in order to take 968 // Methods to do point conversion via layoutObjects, in order to take
974 // transforms into account. 969 // transforms into account.
975 IntRect ConvertToContainingFrameViewBase(const IntRect&) const; 970 IntRect ConvertToContainingFrameView(const IntRect&) const;
976 IntPoint ConvertToContainingFrameViewBase(const IntPoint&) const; 971 IntPoint ConvertToContainingFrameView(const IntPoint&) const;
977 IntRect ConvertFromContainingFrameViewBase(const IntRect&) const; 972 IntRect ConvertFromContainingFrameView(const IntRect&) const;
978 IntPoint ConvertFromContainingFrameViewBase(const IntPoint&) const; 973 IntPoint ConvertFromContainingFrameView(const IntPoint&) const;
979 974
980 void DidChangeGlobalRootScroller() override; 975 void DidChangeGlobalRootScroller() override;
981 976
982 void UpdateGeometriesIfNeeded(); 977 void UpdateGeometriesIfNeeded();
983 978
984 bool WasViewportResized(); 979 bool WasViewportResized();
985 void SendResizeEventIfNeeded(); 980 void SendResizeEventIfNeeded();
986 981
987 void UpdateParentScrollableAreaSet(); 982 void UpdateParentScrollableAreaSet();
988 983
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 bool CheckLayoutInvalidationIsAllowed() const; 1057 bool CheckLayoutInvalidationIsAllowed() const;
1063 1058
1064 PaintController* GetPaintController() { return paint_controller_.get(); } 1059 PaintController* GetPaintController() { return paint_controller_.get(); }
1065 1060
1066 LayoutSize size_; 1061 LayoutSize size_;
1067 1062
1068 typedef HashSet<RefPtr<LayoutEmbeddedObject>> EmbeddedObjectSet; 1063 typedef HashSet<RefPtr<LayoutEmbeddedObject>> EmbeddedObjectSet;
1069 EmbeddedObjectSet part_update_set_; 1064 EmbeddedObjectSet part_update_set_;
1070 1065
1071 // FIXME: These are just "children" of the FrameView and should be 1066 // FIXME: These are just "children" of the FrameView and should be
1072 // Member<FrameViewBase> instead. 1067 // Member<FrameView> instead.
1073 HashSet<RefPtr<LayoutPart>> parts_; 1068 HashSet<RefPtr<LayoutPart>> parts_;
1074 1069
1075 Member<LocalFrame> frame_; 1070 Member<LocalFrame> frame_;
1076 1071
1077 IntRect frame_rect_; 1072 IntRect frame_rect_;
1078 Member<FrameView> parent_; 1073 Member<FrameView> parent_;
1079 bool self_visible_; 1074 bool self_visible_;
1080 bool parent_visible_; 1075 bool parent_visible_;
1081 1076
1082 WebDisplayMode display_mode_; 1077 WebDisplayMode display_mode_;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 bool has_been_disposed_ = false; 1137 bool has_been_disposed_ = false;
1143 #endif 1138 #endif
1144 1139
1145 ScrollbarMode horizontal_scrollbar_mode_; 1140 ScrollbarMode horizontal_scrollbar_mode_;
1146 ScrollbarMode vertical_scrollbar_mode_; 1141 ScrollbarMode vertical_scrollbar_mode_;
1147 1142
1148 bool horizontal_scrollbar_lock_; 1143 bool horizontal_scrollbar_lock_;
1149 bool vertical_scrollbar_lock_; 1144 bool vertical_scrollbar_lock_;
1150 1145
1151 ChildrenSet children_; 1146 ChildrenSet children_;
1152 PluginsSet plugins_;
1153 ScrollbarsSet scrollbars_; 1147 ScrollbarsSet scrollbars_;
1154 1148
1155 ScrollOffset pending_scroll_delta_; 1149 ScrollOffset pending_scroll_delta_;
1156 ScrollOffset scroll_offset_; 1150 ScrollOffset scroll_offset_;
1157 IntSize contents_size_; 1151 IntSize contents_size_;
1158 1152
1159 bool scrollbars_suppressed_; 1153 bool scrollbars_suppressed_;
1160 1154
1161 bool in_update_scrollbars_; 1155 bool in_update_scrollbars_;
1162 1156
(...skipping 10 matching lines...) Expand all
1173 1167
1174 // The following members control rendering pipeline throttling for this 1168 // The following members control rendering pipeline throttling for this
1175 // frame. They are only updated in response to intersection observer 1169 // frame. They are only updated in response to intersection observer
1176 // notifications, i.e., not in the middle of the lifecycle. 1170 // notifications, i.e., not in the middle of the lifecycle.
1177 bool hidden_for_throttling_; 1171 bool hidden_for_throttling_;
1178 bool subtree_throttled_; 1172 bool subtree_throttled_;
1179 bool lifecycle_updates_throttled_; 1173 bool lifecycle_updates_throttled_;
1180 1174
1181 // Paint properties for SPv2 Only. 1175 // Paint properties for SPv2 Only.
1182 // The hierarchy of transform subtree created by a FrameView. 1176 // The hierarchy of transform subtree created by a FrameView.
1183 // [ preTranslation ] The offset from FrameViewBase::frameRect. 1177 // [ preTranslation ] The offset from FrameView::FrameRect.
1184 // | Establishes viewport. 1178 // | Establishes viewport.
1185 // +---[ scrollTranslation ] Frame scrolling. 1179 // +---[ scrollTranslation ] Frame scrolling.
1186 // TODO(trchen): These will not be needed once settings->rootLayerScrolls() is 1180 // TODO(trchen): These will not be needed once settings->rootLayerScrolls() is
1187 // enabled. 1181 // enabled.
1188 RefPtr<TransformPaintPropertyNode> pre_translation_; 1182 RefPtr<TransformPaintPropertyNode> pre_translation_;
1189 RefPtr<TransformPaintPropertyNode> scroll_translation_; 1183 RefPtr<TransformPaintPropertyNode> scroll_translation_;
1190 // The content clip clips the document (= LayoutView) but not the scrollbars. 1184 // The content clip clips the document (= LayoutView) but not the scrollbars.
1191 // TODO(trchen): This will not be needed once settings->rootLayerScrolls() is 1185 // TODO(trchen): This will not be needed once settings->rootLayerScrolls() is
1192 // enabled. 1186 // enabled.
1193 RefPtr<ClipPaintPropertyNode> content_clip_; 1187 RefPtr<ClipPaintPropertyNode> content_clip_;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 if (visually_non_empty_pixel_count_ > kVisualPixelThreshold) 1260 if (visually_non_empty_pixel_count_ > kVisualPixelThreshold)
1267 SetIsVisuallyNonEmpty(); 1261 SetIsVisuallyNonEmpty();
1268 } 1262 }
1269 1263
1270 DEFINE_TYPE_CASTS(FrameView, 1264 DEFINE_TYPE_CASTS(FrameView,
1271 FrameViewBase, 1265 FrameViewBase,
1272 frameViewBase, 1266 frameViewBase,
1273 frameViewBase->IsFrameView(), 1267 frameViewBase->IsFrameView(),
1274 frameViewBase.IsFrameView()); 1268 frameViewBase.IsFrameView());
1275 DEFINE_TYPE_CASTS(FrameView, 1269 DEFINE_TYPE_CASTS(FrameView,
1270 FrameOrPlugin,
1271 frame_or_plugin,
1272 frame_or_plugin->IsFrameView(),
1273 frame_or_plugin.IsFrameView());
1274 DEFINE_TYPE_CASTS(FrameView,
1276 ScrollableArea, 1275 ScrollableArea,
1277 scrollableArea, 1276 scrollable_area,
1278 scrollableArea->IsFrameView(), 1277 scrollable_area->IsFrameView(),
1279 scrollableArea.IsFrameView()); 1278 scrollable_area.IsFrameView());
1280 1279
1281 } // namespace blink 1280 } // namespace blink
1282 1281
1283 #endif // FrameView_h 1282 #endif // FrameView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698