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

Side by Side Diff: Source/core/page/Frame.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/DOMWindow.cpp ('k') | Source/core/page/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) 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 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 if (document->renderer() && document->renderer()->needsLayout() && view- >didFirstLayout()) 572 if (document->renderer() && document->renderer()->needsLayout() && view- >didFirstLayout())
573 view->layout(); 573 view->layout();
574 } 574 }
575 } 575 }
576 576
577 void Frame::deviceOrPageScaleFactorChanged() 577 void Frame::deviceOrPageScaleFactorChanged()
578 { 578 {
579 for (RefPtr<Frame> child = tree()->firstChild(); child; child = child->tree( )->nextSibling()) 579 for (RefPtr<Frame> child = tree()->firstChild(); child; child = child->tree( )->nextSibling())
580 child->deviceOrPageScaleFactorChanged(); 580 child->deviceOrPageScaleFactorChanged();
581 581
582 m_page->chrome().client()->deviceOrPageScaleFactorChanged(); 582 m_page->chrome().client().deviceOrPageScaleFactorChanged();
583 } 583 }
584 584
585 void Frame::notifyChromeClientWheelEventHandlerCountChanged() const 585 void Frame::notifyChromeClientWheelEventHandlerCountChanged() const
586 { 586 {
587 // Ensure that this method is being called on the main frame of the page. 587 // Ensure that this method is being called on the main frame of the page.
588 ASSERT(m_page && m_page->mainFrame() == this); 588 ASSERT(m_page && m_page->mainFrame() == this);
589 589
590 unsigned count = 0; 590 unsigned count = 0;
591 for (const Frame* frame = this; frame; frame = frame->tree()->traverseNext() ) { 591 for (const Frame* frame = this; frame; frame = frame->tree()->traverseNext() ) {
592 if (frame->document()) 592 if (frame->document())
593 count += frame->document()->wheelEventHandlerCount(); 593 count += frame->document()->wheelEventHandlerCount();
594 } 594 }
595 595
596 m_page->chrome().client()->numWheelEventHandlersChanged(count); 596 m_page->chrome().client().numWheelEventHandlersChanged(count);
597 } 597 }
598 598
599 bool Frame::isURLAllowed(const KURL& url) const 599 bool Frame::isURLAllowed(const KURL& url) const
600 { 600 {
601 // We allow one level of self-reference because some sites depend on that, 601 // We allow one level of self-reference because some sites depend on that,
602 // but we don't allow more than one. 602 // but we don't allow more than one.
603 if (m_page->subframeCount() >= Page::maxNumberOfFrames) 603 if (m_page->subframeCount() >= Page::maxNumberOfFrames)
604 return false; 604 return false;
605 bool foundSelfReference = false; 605 bool foundSelfReference = false;
606 for (const Frame* frame = this; frame; frame = frame->tree()->parent()) { 606 for (const Frame* frame = this; frame; frame = frame->tree()->parent()) {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 if (!m_page) 714 if (!m_page)
715 return 0; 715 return 0;
716 716
717 double ratio = m_page->deviceScaleFactor(); 717 double ratio = m_page->deviceScaleFactor();
718 if (RuntimeEnabledFeatures::devicePixelRatioIncludesZoomEnabled()) 718 if (RuntimeEnabledFeatures::devicePixelRatioIncludesZoomEnabled())
719 ratio *= pageZoomFactor(); 719 ratio *= pageZoomFactor();
720 return ratio; 720 return ratio;
721 } 721 }
722 722
723 } // namespace WebCore 723 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/DOMWindow.cpp ('k') | Source/core/page/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698