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

Unified Diff: content/renderer/npapi/webplugin_impl.cc

Issue 1815593002: Remove windowed NPAPI code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@make_test_plugin_windowless
Patch Set: rebase Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/npapi/webplugin_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/npapi/webplugin_impl.cc
diff --git a/content/renderer/npapi/webplugin_impl.cc b/content/renderer/npapi/webplugin_impl.cc
index 52192834caf38db1a786449c4431804a5034175e..000fbecde6e8854819b44a0429be9137369ac4de 100644
--- a/content/renderer/npapi/webplugin_impl.cc
+++ b/content/renderer/npapi/webplugin_impl.cc
@@ -192,7 +192,6 @@ void WebPluginImpl::updateGeometry(const WebRect& window_rect,
const WebVector<WebRect>& cut_outs_rects,
bool is_visible) {
WebPluginGeometry new_geometry;
- new_geometry.window = window_;
new_geometry.window_rect = window_rect;
new_geometry.clip_rect = clip_rect;
new_geometry.visible = is_visible;
@@ -200,18 +199,6 @@ void WebPluginImpl::updateGeometry(const WebRect& window_rect,
for (size_t i = 0; i < cut_outs_rects.size(); ++i)
new_geometry.cutout_rects.push_back(cut_outs_rects[i]);
- // Only send DidMovePlugin if the geometry changed in some way.
- if (window_ && (first_geometry_update_ || !new_geometry.Equals(geometry_))) {
- render_frame_->GetRenderWidget()->SchedulePluginMove(new_geometry);
- // We invalidate windowed plugins during the first geometry update to
- // ensure that they get reparented to the wrapper window in the browser.
- // This ensures that they become visible and are painted by the OS. This is
- // required as some pages don't invalidate when the plugin is added.
- if (first_geometry_update_ && window_) {
- InvalidateRect(window_rect);
- }
- }
-
// Only UpdateGeometry if either the window or clip rects have changed.
if (delegate_ && (first_geometry_update_ ||
new_geometry.window_rect != geometry_.window_rect ||
@@ -238,26 +225,14 @@ void WebPluginImpl::updateGeometry(const WebRect& window_rect,
}
void WebPluginImpl::updateFocus(bool focused, blink::WebFocusType focus_type) {
- if (accepts_input_events_)
- delegate_->SetFocus(focused);
+ delegate_->SetFocus(focused);
}
void WebPluginImpl::updateVisibility(bool visible) {
- if (!window_)
- return;
-
- WebPluginGeometry move;
- move.window = window_;
- move.window_rect = gfx::Rect();
- move.clip_rect = gfx::Rect();
- move.rects_valid = false;
- move.visible = visible;
-
- render_frame_->GetRenderWidget()->SchedulePluginMove(move);
}
bool WebPluginImpl::acceptsInputEvents() {
- return accepts_input_events_;
+ return true;
}
WebInputEventResult WebPluginImpl::handleInputEvent(
@@ -292,10 +267,7 @@ WebPluginImpl::WebPluginImpl(
const base::FilePath& file_path,
const base::WeakPtr<RenderViewImpl>& render_view,
RenderFrameImpl* render_frame)
- : windowless_(false),
- window_(gfx::kNullPluginWindow),
- accepts_input_events_(false),
- render_frame_(render_frame),
+ : render_frame_(render_frame),
render_view_(render_view),
webframe_(webframe),
delegate_(NULL),
@@ -322,41 +294,6 @@ WebPluginImpl::WebPluginImpl(
WebPluginImpl::~WebPluginImpl() {
}
-void WebPluginImpl::SetWindow(gfx::PluginWindowHandle window) {
- if (window) {
- DCHECK(!windowless_);
- window_ = window;
-#if defined(OS_MACOSX)
- // TODO(kbr): remove. http://crbug.com/105344
-
- // Lie to ourselves about being windowless even if we got a fake
- // plugin window handle, so we continue to get input events.
- windowless_ = true;
- accepts_input_events_ = true;
- // We do not really need to notify the page delegate that a plugin
- // window was created -- so don't.
-#else
- accepts_input_events_ = false;
-
-#endif // OS_MACOSX
- } else {
- DCHECK(!window_); // Make sure not called twice.
- windowless_ = true;
- accepts_input_events_ = true;
- }
-}
-
-void WebPluginImpl::SetAcceptsInputEvents(bool accepts) {
- accepts_input_events_ = accepts;
-}
-
-void WebPluginImpl::WillDestroyWindow(gfx::PluginWindowHandle window) {
- DCHECK_EQ(window, window_);
- window_ = gfx::kNullPluginWindow;
- if (render_view_.get())
- render_frame_->GetRenderWidget()->CleanupWindowInPluginMoves(window);
-}
-
GURL WebPluginImpl::CompleteURL(const char* url) {
if (!webframe_) {
NOTREACHED();
« no previous file with comments | « content/renderer/npapi/webplugin_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698