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

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp

Issue 2832093003: Implement screen orientation for out-of-process iframes. (Closed)
Patch Set: add comments Created 3 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
« no previous file with comments | « content/renderer/render_widget.cc ('k') | no next file » | 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) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 statusbar_ = nullptr; 522 statusbar_ = nullptr;
523 toolbar_ = nullptr; 523 toolbar_ = nullptr;
524 navigator_ = nullptr; 524 navigator_ = nullptr;
525 media_ = nullptr; 525 media_ = nullptr;
526 custom_elements_ = nullptr; 526 custom_elements_ = nullptr;
527 application_cache_ = nullptr; 527 application_cache_ = nullptr;
528 } 528 }
529 529
530 void LocalDOMWindow::SendOrientationChangeEvent() { 530 void LocalDOMWindow::SendOrientationChangeEvent() {
531 ASSERT(RuntimeEnabledFeatures::orientationEventEnabled()); 531 ASSERT(RuntimeEnabledFeatures::orientationEventEnabled());
532 ASSERT(GetFrame()->IsMainFrame()); 532 DCHECK(GetFrame()->IsLocalRoot());
533 533
534 // Before dispatching the event, build a list of all frames in the page 534 // Before dispatching the event, build a list of all frames in the page
535 // to send the event to, to mitigate side effects from event handlers 535 // to send the event to, to mitigate side effects from event handlers
536 // potentially interfering with others. 536 // potentially interfering with others.
537 HeapVector<Member<Frame>> frames; 537 HeapVector<Member<LocalFrame>> frames;
538 for (Frame* f = GetFrame(); f; f = f->Tree().TraverseNext()) 538 frames.push_back(GetFrame());
539 frames.push_back(f); 539 for (size_t i = 0; i < frames.size(); i++) {
540 for (Frame* child = frames[i]->Tree().FirstChild(); child;
541 child = child->Tree().NextSibling()) {
542 if (child->IsLocalFrame())
543 frames.push_back(ToLocalFrame(child));
544 }
545 }
540 546
541 for (size_t i = 0; i < frames.size(); ++i) { 547 for (LocalFrame* frame : frames) {
542 if (!frames[i]->IsLocalFrame()) 548 frame->DomWindow()->DispatchEvent(
543 continue; 549 Event::Create(EventTypeNames::orientationchange));
544 ToLocalFrame(frames[i].Get())
545 ->DomWindow()
546 ->DispatchEvent(Event::Create(EventTypeNames::orientationchange));
547 } 550 }
548 } 551 }
549 552
550 int LocalDOMWindow::orientation() const { 553 int LocalDOMWindow::orientation() const {
551 ASSERT(RuntimeEnabledFeatures::orientationEventEnabled()); 554 ASSERT(RuntimeEnabledFeatures::orientationEventEnabled());
552 555
553 if (!GetFrame() || !GetFrame()->GetPage()) 556 if (!GetFrame() || !GetFrame()->GetPage())
554 return 0; 557 return 0;
555 558
556 int orientation = GetFrame() 559 int orientation = GetFrame()
(...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1684 DOMWindow::Trace(visitor); 1687 DOMWindow::Trace(visitor);
1685 Supplementable<LocalDOMWindow>::Trace(visitor); 1688 Supplementable<LocalDOMWindow>::Trace(visitor);
1686 } 1689 }
1687 1690
1688 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { 1691 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) {
1689 visitor->TraceWrappers(custom_elements_); 1692 visitor->TraceWrappers(custom_elements_);
1690 DOMWindow::TraceWrappers(visitor); 1693 DOMWindow::TraceWrappers(visitor);
1691 } 1694 }
1692 1695
1693 } // namespace blink 1696 } // namespace blink
OLDNEW
« no previous file with comments | « content/renderer/render_widget.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698