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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 1825253002: Revert of Remove a bunch of NPAPI quirks and related support code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_windowed_plugins
Patch Set: 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
Index: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index e82b468025efa6425558b01da6c7a507610983ed..ea3303956971c3c5fe4ddd97a101d55598ba3167 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -469,6 +469,12 @@
IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionChanged, OnSelectionChanged)
IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionBoundsChanged,
OnSelectionBoundsChanged)
+#if defined(OS_WIN)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_WindowlessPluginDummyWindowCreated,
+ OnWindowlessPluginDummyWindowCreated)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_WindowlessPluginDummyWindowDestroyed,
+ OnWindowlessPluginDummyWindowDestroyed)
+#endif
IPC_MESSAGE_HANDLER(InputHostMsg_ImeCompositionRangeChanged,
OnImeCompositionRangeChanged)
IPC_MESSAGE_HANDLER(ViewHostMsg_DidFirstPaintAfterLoad,
@@ -1812,6 +1818,43 @@
Send(new ViewMsg_ReleaseDisambiguationPopupBitmap(GetRoutingID(), id));
}
+#if defined(OS_WIN)
+void RenderWidgetHostImpl::OnWindowlessPluginDummyWindowCreated(
+ gfx::NativeViewId dummy_activation_window) {
+ HWND hwnd = reinterpret_cast<HWND>(dummy_activation_window);
+
+ // This may happen as a result of a race condition when the plugin is going
+ // away.
+ wchar_t window_title[MAX_PATH + 1] = {0};
+ if (!IsWindow(hwnd) ||
+ !GetWindowText(hwnd, window_title, arraysize(window_title)) ||
+ lstrcmpiW(window_title, kDummyActivationWindowName) != 0) {
+ return;
+ }
+
+#if defined(USE_AURA)
+ SetParent(hwnd,
+ reinterpret_cast<HWND>(view_->GetParentForWindowlessPlugin()));
+#else
+ SetParent(hwnd, reinterpret_cast<HWND>(GetNativeViewId()));
+#endif
+ dummy_windows_for_activation_.push_back(hwnd);
+}
+
+void RenderWidgetHostImpl::OnWindowlessPluginDummyWindowDestroyed(
+ gfx::NativeViewId dummy_activation_window) {
+ HWND hwnd = reinterpret_cast<HWND>(dummy_activation_window);
+ std::list<HWND>::iterator i = dummy_windows_for_activation_.begin();
+ for (; i != dummy_windows_for_activation_.end(); ++i) {
+ if ((*i) == hwnd) {
+ dummy_windows_for_activation_.erase(i);
+ return;
+ }
+ }
+ NOTREACHED() << "Unknown dummy window";
+}
+#endif
+
void RenderWidgetHostImpl::SetIgnoreInputEvents(bool ignore_input_events) {
ignore_input_events_ = ignore_input_events;
}
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | content/browser/renderer_host/render_widget_host_view_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698