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

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

Issue 280283002: Stop firing orientationchange events at pages that are not visible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Take feedback into consideration Created 6 years, 6 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 else 159 else
160 m_view->setVisibleContentScaleFactor(page()->pageScaleFactor()); 160 m_view->setVisibleContentScaleFactor(page()->pageScaleFactor());
161 } 161 }
162 } 162 }
163 163
164 void LocalFrame::sendOrientationChangeEvent() 164 void LocalFrame::sendOrientationChangeEvent()
165 { 165 {
166 if (!RuntimeEnabledFeatures::orientationEventEnabled() && !RuntimeEnabledFea tures::screenOrientationEnabled()) 166 if (!RuntimeEnabledFeatures::orientationEventEnabled() && !RuntimeEnabledFea tures::screenOrientationEnabled())
167 return; 167 return;
168 168
169 if (page()->visibilityState() != PageVisibilityStateVisible)
170 return;
171
169 DOMWindow* window = domWindow(); 172 DOMWindow* window = domWindow();
170 if (!window) 173 if (!window)
171 return; 174 return;
172 window->dispatchEvent(Event::create(EventTypeNames::orientationchange)); 175 window->dispatchEvent(Event::create(EventTypeNames::orientationchange));
173 176
174 // Notify subframes. 177 // Notify subframes.
175 Vector<RefPtr<LocalFrame> > childFrames; 178 Vector<RefPtr<LocalFrame> > childFrames;
176 for (LocalFrame* child = tree().firstChild(); child; child = child->tree().n extSibling()) 179 for (LocalFrame* child = tree().firstChild(); child; child = child->tree().n extSibling())
177 childFrames.append(child); 180 childFrames.append(child);
178 181
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 LocalFrame* LocalFrame::localFrameRoot() 653 LocalFrame* LocalFrame::localFrameRoot()
651 { 654 {
652 LocalFrame* curFrame = this; 655 LocalFrame* curFrame = this;
653 while (curFrame && curFrame->tree().parent() && curFrame->tree().parent()->i sLocalFrame()) 656 while (curFrame && curFrame->tree().parent() && curFrame->tree().parent()->i sLocalFrame())
654 curFrame = curFrame->tree().parent(); 657 curFrame = curFrame->tree().parent();
655 658
656 return curFrame; 659 return curFrame;
657 } 660 }
658 661
659 } // namespace WebCore 662 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/screen_orientation/page-visibility.html ('k') | Source/modules/screen_orientation/ScreenOrientationController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698