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

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

Issue 2845583002: Remove FrameViewBase as base class of RemoteFrameView. (Closed)
Patch Set: ConvertSelfToChild take FrameOrPlugin as arg 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 void RemoveChild(FrameOrPlugin*);
502 void AddChild(FrameViewBase*); 500 void AddChild(FrameOrPlugin*);
503 const ChildrenSet* Children() const { return &children_; } 501 const ChildrenSet& Children() const { return children_; }
504 void RemovePlugin(PluginView*);
505 void AddPlugin(PluginView*);
506 const PluginsSet* Plugins() const { return &plugins_; }
507 void RemoveScrollbar(Scrollbar*); 502 void RemoveScrollbar(Scrollbar*);
508 void AddScrollbar(Scrollbar*); 503 void AddScrollbar(Scrollbar*);
509 const ScrollbarsSet* Scrollbars() const { return &scrollbars_; } 504 const ScrollbarsSet* Scrollbars() const { return &scrollbars_; }
510 505
511 // If the scroll view does not use a native widget, then it will have 506 // 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 507 // cross-platform Scrollbars. These functions can be used to obtain those
513 // scrollbars. 508 // scrollbars.
514 Scrollbar* HorizontalScrollbar() const override { 509 Scrollbar* HorizontalScrollbar() const override {
515 return scrollbar_manager_.HorizontalScrollbar(); 510 return scrollbar_manager_.HorizontalScrollbar();
516 } 511 }
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 641
647 // Functions for converting to screen coordinates. 642 // Functions for converting to screen coordinates.
648 IntRect ContentsToScreen(const IntRect&) const; 643 IntRect ContentsToScreen(const IntRect&) const;
649 644
650 // For platforms that need to hit test scrollbars from within the engine's 645 // For platforms that need to hit test scrollbars from within the engine's
651 // event handlers (like Win32). 646 // event handlers (like Win32).
652 Scrollbar* ScrollbarAtFramePoint(const IntPoint&); 647 Scrollbar* ScrollbarAtFramePoint(const IntPoint&);
653 648
654 IntRect ConvertToRootFrame(const IntRect&) const; 649 IntRect ConvertToRootFrame(const IntRect&) const;
655 IntPoint ConvertToRootFrame(const IntPoint&) const; 650 IntPoint ConvertToRootFrame(const IntPoint&) const;
656 IntPoint ConvertSelfToChild(const FrameViewBase*, const IntPoint&) const; 651 IntPoint ConvertSelfToChild(const FrameOrPlugin&, const IntPoint&) const;
657 652
658 // FrameViewBase override. Handles painting of the contents of the view as 653 // 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; 654 void Paint(GraphicsContext&, const CullRect&) const override;
661 void Paint(GraphicsContext&, const GlobalPaintFlags, const CullRect&) const; 655 void Paint(GraphicsContext&, const GlobalPaintFlags, const CullRect&) const;
662 void PaintContents(GraphicsContext&, 656 void PaintContents(GraphicsContext&,
663 const GlobalPaintFlags, 657 const GlobalPaintFlags,
664 const IntRect& damage_rect) const; 658 const IntRect& damage_rect) const;
665 659
666 void Show() override; 660 void Show() override;
667 void Hide() override; 661 void Hide() override;
668 662
669 bool IsPointInScrollbarCorner(const IntPoint&); 663 bool IsPointInScrollbarCorner(const IntPoint&);
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 bool CheckLayoutInvalidationIsAllowed() const; 1056 bool CheckLayoutInvalidationIsAllowed() const;
1063 1057
1064 PaintController* GetPaintController() { return paint_controller_.get(); } 1058 PaintController* GetPaintController() { return paint_controller_.get(); }
1065 1059
1066 LayoutSize size_; 1060 LayoutSize size_;
1067 1061
1068 typedef HashSet<RefPtr<LayoutEmbeddedObject>> EmbeddedObjectSet; 1062 typedef HashSet<RefPtr<LayoutEmbeddedObject>> EmbeddedObjectSet;
1069 EmbeddedObjectSet part_update_set_; 1063 EmbeddedObjectSet part_update_set_;
1070 1064
1071 // FIXME: These are just "children" of the FrameView and should be 1065 // FIXME: These are just "children" of the FrameView and should be
1072 // Member<FrameViewBase> instead. 1066 // Member<FrameView> instead.
1073 HashSet<RefPtr<LayoutPart>> parts_; 1067 HashSet<RefPtr<LayoutPart>> parts_;
1074 1068
1075 Member<LocalFrame> frame_; 1069 Member<LocalFrame> frame_;
1076 1070
1077 IntRect frame_rect_; 1071 IntRect frame_rect_;
1078 Member<FrameView> parent_; 1072 Member<FrameView> parent_;
1079 bool self_visible_; 1073 bool self_visible_;
1080 bool parent_visible_; 1074 bool parent_visible_;
1081 1075
1082 WebDisplayMode display_mode_; 1076 WebDisplayMode display_mode_;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 bool has_been_disposed_ = false; 1136 bool has_been_disposed_ = false;
1143 #endif 1137 #endif
1144 1138
1145 ScrollbarMode horizontal_scrollbar_mode_; 1139 ScrollbarMode horizontal_scrollbar_mode_;
1146 ScrollbarMode vertical_scrollbar_mode_; 1140 ScrollbarMode vertical_scrollbar_mode_;
1147 1141
1148 bool horizontal_scrollbar_lock_; 1142 bool horizontal_scrollbar_lock_;
1149 bool vertical_scrollbar_lock_; 1143 bool vertical_scrollbar_lock_;
1150 1144
1151 ChildrenSet children_; 1145 ChildrenSet children_;
1152 PluginsSet plugins_;
1153 ScrollbarsSet scrollbars_; 1146 ScrollbarsSet scrollbars_;
1154 1147
1155 ScrollOffset pending_scroll_delta_; 1148 ScrollOffset pending_scroll_delta_;
1156 ScrollOffset scroll_offset_; 1149 ScrollOffset scroll_offset_;
1157 IntSize contents_size_; 1150 IntSize contents_size_;
1158 1151
1159 bool scrollbars_suppressed_; 1152 bool scrollbars_suppressed_;
1160 1153
1161 bool in_update_scrollbars_; 1154 bool in_update_scrollbars_;
1162 1155
(...skipping 10 matching lines...) Expand all
1173 1166
1174 // The following members control rendering pipeline throttling for this 1167 // The following members control rendering pipeline throttling for this
1175 // frame. They are only updated in response to intersection observer 1168 // frame. They are only updated in response to intersection observer
1176 // notifications, i.e., not in the middle of the lifecycle. 1169 // notifications, i.e., not in the middle of the lifecycle.
1177 bool hidden_for_throttling_; 1170 bool hidden_for_throttling_;
1178 bool subtree_throttled_; 1171 bool subtree_throttled_;
1179 bool lifecycle_updates_throttled_; 1172 bool lifecycle_updates_throttled_;
1180 1173
1181 // Paint properties for SPv2 Only. 1174 // Paint properties for SPv2 Only.
1182 // The hierarchy of transform subtree created by a FrameView. 1175 // The hierarchy of transform subtree created by a FrameView.
1183 // [ preTranslation ] The offset from FrameViewBase::frameRect. 1176 // [ preTranslation ] The offset from FrameView::FrameRect.
1184 // | Establishes viewport. 1177 // | Establishes viewport.
1185 // +---[ scrollTranslation ] Frame scrolling. 1178 // +---[ scrollTranslation ] Frame scrolling.
1186 // TODO(trchen): These will not be needed once settings->rootLayerScrolls() is 1179 // TODO(trchen): These will not be needed once settings->rootLayerScrolls() is
1187 // enabled. 1180 // enabled.
1188 RefPtr<TransformPaintPropertyNode> pre_translation_; 1181 RefPtr<TransformPaintPropertyNode> pre_translation_;
1189 RefPtr<TransformPaintPropertyNode> scroll_translation_; 1182 RefPtr<TransformPaintPropertyNode> scroll_translation_;
1190 // The content clip clips the document (= LayoutView) but not the scrollbars. 1183 // The content clip clips the document (= LayoutView) but not the scrollbars.
1191 // TODO(trchen): This will not be needed once settings->rootLayerScrolls() is 1184 // TODO(trchen): This will not be needed once settings->rootLayerScrolls() is
1192 // enabled. 1185 // enabled.
1193 RefPtr<ClipPaintPropertyNode> content_clip_; 1186 RefPtr<ClipPaintPropertyNode> content_clip_;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 if (visually_non_empty_pixel_count_ > kVisualPixelThreshold) 1259 if (visually_non_empty_pixel_count_ > kVisualPixelThreshold)
1267 SetIsVisuallyNonEmpty(); 1260 SetIsVisuallyNonEmpty();
1268 } 1261 }
1269 1262
1270 DEFINE_TYPE_CASTS(FrameView, 1263 DEFINE_TYPE_CASTS(FrameView,
1271 FrameViewBase, 1264 FrameViewBase,
1272 frameViewBase, 1265 frameViewBase,
1273 frameViewBase->IsFrameView(), 1266 frameViewBase->IsFrameView(),
1274 frameViewBase.IsFrameView()); 1267 frameViewBase.IsFrameView());
1275 DEFINE_TYPE_CASTS(FrameView, 1268 DEFINE_TYPE_CASTS(FrameView,
1269 FrameOrPlugin,
1270 frame_or_plugin,
1271 frame_or_plugin->IsFrameView(),
1272 frame_or_plugin.IsFrameView());
1273 DEFINE_TYPE_CASTS(FrameView,
1276 ScrollableArea, 1274 ScrollableArea,
1277 scrollableArea, 1275 scrollableArea,
1278 scrollableArea->IsFrameView(), 1276 scrollableArea->IsFrameView(),
1279 scrollableArea.IsFrameView()); 1277 scrollableArea.IsFrameView());
1280 1278
1281 } // namespace blink 1279 } // namespace blink
1282 1280
1283 #endif // FrameView_h 1281 #endif // FrameView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698