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

Side by Side Diff: Source/core/frame/LocalFrame.cpp

Issue 277413002: Make screen.orientation implementation use WebScreenInfo::orientationType (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Improve test Created 6 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
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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 if (m_view && isMainFrame()) { 157 if (m_view && isMainFrame()) {
158 if (settings()->pinchVirtualViewportEnabled()) 158 if (settings()->pinchVirtualViewportEnabled())
159 m_host->pinchViewport().mainFrameDidChangeSize(); 159 m_host->pinchViewport().mainFrameDidChangeSize();
160 else 160 else
161 m_view->setVisibleContentScaleFactor(page()->pageScaleFactor()); 161 m_view->setVisibleContentScaleFactor(page()->pageScaleFactor());
162 } 162 }
163 } 163 }
164 164
165 void LocalFrame::sendOrientationChangeEvent() 165 void LocalFrame::sendOrientationChangeEvent()
166 { 166 {
167 if (!RuntimeEnabledFeatures::orientationEventEnabled()) 167 if (!RuntimeEnabledFeatures::orientationEventEnabled() && !RuntimeEnabledFea tures::screenOrientationEnabled())
168 return; 168 return;
169 169
170 if (DOMWindow* window = domWindow()) 170 if (DOMWindow* window = domWindow()) {
171 window->dispatchEvent(Event::create(EventTypeNames::orientationchange)); 171 window->dispatchEvent(Event::create(EventTypeNames::orientationchange));
172 // Notify subframes.
173 for (RefPtr<LocalFrame> child = tree().firstChild(); child; child = chil d->tree().nextSibling())
174 child->sendOrientationChangeEvent();
mlamouri (slow - plz ping) 2014/05/20 20:09:26 I would prefer having that in Page to prevent the
jochen (gone - plz use gerrit) 2014/05/26 10:02:11 when iterating over the tree and dispatching event
Inactive 2014/05/27 14:22:15 Good point, sorry I missed that. I fixed it.
175 }
172 } 176 }
173 177
174 void LocalFrame::setPrinting(bool printing, const FloatSize& pageSize, const Flo atSize& originalPageSize, float maximumShrinkRatio) 178 void LocalFrame::setPrinting(bool printing, const FloatSize& pageSize, const Flo atSize& originalPageSize, float maximumShrinkRatio)
175 { 179 {
176 // In setting printing, we should not validate resources already cached for the document. 180 // In setting printing, we should not validate resources already cached for the document.
177 // See https://bugs.webkit.org/show_bug.cgi?id=43704 181 // See https://bugs.webkit.org/show_bug.cgi?id=43704
178 ResourceCacheValidationSuppressor validationSuppressor(document()->fetcher() ); 182 ResourceCacheValidationSuppressor validationSuppressor(document()->fetcher() );
179 183
180 document()->setPrinting(printing); 184 document()->setPrinting(printing);
181 view()->adjustMediaTypeForPrinting(printing); 185 view()->adjustMediaTypeForPrinting(printing);
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 LocalFrame* LocalFrame::localFrameRoot() 645 LocalFrame* LocalFrame::localFrameRoot()
642 { 646 {
643 LocalFrame* curFrame = this; 647 LocalFrame* curFrame = this;
644 while (curFrame && curFrame->tree().parent() && curFrame->tree().parent()->i sLocalFrame()) 648 while (curFrame && curFrame->tree().parent() && curFrame->tree().parent()->i sLocalFrame())
645 curFrame = curFrame->tree().parent(); 649 curFrame = curFrame->tree().parent();
646 650
647 return curFrame; 651 return curFrame;
648 } 652 }
649 653
650 } // namespace WebCore 654 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698