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

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

Issue 2814643003: Remove FrameViewBase as base class of PluginView. (Closed)
Patch Set: fix unused var Created 3 years, 8 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) 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 HTMLFrameOwnerElement::Trace(visitor); 97 HTMLFrameOwnerElement::Trace(visitor);
98 } 98 }
99 99
100 void HTMLPlugInElement::SetPlugin(PluginView* plugin) { 100 void HTMLPlugInElement::SetPlugin(PluginView* plugin) {
101 if (plugin == plugin_) 101 if (plugin == plugin_)
102 return; 102 return;
103 103
104 // Remove and dispose the old plugin if we had one. 104 // Remove and dispose the old plugin if we had one.
105 if (plugin_) { 105 if (plugin_) {
106 GetDocument().View()->RemovePlugin(plugin_); 106 GetDocument().View()->RemovePlugin(plugin_);
107 DisposeWidgetSoon(plugin_); 107 DisposeSoon(plugin_);
108 } 108 }
109 plugin_ = plugin; 109 plugin_ = plugin;
110 110
111 // TODO(joelhockey): I copied the rest of this method from 111 // TODO(joelhockey): I copied the rest of this method from
112 // HTMLFrameOwnerElement. There may be parts that can be removed 112 // HTMLFrameOwnerElement. There may be parts that can be removed
113 // such as the layoutPartItem.isNull check and DCHECKs. 113 // such as the layoutPartItem.isNull check and DCHECKs.
114 // Once widget tree is removed (FrameView::m_children), try to unify 114 // Once widget tree is removed (FrameView::m_children), try to unify
115 // this code with HTMLFrameOwnerElement::setWidget. 115 // this code with HTMLFrameOwnerElement::setWidget.
116 LayoutPart* layout_part = ToLayoutPart(GetLayoutObject()); 116 LayoutPart* layout_part = ToLayoutPart(GetLayoutObject());
117 LayoutPartItem layout_part_item = LayoutPartItem(layout_part); 117 LayoutPartItem layout_part_item = LayoutPartItem(layout_part);
(...skipping 25 matching lines...) Expand all
143 cache->ChildrenChanged(layout_part); 143 cache->ChildrenChanged(layout_part);
144 } 144 }
145 return plugin_.Release(); 145 return plugin_.Release();
146 } 146 }
147 147
148 void HTMLPlugInElement::SetPersistedPlugin(PluginView* plugin) { 148 void HTMLPlugInElement::SetPersistedPlugin(PluginView* plugin) {
149 if (persisted_plugin_ == plugin) 149 if (persisted_plugin_ == plugin)
150 return; 150 return;
151 if (persisted_plugin_) { 151 if (persisted_plugin_) {
152 persisted_plugin_->Hide(); 152 persisted_plugin_->Hide();
153 DisposeWidgetSoon(persisted_plugin_.Release()); 153 DisposeSoon(persisted_plugin_.Release());
154 } 154 }
155 persisted_plugin_ = plugin; 155 persisted_plugin_ = plugin;
156 } 156 }
157 157
158 bool HTMLPlugInElement::RequestObjectInternal( 158 bool HTMLPlugInElement::RequestObjectInternal(
159 const String& url, 159 const String& url,
160 const String& mime_type, 160 const String& mime_type,
161 const Vector<String>& param_names, 161 const Vector<String>& param_names,
162 const Vector<String>& param_values) { 162 const Vector<String>& param_values) {
163 if (url.IsEmpty() && mime_type.IsEmpty()) 163 if (url.IsEmpty() && mime_type.IsEmpty())
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 699
700 void HTMLPlugInElement::LazyReattachIfNeeded() { 700 void HTMLPlugInElement::LazyReattachIfNeeded() {
701 if (!UseFallbackContent() && NeedsPluginUpdate() && GetLayoutObject() && 701 if (!UseFallbackContent() && NeedsPluginUpdate() && GetLayoutObject() &&
702 !IsImageType()) { 702 !IsImageType()) {
703 LazyReattachIfAttached(); 703 LazyReattachIfAttached();
704 SetPersistedPlugin(nullptr); 704 SetPersistedPlugin(nullptr);
705 } 705 }
706 } 706 }
707 707
708 } // namespace blink 708 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698