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

Side by Side Diff: sky/engine/core/frame/FrameView.h

Issue 682263003: Remove RenderWidget. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « sky/engine/core/editing/FrameSelection.cpp ('k') | sky/engine/core/frame/FrameView.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 reserv ed. 7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
8 8
9 This library is free software; you can redistribute it and/or 9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public 10 modify it under the terms of the GNU Library General Public
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 class Element; 46 class Element;
47 class FloatSize; 47 class FloatSize;
48 class LocalFrame; 48 class LocalFrame;
49 class KURL; 49 class KURL;
50 class Node; 50 class Node;
51 class Page; 51 class Page;
52 class RenderBox; 52 class RenderBox;
53 class RenderObject; 53 class RenderObject;
54 class RenderStyle; 54 class RenderStyle;
55 class RenderView; 55 class RenderView;
56 class RenderWidget;
57 56
58 typedef unsigned long long DOMTimeStamp; 57 typedef unsigned long long DOMTimeStamp;
59 58
60 class FrameView final : public FrameWidget { 59 class FrameView final : public FrameWidget {
61 public: 60 public:
62 friend class RenderView; 61 friend class RenderView;
63 62
64 static PassRefPtr<FrameView> create(LocalFrame*); 63 static PassRefPtr<FrameView> create(LocalFrame*);
65 static PassRefPtr<FrameView> create(LocalFrame*, const IntSize& initialSize) ; 64 static PassRefPtr<FrameView> create(LocalFrame*, const IntSize& initialSize) ;
66 65
(...skipping 21 matching lines...) Expand all
88 void setCanInvalidatePaintDuringPerformLayout(bool b) { m_canInvalidatePaint DuringPerformLayout = b; } 87 void setCanInvalidatePaintDuringPerformLayout(bool b) { m_canInvalidatePaint DuringPerformLayout = b; }
89 bool canInvalidatePaintDuringPerformLayout() const { return m_canInvalidateP aintDuringPerformLayout; } 88 bool canInvalidatePaintDuringPerformLayout() const { return m_canInvalidateP aintDuringPerformLayout; }
90 89
91 RenderObject* layoutRoot(bool onlyDuringLayout = false) const; 90 RenderObject* layoutRoot(bool onlyDuringLayout = false) const;
92 void clearLayoutSubtreeRoot() { m_layoutSubtreeRoot = 0; } 91 void clearLayoutSubtreeRoot() { m_layoutSubtreeRoot = 0; }
93 int layoutCount() const { return m_layoutCount; } 92 int layoutCount() const { return m_layoutCount; }
94 93
95 bool needsLayout() const; 94 bool needsLayout() const;
96 void setNeedsLayout(); 95 void setNeedsLayout();
97 96
98 void setNeedsUpdateWidgetPositions() { m_needsUpdateWidgetPositions = true; }
99
100 // Methods for getting/setting the size Blink should use to layout the conte nts. 97 // Methods for getting/setting the size Blink should use to layout the conte nts.
101 IntSize layoutSize(IncludeScrollbarsInRect = ExcludeScrollbars) const; 98 IntSize layoutSize(IncludeScrollbarsInRect = ExcludeScrollbars) const;
102 void setLayoutSize(const IntSize&); 99 void setLayoutSize(const IntSize&);
103 100
104 // If this is set to false, the layout size will need to be explicitly set b y the owner. 101 // If this is set to false, the layout size will need to be explicitly set b y the owner.
105 // E.g. WebViewImpl sets its mainFrame's layout size manually 102 // E.g. WebViewImpl sets its mainFrame's layout size manually
106 void setLayoutSizeFixedToFrameSize(bool isFixed) { m_layoutSizeFixedToFrameS ize = isFixed; } 103 void setLayoutSizeFixedToFrameSize(bool isFixed) { m_layoutSizeFixedToFrameS ize = isFixed; }
107 bool layoutSizeFixedToFrameSize() { return m_layoutSizeFixedToFrameSize; } 104 bool layoutSizeFixedToFrameSize() { return m_layoutSizeFixedToFrameSize; }
108 105
109 bool needsFullPaintInvalidation() const { return m_doFullPaintInvalidation; } 106 bool needsFullPaintInvalidation() const { return m_doFullPaintInvalidation; }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 AtomicString mediaType() const; 138 AtomicString mediaType() const;
142 void setMediaType(const AtomicString&); 139 void setMediaType(const AtomicString&);
143 140
144 void restoreScrollbar(); 141 void restoreScrollbar();
145 142
146 void postLayoutTimerFired(Timer<FrameView>*); 143 void postLayoutTimerFired(Timer<FrameView>*);
147 144
148 bool wasScrolledByUser() const; 145 bool wasScrolledByUser() const;
149 void setWasScrolledByUser(bool); 146 void setWasScrolledByUser(bool);
150 147
151 void addWidget(RenderWidget*);
152 void removeWidget(RenderWidget*);
153 void updateWidgetPositions();
154
155 void paintContents(GraphicsContext*, const IntRect& damageRect); 148 void paintContents(GraphicsContext*, const IntRect& damageRect);
156 void setPaintBehavior(PaintBehavior); 149 void setPaintBehavior(PaintBehavior);
157 PaintBehavior paintBehavior() const; 150 PaintBehavior paintBehavior() const;
158 bool isPainting() const; 151 bool isPainting() const;
159 bool hasEverPainted() const { return m_lastPaintTime; } 152 bool hasEverPainted() const { return m_lastPaintTime; }
160 void setNodeToDraw(Node*); 153 void setNodeToDraw(Node*);
161 154
162 Color documentBackgroundColor() const; 155 Color documentBackgroundColor() const;
163 156
164 static double currentFrameTimeStamp() { return s_currentFrameTimeStamp; } 157 static double currentFrameTimeStamp() { return s_currentFrameTimeStamp; }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 274
282 private: 275 private:
283 explicit FrameView(LocalFrame*); 276 explicit FrameView(LocalFrame*);
284 277
285 void reset(); 278 void reset();
286 void init(); 279 void init();
287 280
288 virtual void frameRectsChanged() override; 281 virtual void frameRectsChanged() override;
289 virtual bool isFrameView() const override { return true; } 282 virtual bool isFrameView() const override { return true; }
290 283
291 friend class RenderWidget;
292
293 bool contentsInCompositedLayer() const; 284 bool contentsInCompositedLayer() const;
294 285
295 void applyOverflowToViewportAndSetRenderer(RenderObject*, ScrollbarMode& hMo de, ScrollbarMode& vMode); 286 void applyOverflowToViewportAndSetRenderer(RenderObject*, ScrollbarMode& hMo de, ScrollbarMode& vMode);
296 void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow); 287 void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow);
297 288
298 void forceLayoutParentViewIfNeeded(); 289 void forceLayoutParentViewIfNeeded();
299 void performPreLayoutTasks(); 290 void performPreLayoutTasks();
300 void performLayout(RenderObject* rootForThisLayout, bool inSubtreeLayout); 291 void performLayout(RenderObject* rootForThisLayout, bool inSubtreeLayout);
301 void scheduleOrPerformPostLayoutTasks(); 292 void scheduleOrPerformPostLayoutTasks();
302 void performPostLayoutTasks(); 293 void performPostLayoutTasks();
303 294
304 void invalidateTreeIfNeeded(); 295 void invalidateTreeIfNeeded();
305 296
306 void gatherDebugLayoutRects(RenderObject* layoutRoot); 297 void gatherDebugLayoutRects(RenderObject* layoutRoot);
307 298
308 DocumentLifecycle& lifecycle() const; 299 DocumentLifecycle& lifecycle() const;
309 300
310 // FIXME(sky): Remove now that we're not a ScrollView? 301 // FIXME(sky): Remove now that we're not a ScrollView?
311 void contentRectangleForPaintInvalidation(const IntRect&); 302 void contentRectangleForPaintInvalidation(const IntRect&);
312 void contentsResized(); 303 void contentsResized();
313 void scrollbarExistenceDidChange(); 304 void scrollbarExistenceDidChange();
314 305
315 // Override ScrollView methods to do point conversion via renderers, in orde r to 306 // Override ScrollView methods to do point conversion via renderers, in orde r to
316 // take transforms into account. 307 // take transforms into account.
317 virtual IntRect convertToContainingView(const IntRect&) const override; 308 virtual IntRect convertToContainingView(const IntRect&) const override;
318 virtual IntRect convertFromContainingView(const IntRect&) const override; 309 virtual IntRect convertFromContainingView(const IntRect&) const override;
319 virtual IntPoint convertToContainingView(const IntPoint&) const override; 310 virtual IntPoint convertToContainingView(const IntPoint&) const override;
320 virtual IntPoint convertFromContainingView(const IntPoint&) const override; 311 virtual IntPoint convertFromContainingView(const IntPoint&) const override;
321 312
322 void updateWidgetPositionsIfNeeded();
323
324 bool wasViewportResized(); 313 bool wasViewportResized();
325 void sendResizeEventIfNeeded(); 314 void sendResizeEventIfNeeded();
326 315
327 void scrollPositionChanged(); 316 void scrollPositionChanged();
328 void didScrollTimerFired(Timer<FrameView>*); 317 void didScrollTimerFired(Timer<FrameView>*);
329 318
330 void updateCompositedSelectionBoundsIfNeeded(); 319 void updateCompositedSelectionBoundsIfNeeded();
331 320
332 void setLayoutSizeInternal(const IntSize&); 321 void setLayoutSizeInternal(const IntSize&);
333 322
334 bool paintInvalidationIsAllowed() const 323 bool paintInvalidationIsAllowed() const
335 { 324 {
336 return !isInPerformLayout() || canInvalidatePaintDuringPerformLayout(); 325 return !isInPerformLayout() || canInvalidatePaintDuringPerformLayout();
337 } 326 }
338 327
339 static double s_currentFrameTimeStamp; // used for detecting decoded resourc e thrash in the cache 328 static double s_currentFrameTimeStamp; // used for detecting decoded resourc e thrash in the cache
340 static bool s_inPaintContents; 329 static bool s_inPaintContents;
341 330
342 LayoutSize m_size; 331 LayoutSize m_size;
343 332
344 // FIXME: These are just "children" of the FrameView and should be RefPtr<Wi dget> instead.
345 HashSet<RefPtr<RenderWidget> > m_widgets;
346
347 RefPtr<LocalFrame> m_frame; 333 RefPtr<LocalFrame> m_frame;
348 HashSet<RefPtr<Widget> > m_children; 334 HashSet<RefPtr<Widget> > m_children;
349 335
350 bool m_doFullPaintInvalidation; 336 bool m_doFullPaintInvalidation;
351 337
352 // FIXME(sky): Remove 338 // FIXME(sky): Remove
353 bool m_canHaveScrollbars; 339 bool m_canHaveScrollbars;
354 340
355 bool m_hasPendingLayout; 341 bool m_hasPendingLayout;
356 RenderObject* m_layoutSubtreeRoot; 342 RenderObject* m_layoutSubtreeRoot;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 float m_visibleContentScaleFactor; 383 float m_visibleContentScaleFactor;
398 IntSize m_inputEventsOffsetForEmulation; 384 IntSize m_inputEventsOffsetForEmulation;
399 float m_inputEventsScaleFactorForEmulation; 385 float m_inputEventsScaleFactorForEmulation;
400 386
401 IntSize m_layoutSize; 387 IntSize m_layoutSize;
402 bool m_layoutSizeFixedToFrameSize; 388 bool m_layoutSizeFixedToFrameSize;
403 389
404 Timer<FrameView> m_didScrollTimer; 390 Timer<FrameView> m_didScrollTimer;
405 391
406 Vector<IntRect> m_tickmarks; 392 Vector<IntRect> m_tickmarks;
407
408 bool m_needsUpdateWidgetPositions;
409 }; 393 };
410 394
411 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView()); 395 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView());
412 396
413 class AllowPaintInvalidationScope { 397 class AllowPaintInvalidationScope {
414 public: 398 public:
415 explicit AllowPaintInvalidationScope(FrameView* view) 399 explicit AllowPaintInvalidationScope(FrameView* view)
416 : m_view(view) 400 : m_view(view)
417 , m_originalValue(view ? view->canInvalidatePaintDuringPerformLayout() : false) 401 , m_originalValue(view ? view->canInvalidatePaintDuringPerformLayout() : false)
418 { 402 {
(...skipping 11 matching lines...) Expand all
430 m_view->setCanInvalidatePaintDuringPerformLayout(m_originalValue); 414 m_view->setCanInvalidatePaintDuringPerformLayout(m_originalValue);
431 } 415 }
432 private: 416 private:
433 FrameView* m_view; 417 FrameView* m_view;
434 bool m_originalValue; 418 bool m_originalValue;
435 }; 419 };
436 420
437 } // namespace blink 421 } // namespace blink
438 422
439 #endif // FrameView_h 423 #endif // FrameView_h
OLDNEW
« no previous file with comments | « sky/engine/core/editing/FrameSelection.cpp ('k') | sky/engine/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698