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

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

Issue 2814643003: Remove FrameViewBase as base class of PluginView. (Closed)
Patch Set: Address final comments Created 3 years, 8 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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after
1496 void FrameView::UpdateGeometries() { 1496 void FrameView::UpdateGeometries() {
1497 Vector<RefPtr<LayoutPart>> parts; 1497 Vector<RefPtr<LayoutPart>> parts;
1498 CopyToVector(parts_, parts); 1498 CopyToVector(parts_, parts);
1499 1499
1500 for (auto part : parts) { 1500 for (auto part : parts) {
1501 // Script or plugins could detach the frame so abort processing if that 1501 // Script or plugins could detach the frame so abort processing if that
1502 // happens. 1502 // happens.
1503 if (GetLayoutViewItem().IsNull()) 1503 if (GetLayoutViewItem().IsNull())
1504 break; 1504 break;
1505 1505
1506 if (FrameViewBase* frame_view_base = part->PluginOrFrame()) { 1506 if (part->GetFrameOrPlugin()) {
1507 if (frame_view_base->IsFrameView()) { 1507 if (FrameView* frame_view = part->ChildFrameView()) {
1508 FrameView* frame_view = ToFrameView(frame_view_base);
1509 bool did_need_layout = frame_view->NeedsLayout(); 1508 bool did_need_layout = frame_view->NeedsLayout();
1510 part->UpdateGeometry(); 1509 part->UpdateGeometry();
1511 if (!did_need_layout && !frame_view->ShouldThrottleRendering()) 1510 if (!did_need_layout && !frame_view->ShouldThrottleRendering())
1512 frame_view->CheckDoesNotNeedLayout(); 1511 frame_view->CheckDoesNotNeedLayout();
1513 } else { 1512 } else {
1514 part->UpdateGeometry(); 1513 part->UpdateGeometry();
1515 } 1514 }
1516 } 1515 }
1517 } 1516 }
1518 } 1517 }
(...skipping 3239 matching lines...) Expand 10 before | Expand all | Expand 10 after
4758 SetNeedsPaintPropertyUpdate(); 4757 SetNeedsPaintPropertyUpdate();
4759 } 4758 }
4760 if (IsParentVisible()) { 4759 if (IsParentVisible()) {
4761 for (const auto& child : children_) 4760 for (const auto& child : children_)
4762 child->SetParentVisible(true); 4761 child->SetParentVisible(true);
4763 4762
4764 for (const auto& plugin : plugins_) 4763 for (const auto& plugin : plugins_)
4765 plugin->SetParentVisible(true); 4764 plugin->SetParentVisible(true);
4766 } 4765 }
4767 } 4766 }
4768
4769 FrameViewBase::Show();
4770 } 4767 }
4771 4768
4772 void FrameView::Hide() { 4769 void FrameView::Hide() {
4773 if (IsSelfVisible()) { 4770 if (IsSelfVisible()) {
4774 if (IsParentVisible()) { 4771 if (IsParentVisible()) {
4775 for (const auto& child : children_) 4772 for (const auto& child : children_)
4776 child->SetParentVisible(false); 4773 child->SetParentVisible(false);
4777 4774
4778 for (const auto& plugin : plugins_) 4775 for (const auto& plugin : plugins_)
4779 plugin->SetParentVisible(false); 4776 plugin->SetParentVisible(false);
4780 } 4777 }
4781 SetSelfVisible(false); 4778 SetSelfVisible(false);
4782 if (ScrollingCoordinator* scrolling_coordinator = 4779 if (ScrollingCoordinator* scrolling_coordinator =
4783 this->GetScrollingCoordinator()) 4780 this->GetScrollingCoordinator())
4784 scrolling_coordinator->FrameViewVisibilityDidChange(); 4781 scrolling_coordinator->FrameViewVisibilityDidChange();
4785 SetNeedsCompositingUpdate(GetLayoutViewItem(), 4782 SetNeedsCompositingUpdate(GetLayoutViewItem(),
4786 kCompositingUpdateRebuildTree); 4783 kCompositingUpdateRebuildTree);
4787 UpdateParentScrollableAreaSet(); 4784 UpdateParentScrollableAreaSet();
4788 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && 4785 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() &&
4789 !RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { 4786 !RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
4790 // The existance of scrolling properties depends on visibility through 4787 // The existance of scrolling properties depends on visibility through
4791 // isScrollable() so ensure properties are updated if visibility changes. 4788 // isScrollable() so ensure properties are updated if visibility changes.
4792 SetNeedsPaintPropertyUpdate(); 4789 SetNeedsPaintPropertyUpdate();
4793 } 4790 }
4794 } 4791 }
4795
4796 FrameViewBase::Hide();
4797 } 4792 }
4798 4793
4799 int FrameView::ViewportWidth() const { 4794 int FrameView::ViewportWidth() const {
4800 int viewport_width = GetLayoutSize(kIncludeScrollbars).Width(); 4795 int viewport_width = GetLayoutSize(kIncludeScrollbars).Width();
4801 return AdjustForAbsoluteZoom(viewport_width, GetLayoutView()); 4796 return AdjustForAbsoluteZoom(viewport_width, GetLayoutView());
4802 } 4797 }
4803 4798
4804 ScrollableArea* FrameView::GetScrollableArea() { 4799 ScrollableArea* FrameView::GetScrollableArea() {
4805 if (viewport_scrollable_area_) 4800 if (viewport_scrollable_area_)
4806 return viewport_scrollable_area_.Get(); 4801 return viewport_scrollable_area_.Get();
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
5334 void FrameView::SetAnimationHost( 5329 void FrameView::SetAnimationHost(
5335 std::unique_ptr<CompositorAnimationHost> host) { 5330 std::unique_ptr<CompositorAnimationHost> host) {
5336 animation_host_ = std::move(host); 5331 animation_host_ = std::move(host);
5337 } 5332 }
5338 5333
5339 LayoutUnit FrameView::CaretWidth() const { 5334 LayoutUnit FrameView::CaretWidth() const {
5340 return LayoutUnit(GetHostWindow()->WindowToViewportScalar(1)); 5335 return LayoutUnit(GetHostWindow()->WindowToViewportScalar(1));
5341 } 5336 }
5342 5337
5343 } // namespace blink 5338 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/frame/RemoteFrameView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698