OLD | NEW |
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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 m_view = view; | 152 m_view = view; |
153 | 153 |
154 if (m_view && isMainFrame()) { | 154 if (m_view && isMainFrame()) { |
155 if (settings()->pinchVirtualViewportEnabled()) | 155 if (settings()->pinchVirtualViewportEnabled()) |
156 m_host->pinchViewport().mainFrameDidChangeSize(); | 156 m_host->pinchViewport().mainFrameDidChangeSize(); |
157 else | 157 else |
158 m_view->setVisibleContentScaleFactor(page()->pageScaleFactor()); | 158 m_view->setVisibleContentScaleFactor(page()->pageScaleFactor()); |
159 } | 159 } |
160 } | 160 } |
161 | 161 |
| 162 void LocalFrame::sendOrientationChangeEvent() |
| 163 { |
| 164 if (!RuntimeEnabledFeatures::orientationEventEnabled() && !RuntimeEnabledFea
tures::screenOrientationEnabled()) |
| 165 return; |
| 166 |
| 167 if (page()->visibilityState() != PageVisibilityStateVisible) |
| 168 return; |
| 169 |
| 170 LocalDOMWindow* window = domWindow(); |
| 171 if (!window) |
| 172 return; |
| 173 window->dispatchEvent(Event::create(EventTypeNames::orientationchange)); |
| 174 |
| 175 // Notify subframes. |
| 176 Vector<RefPtr<LocalFrame> > childFrames; |
| 177 for (Frame* child = tree().firstChild(); child; child = child->tree().nextSi
bling()) { |
| 178 if (child->isLocalFrame()) |
| 179 childFrames.append(toLocalFrame(child)); |
| 180 } |
| 181 |
| 182 for (size_t i = 0; i < childFrames.size(); ++i) |
| 183 childFrames[i]->sendOrientationChangeEvent(); |
| 184 } |
| 185 |
162 void LocalFrame::setPrinting(bool printing, const FloatSize& pageSize, const Flo
atSize& originalPageSize, float maximumShrinkRatio) | 186 void LocalFrame::setPrinting(bool printing, const FloatSize& pageSize, const Flo
atSize& originalPageSize, float maximumShrinkRatio) |
163 { | 187 { |
164 // In setting printing, we should not validate resources already cached for
the document. | 188 // In setting printing, we should not validate resources already cached for
the document. |
165 // See https://bugs.webkit.org/show_bug.cgi?id=43704 | 189 // See https://bugs.webkit.org/show_bug.cgi?id=43704 |
166 ResourceCacheValidationSuppressor validationSuppressor(document()->fetcher()
); | 190 ResourceCacheValidationSuppressor validationSuppressor(document()->fetcher()
); |
167 | 191 |
168 document()->setPrinting(printing); | 192 document()->setPrinting(printing); |
169 view()->adjustMediaTypeForPrinting(printing); | 193 view()->adjustMediaTypeForPrinting(printing); |
170 | 194 |
171 document()->styleResolverChanged(); | 195 document()->styleResolverChanged(); |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 LocalFrame* LocalFrame::localFrameRoot() | 645 LocalFrame* LocalFrame::localFrameRoot() |
622 { | 646 { |
623 LocalFrame* curFrame = this; | 647 LocalFrame* curFrame = this; |
624 while (curFrame && curFrame->tree().parent() && curFrame->tree().parent()->i
sLocalFrame()) | 648 while (curFrame && curFrame->tree().parent() && curFrame->tree().parent()->i
sLocalFrame()) |
625 curFrame = toLocalFrame(curFrame->tree().parent()); | 649 curFrame = toLocalFrame(curFrame->tree().parent()); |
626 | 650 |
627 return curFrame; | 651 return curFrame; |
628 } | 652 } |
629 | 653 |
630 } // namespace WebCore | 654 } // namespace WebCore |
OLD | NEW |