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

Side by Side Diff: Source/core/page/FrameView.cpp

Issue 22955006: Chrome::client() should return a ChromeClient reference. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/page/Frame.cpp ('k') | Source/core/page/PageConsole.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) 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 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 #endif 1087 #endif
1088 1088
1089 // FIXME: It should be not possible to remove the FrameView from the frame/p age during layout 1089 // FIXME: It should be not possible to remove the FrameView from the frame/p age during layout
1090 // however m_inLayout is not set for most of this function, so none of our R ELEASE_ASSERTS 1090 // however m_inLayout is not set for most of this function, so none of our R ELEASE_ASSERTS
1091 // in Frame/Page will fire. One of the post-layout tasks is disconnecting th e Frame from 1091 // in Frame/Page will fire. One of the post-layout tasks is disconnecting th e Frame from
1092 // the page in fast/frames/crash-remove-iframe-during-object-beforeload-2.ht ml 1092 // the page in fast/frames/crash-remove-iframe-during-object-beforeload-2.ht ml
1093 // necessitating this check here. 1093 // necessitating this check here.
1094 ASSERT(frame()); 1094 ASSERT(frame());
1095 // ASSERT(frame()->page()); 1095 // ASSERT(frame()->page());
1096 if (frame() && frame()->page()) 1096 if (frame() && frame()->page())
1097 frame()->page()->chrome().client()->layoutUpdated(frame()); 1097 frame()->page()->chrome().client().layoutUpdated(frame());
1098 } 1098 }
1099 1099
1100 RenderBox* FrameView::embeddedContentBox() const 1100 RenderBox* FrameView::embeddedContentBox() const
1101 { 1101 {
1102 RenderView* renderView = this->renderView(); 1102 RenderView* renderView = this->renderView();
1103 if (!renderView) 1103 if (!renderView)
1104 return 0; 1104 return 0;
1105 1105
1106 RenderObject* firstChild = renderView->firstChild(); 1106 RenderObject* firstChild = renderView->firstChild();
1107 if (!firstChild || !firstChild->isBox()) 1107 if (!firstChild || !firstChild->isBox())
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
1508 TemporaryChange<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, tru e); 1508 TemporaryChange<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, tru e);
1509 m_maintainScrollPositionAnchor = 0; 1509 m_maintainScrollPositionAnchor = 0;
1510 1510
1511 IntPoint newScrollPosition = adjustScrollPositionWithinRange(scrollPoint); 1511 IntPoint newScrollPosition = adjustScrollPositionWithinRange(scrollPoint);
1512 1512
1513 if (newScrollPosition == scrollPosition()) 1513 if (newScrollPosition == scrollPosition())
1514 return; 1514 return;
1515 1515
1516 Page* page = m_frame->page(); 1516 Page* page = m_frame->page();
1517 if (page && RuntimeEnabledFeatures::programmaticScrollNotificationsEnabled() ) 1517 if (page && RuntimeEnabledFeatures::programmaticScrollNotificationsEnabled() )
1518 page->chrome().client()->didProgrammaticallyScroll(m_frame.get(), newScr ollPosition); 1518 page->chrome().client().didProgrammaticallyScroll(m_frame.get(), newScro llPosition);
1519 1519
1520 if (requestScrollPositionUpdate(newScrollPosition)) 1520 if (requestScrollPositionUpdate(newScrollPosition))
1521 return; 1521 return;
1522 1522
1523 ScrollView::setScrollPosition(newScrollPosition); 1523 ScrollView::setScrollPosition(newScrollPosition);
1524 } 1524 }
1525 1525
1526 void FrameView::setScrollPositionNonProgrammatically(const IntPoint& scrollPoint ) 1526 void FrameView::setScrollPositionNonProgrammatically(const IntPoint& scrollPoint )
1527 { 1527 {
1528 IntPoint newScrollPosition = adjustScrollPositionWithinRange(scrollPoint); 1528 IntPoint newScrollPosition = adjustScrollPositionWithinRange(scrollPoint);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
1576 if (RenderView* renderView = this->renderView()) 1576 if (RenderView* renderView = this->renderView())
1577 renderView->compositor()->updateCompositingLayers(CompositingUpdateO nScroll); 1577 renderView->compositor()->updateCompositingLayers(CompositingUpdateO nScroll);
1578 } 1578 }
1579 } 1579 }
1580 1580
1581 bool FrameView::shouldRubberBandInDirection(ScrollDirection direction) const 1581 bool FrameView::shouldRubberBandInDirection(ScrollDirection direction) const
1582 { 1582 {
1583 Page* page = frame() ? frame()->page() : 0; 1583 Page* page = frame() ? frame()->page() : 0;
1584 if (!page) 1584 if (!page)
1585 return ScrollView::shouldRubberBandInDirection(direction); 1585 return ScrollView::shouldRubberBandInDirection(direction);
1586 return page->chrome().client()->shouldRubberBandInDirection(direction); 1586 return page->chrome().client().shouldRubberBandInDirection(direction);
1587 } 1587 }
1588 1588
1589 bool FrameView::isRubberBandInProgress() const 1589 bool FrameView::isRubberBandInProgress() const
1590 { 1590 {
1591 if (scrollbarsSuppressed()) 1591 if (scrollbarsSuppressed())
1592 return false; 1592 return false;
1593 1593
1594 // If the main thread updates the scroll position for this FrameView, we sho uld return 1594 // If the main thread updates the scroll position for this FrameView, we sho uld return
1595 // ScrollAnimator::isRubberBandInProgress(). 1595 // ScrollAnimator::isRubberBandInProgress().
1596 if (ScrollAnimator* scrollAnimator = existingScrollAnimator()) 1596 if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
2618 void FrameView::updateAnnotatedRegions() 2618 void FrameView::updateAnnotatedRegions()
2619 { 2619 {
2620 Document* document = m_frame->document(); 2620 Document* document = m_frame->document();
2621 if (!document->hasAnnotatedRegions()) 2621 if (!document->hasAnnotatedRegions())
2622 return; 2622 return;
2623 Vector<AnnotatedRegionValue> newRegions; 2623 Vector<AnnotatedRegionValue> newRegions;
2624 document->renderBox()->collectAnnotatedRegions(newRegions); 2624 document->renderBox()->collectAnnotatedRegions(newRegions);
2625 if (newRegions == document->annotatedRegions()) 2625 if (newRegions == document->annotatedRegions())
2626 return; 2626 return;
2627 document->setAnnotatedRegions(newRegions); 2627 document->setAnnotatedRegions(newRegions);
2628 Page* page = m_frame->page(); 2628 if (Page* page = m_frame->page())
2629 if (!page) 2629 page->chrome().client().annotatedRegionsChanged();
2630 return;
2631 page->chrome().client()->annotatedRegionsChanged();
2632 } 2630 }
2633 2631
2634 void FrameView::updateScrollCorner() 2632 void FrameView::updateScrollCorner()
2635 { 2633 {
2636 RefPtr<RenderStyle> cornerStyle; 2634 RefPtr<RenderStyle> cornerStyle;
2637 IntRect cornerRect = scrollCornerRect(); 2635 IntRect cornerRect = scrollCornerRect();
2638 Document* doc = m_frame->document(); 2636 Document* doc = m_frame->document();
2639 2637
2640 if (doc && !cornerRect.isEmpty()) { 2638 if (doc && !cornerRect.isEmpty()) {
2641 // Try the <body> element first as a scroll corner source. 2639 // Try the <body> element first as a scroll corner source.
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
2925 void FrameView::paintOverhangAreas(GraphicsContext* context, const IntRect& hori zontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRec t) 2923 void FrameView::paintOverhangAreas(GraphicsContext* context, const IntRect& hori zontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRec t)
2926 { 2924 {
2927 if (context->paintingDisabled()) 2925 if (context->paintingDisabled())
2928 return; 2926 return;
2929 2927
2930 if (m_frame->document()->printing()) 2928 if (m_frame->document()->printing())
2931 return; 2929 return;
2932 2930
2933 Page* page = m_frame->page(); 2931 Page* page = m_frame->page();
2934 if (page->mainFrame() == m_frame) { 2932 if (page->mainFrame() == m_frame) {
2935 if (page->chrome().client()->paintCustomOverhangArea(context, horizontal OverhangArea, verticalOverhangArea, dirtyRect)) 2933 if (page->chrome().client().paintCustomOverhangArea(context, horizontalO verhangArea, verticalOverhangArea, dirtyRect))
2936 return; 2934 return;
2937 } 2935 }
2938 2936
2939 ScrollView::paintOverhangAreas(context, horizontalOverhangArea, verticalOver hangArea, dirtyRect); 2937 ScrollView::paintOverhangAreas(context, horizontalOverhangArea, verticalOver hangArea, dirtyRect);
2940 } 2938 }
2941 2939
2942 void FrameView::updateLayoutAndStyleIfNeededRecursive() 2940 void FrameView::updateLayoutAndStyleIfNeededRecursive()
2943 { 2941 {
2944 // We have to crawl our entire tree looking for any FrameViews that need 2942 // We have to crawl our entire tree looking for any FrameViews that need
2945 // layout and make sure they are up to date. 2943 // layout and make sure they are up to date.
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
3344 } 3342 }
3345 3343
3346 AXObjectCache* FrameView::axObjectCache() const 3344 AXObjectCache* FrameView::axObjectCache() const
3347 { 3345 {
3348 if (frame() && frame()->document()) 3346 if (frame() && frame()->document())
3349 return frame()->document()->existingAXObjectCache(); 3347 return frame()->document()->existingAXObjectCache();
3350 return 0; 3348 return 0;
3351 } 3349 }
3352 3350
3353 } // namespace WebCore 3351 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/Frame.cpp ('k') | Source/core/page/PageConsole.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698