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

Side by Side Diff: Source/core/html/HTMLPlugInElement.cpp

Issue 139743005: Replace RenderFullScreen with top layer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: needs baseline Created 6 years, 11 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de)
5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. 5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 , m_NPObject(0) 61 , m_NPObject(0)
62 , m_isCapturingMouseEvents(false) 62 , m_isCapturingMouseEvents(false)
63 , m_inBeforeLoadEventHandler(false) 63 , m_inBeforeLoadEventHandler(false)
64 // m_needsWidgetUpdate(!createdByParser) allows HTMLObjectElement to delay 64 // m_needsWidgetUpdate(!createdByParser) allows HTMLObjectElement to delay
65 // widget updates until after all children are parsed. For HTMLEmbedElement 65 // widget updates until after all children are parsed. For HTMLEmbedElement
66 // this delay is unnecessary, but it is simpler to make both classes share 66 // this delay is unnecessary, but it is simpler to make both classes share
67 // the same codepath in this class. 67 // the same codepath in this class.
68 , m_needsWidgetUpdate(!createdByParser) 68 , m_needsWidgetUpdate(!createdByParser)
69 , m_shouldPreferPlugInsForImages(preferPlugInsForImagesOption == ShouldPrefe rPlugInsForImages) 69 , m_shouldPreferPlugInsForImages(preferPlugInsForImagesOption == ShouldPrefe rPlugInsForImages)
70 , m_displayState(Playing) 70 , m_displayState(Playing)
71 , m_protectWidgetDuringReattach(0)
71 { 72 {
72 setHasCustomStyleCallbacks(); 73 setHasCustomStyleCallbacks();
73 } 74 }
74 75
75 HTMLPlugInElement::~HTMLPlugInElement() 76 HTMLPlugInElement::~HTMLPlugInElement()
76 { 77 {
77 ASSERT(!m_pluginWrapper); // cleared in detach() 78 ASSERT(!m_pluginWrapper); // cleared in detach()
78 ASSERT(!m_isDelayingLoadEvent); 79 ASSERT(!m_isDelayingLoadEvent);
79 80
80 if (m_NPObject) { 81 if (m_NPObject) {
(...skipping 30 matching lines...) Expand all
111 m_imageLoader->elementDidMoveToNewDocument(); 112 m_imageLoader->elementDidMoveToNewDocument();
112 HTMLFrameOwnerElement::didMoveToNewDocument(oldDocument); 113 HTMLFrameOwnerElement::didMoveToNewDocument(oldDocument);
113 } 114 }
114 115
115 void HTMLPlugInElement::attach(const AttachContext& context) 116 void HTMLPlugInElement::attach(const AttachContext& context)
116 { 117 {
117 HTMLFrameOwnerElement::attach(context); 118 HTMLFrameOwnerElement::attach(context);
118 119
119 if (!renderer() || useFallbackContent()) 120 if (!renderer() || useFallbackContent())
120 return; 121 return;
122
123 if (m_protectWidgetDuringReattach) {
124 if (RenderEmbeddedObject* object = renderEmbeddedObject()) {
125 setNeedsWidgetUpdate(false);
126 object->setWidget(m_protectWidgetDuringReattach.get());
127 }
128 m_protectWidgetDuringReattach.clear();
129 return;
130 }
131
121 if (isImageType()) { 132 if (isImageType()) {
122 if (!m_imageLoader) 133 if (!m_imageLoader)
123 m_imageLoader = adoptPtr(new HTMLImageLoader(this)); 134 m_imageLoader = adoptPtr(new HTMLImageLoader(this));
124 m_imageLoader->updateFromElement(); 135 m_imageLoader->updateFromElement();
125 } else if (needsWidgetUpdate() 136 } else if (needsWidgetUpdate()
126 && renderEmbeddedObject() 137 && renderEmbeddedObject()
127 && !renderEmbeddedObject()->showsUnavailablePluginIndicator() 138 && !renderEmbeddedObject()->showsUnavailablePluginIndicator()
128 && !wouldLoadAsNetscapePlugin(m_url, m_serviceType) 139 && !wouldLoadAsNetscapePlugin(m_url, m_serviceType)
129 && !m_isDelayingLoadEvent) { 140 && !m_isDelayingLoadEvent) {
130 m_isDelayingLoadEvent = true; 141 m_isDelayingLoadEvent = true;
131 document().incrementLoadEventDelayCount(); 142 document().incrementLoadEventDelayCount();
132 } 143 }
133 } 144 }
134 145
135 void HTMLPlugInElement::updateWidget() 146 void HTMLPlugInElement::updateWidget()
136 { 147 {
137 RefPtr<HTMLPlugInElement> protector(this); 148 RefPtr<HTMLPlugInElement> protector(this);
138 updateWidgetInternal(); 149 updateWidgetInternal();
139 if (m_isDelayingLoadEvent) { 150 if (m_isDelayingLoadEvent) {
140 m_isDelayingLoadEvent = false; 151 m_isDelayingLoadEvent = false;
141 document().decrementLoadEventDelayCount(); 152 document().decrementLoadEventDelayCount();
142 } 153 }
143 } 154 }
144 155
145 void HTMLPlugInElement::detach(const AttachContext& context) 156 void HTMLPlugInElement::detach(const AttachContext& context)
146 { 157 {
158 if (context.performingReattach && renderEmbeddedObject())
159 m_protectWidgetDuringReattach = pluginWidget();
160
147 // Update the widget the next time we attach (detaching destroys the plugin) . 161 // Update the widget the next time we attach (detaching destroys the plugin) .
148 // FIXME: None of this "needsWidgetUpdate" related code looks right. 162 // FIXME: None of this "needsWidgetUpdate" related code looks right.
149 if (renderer() && !useFallbackContent()) 163 if (renderer() && !useFallbackContent())
150 setNeedsWidgetUpdate(true); 164 setNeedsWidgetUpdate(true);
151 if (m_isDelayingLoadEvent) { 165 if (m_isDelayingLoadEvent) {
152 m_isDelayingLoadEvent = false; 166 m_isDelayingLoadEvent = false;
153 document().decrementLoadEventDelayCount(); 167 document().decrementLoadEventDelayCount();
154 } 168 }
155 169
156 resetInstance(); 170 resetInstance();
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 if (root.isOldestAuthorShadowRoot()) 539 if (root.isOldestAuthorShadowRoot())
526 lazyReattachIfAttached(); 540 lazyReattachIfAttached();
527 } 541 }
528 542
529 bool HTMLPlugInElement::useFallbackContent() const 543 bool HTMLPlugInElement::useFallbackContent() const
530 { 544 {
531 return hasAuthorShadowRoot(); 545 return hasAuthorShadowRoot();
532 } 546 }
533 547
534 } 548 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698