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

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

Issue 15820002: Page::chrome() should return a reference. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/page/FocusController.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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 m_doc->attach(); 289 m_doc->attach();
290 290
291 if (m_doc) { 291 if (m_doc) {
292 m_script->updateDocument(); 292 m_script->updateDocument();
293 m_doc->updateViewportArguments(); 293 m_doc->updateViewportArguments();
294 } 294 }
295 295
296 if (m_page && m_page->mainFrame() == this) { 296 if (m_page && m_page->mainFrame() == this) {
297 notifyChromeClientWheelEventHandlerCountChanged(); 297 notifyChromeClientWheelEventHandlerCountChanged();
298 if (m_doc && m_doc->hasTouchEventHandlers()) 298 if (m_doc && m_doc->hasTouchEventHandlers())
299 m_page->chrome()->client()->needTouchEvents(true); 299 m_page->chrome().client()->needTouchEvents(true);
300 } 300 }
301 } 301 }
302 302
303 #if ENABLE(ORIENTATION_EVENTS) 303 #if ENABLE(ORIENTATION_EVENTS)
304 void Frame::sendOrientationChangeEvent(int orientation) 304 void Frame::sendOrientationChangeEvent(int orientation)
305 { 305 {
306 m_orientation = orientation; 306 m_orientation = orientation;
307 if (Document* doc = document()) 307 if (Document* doc = document())
308 doc->dispatchWindowEvent(Event::create(eventNames().orientationchangeEve nt, false, false)); 308 doc->dispatchWindowEvent(Event::create(eventNames().orientationchangeEve nt, false, false));
309 } 309 }
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 if (document->renderer() && document->renderer()->needsLayout() && view- >didFirstLayout()) 644 if (document->renderer() && document->renderer()->needsLayout() && view- >didFirstLayout())
645 view->layout(); 645 view->layout();
646 } 646 }
647 } 647 }
648 648
649 void Frame::deviceOrPageScaleFactorChanged() 649 void Frame::deviceOrPageScaleFactorChanged()
650 { 650 {
651 for (RefPtr<Frame> child = tree()->firstChild(); child; child = child->tree( )->nextSibling()) 651 for (RefPtr<Frame> child = tree()->firstChild(); child; child = child->tree( )->nextSibling())
652 child->deviceOrPageScaleFactorChanged(); 652 child->deviceOrPageScaleFactorChanged();
653 653
654 m_page->chrome()->client()->deviceOrPageScaleFactorChanged(); 654 m_page->chrome().client()->deviceOrPageScaleFactorChanged();
655 } 655 }
656 656
657 void Frame::notifyChromeClientWheelEventHandlerCountChanged() const 657 void Frame::notifyChromeClientWheelEventHandlerCountChanged() const
658 { 658 {
659 // Ensure that this method is being called on the main frame of the page. 659 // Ensure that this method is being called on the main frame of the page.
660 ASSERT(m_page && m_page->mainFrame() == this); 660 ASSERT(m_page && m_page->mainFrame() == this);
661 661
662 unsigned count = 0; 662 unsigned count = 0;
663 for (const Frame* frame = this; frame; frame = frame->tree()->traverseNext() ) { 663 for (const Frame* frame = this; frame; frame = frame->tree()->traverseNext() ) {
664 if (frame->document()) 664 if (frame->document())
665 count += frame->document()->wheelEventHandlerCount(); 665 count += frame->document()->wheelEventHandlerCount();
666 } 666 }
667 667
668 m_page->chrome()->client()->numWheelEventHandlersChanged(count); 668 m_page->chrome().client()->numWheelEventHandlersChanged(count);
669 } 669 }
670 670
671 bool Frame::isURLAllowed(const KURL& url) const 671 bool Frame::isURLAllowed(const KURL& url) const
672 { 672 {
673 // We allow one level of self-reference because some sites depend on that, 673 // We allow one level of self-reference because some sites depend on that,
674 // but we don't allow more than one. 674 // but we don't allow more than one.
675 if (m_page->subframeCount() >= Page::maxNumberOfFrames) 675 if (m_page->subframeCount() >= Page::maxNumberOfFrames)
676 return false; 676 return false;
677 bool foundSelfReference = false; 677 bool foundSelfReference = false;
678 for (const Frame* frame = this; frame; frame = frame->tree()->parent()) { 678 for (const Frame* frame = this; frame; frame = frame->tree()->parent()) {
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 buffer->context()->translate(-paintingRect.x(), -paintingRect.y()); 775 buffer->context()->translate(-paintingRect.x(), -paintingRect.y());
776 buffer->context()->clip(FloatRect(0, 0, paintingRect.maxX(), paintingRect.ma xY())); 776 buffer->context()->clip(FloatRect(0, 0, paintingRect.maxX(), paintingRect.ma xY()));
777 777
778 m_view->paintContents(buffer->context(), paintingRect); 778 m_view->paintContents(buffer->context(), paintingRect);
779 779
780 RefPtr<Image> image = buffer->copyImage(); 780 RefPtr<Image> image = buffer->copyImage();
781 return createDragImageFromImage(image.get()); 781 return createDragImageFromImage(image.get());
782 } 782 }
783 783
784 } // namespace WebCore 784 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/FocusController.cpp ('k') | Source/core/page/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698