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

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

Issue 2883033003: Propagate inert state to OOPIFs when a modal dialog is active (Closed)
Patch Set: Fix test crash Created 3 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
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 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
9 * rights reserved. 9 * rights reserved.
10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 return LayoutViewItem(ContentLayoutObject()); 564 return LayoutViewItem(ContentLayoutObject());
565 } 565 }
566 566
567 void LocalFrame::DidChangeVisibilityState() { 567 void LocalFrame::DidChangeVisibilityState() {
568 if (GetDocument()) 568 if (GetDocument())
569 GetDocument()->DidChangeVisibilityState(); 569 GetDocument()->DidChangeVisibilityState();
570 570
571 Frame::DidChangeVisibilityState(); 571 Frame::DidChangeVisibilityState();
572 } 572 }
573 573
574 void LocalFrame::SetIsInert(bool inert) {
575 is_inert_ = inert;
576 PropagateInertToChildFrames();
577 }
578
579 void LocalFrame::PropagateInertToChildFrames() {
580 for (Frame* child = Tree().FirstChild(); child;
581 child = child->Tree().NextSibling()) {
582 if (child->Owner()) {
583 DCHECK(child->Owner()->IsLocal());
584 child->SetIsInert(is_inert_ ||
585 ToHTMLFrameOwnerElement(child->Owner())->IsInert());
586 }
587 }
588 }
589
574 LocalFrame& LocalFrame::LocalFrameRoot() const { 590 LocalFrame& LocalFrame::LocalFrameRoot() const {
575 const LocalFrame* cur_frame = this; 591 const LocalFrame* cur_frame = this;
576 while (cur_frame && cur_frame->Tree().Parent() && 592 while (cur_frame && cur_frame->Tree().Parent() &&
577 cur_frame->Tree().Parent()->IsLocalFrame()) 593 cur_frame->Tree().Parent()->IsLocalFrame())
578 cur_frame = ToLocalFrame(cur_frame->Tree().Parent()); 594 cur_frame = ToLocalFrame(cur_frame->Tree().Parent());
579 595
580 return const_cast<LocalFrame&>(*cur_frame); 596 return const_cast<LocalFrame&>(*cur_frame);
581 } 597 }
582 598
583 bool LocalFrame::IsCrossOriginSubframe() const { 599 bool LocalFrame::IsCrossOriginSubframe() const {
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 editor_(Editor::Create(*this)), 908 editor_(Editor::Create(*this)),
893 spell_checker_(SpellChecker::Create(*this)), 909 spell_checker_(SpellChecker::Create(*this)),
894 selection_(FrameSelection::Create(*this)), 910 selection_(FrameSelection::Create(*this)),
895 event_handler_(new EventHandler(*this)), 911 event_handler_(new EventHandler(*this)),
896 console_(FrameConsole::Create(*this)), 912 console_(FrameConsole::Create(*this)),
897 input_method_controller_(InputMethodController::Create(*this)), 913 input_method_controller_(InputMethodController::Create(*this)),
898 navigation_disable_count_(0), 914 navigation_disable_count_(0),
899 page_zoom_factor_(ParentPageZoomFactor(this)), 915 page_zoom_factor_(ParentPageZoomFactor(this)),
900 text_zoom_factor_(ParentTextZoomFactor(this)), 916 text_zoom_factor_(ParentTextZoomFactor(this)),
901 in_view_source_mode_(false), 917 in_view_source_mode_(false),
918 is_inert_(false),
902 interface_provider_(interface_provider), 919 interface_provider_(interface_provider),
903 interface_registry_(interface_registry) { 920 interface_registry_(interface_registry) {
904 if (IsLocalRoot()) { 921 if (IsLocalRoot()) {
905 probe_sink_ = new CoreProbeSink(); 922 probe_sink_ = new CoreProbeSink();
906 performance_monitor_ = new PerformanceMonitor(this); 923 performance_monitor_ = new PerformanceMonitor(this);
907 } else { 924 } else {
908 probe_sink_ = LocalFrameRoot().probe_sink_; 925 probe_sink_ = LocalFrameRoot().probe_sink_;
909 performance_monitor_ = LocalFrameRoot().performance_monitor_; 926 performance_monitor_ = LocalFrameRoot().performance_monitor_;
910 } 927 }
911 } 928 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 WebURLRequest::kClientLoFiOn); 986 WebURLRequest::kClientLoFiOn);
970 params.SetAllowImagePlaceholder(); 987 params.SetAllowImagePlaceholder();
971 } 988 }
972 } 989 }
973 990
974 std::unique_ptr<WebURLLoader> LocalFrame::CreateURLLoader() { 991 std::unique_ptr<WebURLLoader> LocalFrame::CreateURLLoader() {
975 return Client()->CreateURLLoader(); 992 return Client()->CreateURLLoader();
976 } 993 }
977 994
978 } // namespace blink 995 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698