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

Unified Diff: content/renderer/render_view_impl.cc

Issue 1853793003: Remove content/renderer/npapi (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 164f77f1edd3b7df7a5279097b36a4144bc92290..3f575ac768f4d024840e466ca2575a406b409f73 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -198,7 +198,6 @@
#endif
#if defined(ENABLE_PLUGINS)
-#include "content/renderer/npapi/webplugin_delegate_proxy.h"
#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
#include "content/renderer/pepper/pepper_plugin_registry.h"
#endif
@@ -1189,32 +1188,7 @@ void RenderViewImpl::PepperFocusChanged(PepperPluginInstanceImpl* instance,
UpdateSelectionBounds();
}
-void RenderViewImpl::RegisterPluginDelegate(WebPluginDelegateProxy* delegate) {
- plugin_delegates_.insert(delegate);
- // If the renderer is visible, set initial visibility and focus state.
- if (!is_hidden()) {
#if defined(OS_MACOSX)
- delegate->SetContainerVisibility(true);
- if (webview() && webview()->isActive())
- delegate->SetWindowFocus(true);
-#endif
- }
- // Plugins start assuming the content has focus (so that they work in
- // environments where RenderView isn't hosting them), so we always have to
- // set the initial state. See webplugin_delegate_impl.h for details.
- delegate->SetContentAreaFocus(has_focus());
-}
-
-void RenderViewImpl::UnregisterPluginDelegate(
- WebPluginDelegateProxy* delegate) {
- plugin_delegates_.erase(delegate);
-}
-
-#if defined(OS_MACOSX)
-void RenderViewImpl::PluginFocusChanged(bool focused, int plugin_id) {
- Send(new ViewHostMsg_PluginFocusChanged(GetRoutingID(), focused, plugin_id));
-}
-
void RenderViewImpl::OnGetRenderedText() {
if (!webview())
return;
@@ -1238,14 +1212,6 @@ void RenderViewImpl::OnGetRenderedText() {
Send(new ViewMsg_GetRenderedTextCompleted(GetRoutingID(), text));
}
-
-void RenderViewImpl::StartPluginIme() {
- IPC::Message* msg = new ViewHostMsg_StartPluginIme(GetRoutingID());
- // This message can be sent during event-handling, and needs to be delivered
- // within that context.
- msg->set_unblock(true);
- Send(msg);
-}
#endif // defined(OS_MACOSX)
#endif // ENABLE_PLUGINS
@@ -1390,11 +1356,7 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
#elif defined(OS_MACOSX)
IPC_MESSAGE_HANDLER(ViewMsg_GetRenderedText,
OnGetRenderedText)
- IPC_MESSAGE_HANDLER(ViewMsg_PluginImeCompositionCompleted,
- OnPluginImeCompositionCompleted)
IPC_MESSAGE_HANDLER(ViewMsg_Close, OnClose)
- IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility)
- IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged)
#endif
// Adding a new message? Add platform independent ones first, then put the
// platform specific ones at the end.
@@ -2738,52 +2700,8 @@ void RenderViewImpl::OnSetBackgroundOpaque(bool opaque) {
void RenderViewImpl::OnSetActive(bool active) {
if (webview())
webview()->setIsActive(active);
-
-#if defined(ENABLE_PLUGINS) && defined(OS_MACOSX)
- std::set<WebPluginDelegateProxy*>::iterator plugin_it;
- for (plugin_it = plugin_delegates_.begin();
- plugin_it != plugin_delegates_.end(); ++plugin_it) {
- (*plugin_it)->SetWindowFocus(active);
- }
-#endif
-}
-
-#if defined(OS_MACOSX)
-void RenderViewImpl::OnSetWindowVisibility(bool visible) {
-#if defined(ENABLE_PLUGINS)
- // Inform plugins that their container has changed visibility.
- std::set<WebPluginDelegateProxy*>::iterator plugin_it;
- for (plugin_it = plugin_delegates_.begin();
- plugin_it != plugin_delegates_.end(); ++plugin_it) {
- (*plugin_it)->SetContainerVisibility(visible);
- }
-#endif
-}
-
-void RenderViewImpl::OnWindowFrameChanged(const gfx::Rect& window_frame,
- const gfx::Rect& view_frame) {
-#if defined(ENABLE_PLUGINS)
- // Inform plugins that their window's frame has changed.
- std::set<WebPluginDelegateProxy*>::iterator plugin_it;
- for (plugin_it = plugin_delegates_.begin();
- plugin_it != plugin_delegates_.end(); ++plugin_it) {
- (*plugin_it)->WindowFrameChanged(window_frame, view_frame);
- }
-#endif
}
-void RenderViewImpl::OnPluginImeCompositionCompleted(const base::string16& text,
- int plugin_id) {
- // WebPluginDelegateProxy is responsible for figuring out if this event
- // applies to it or not, so inform all the delegates.
- std::set<WebPluginDelegateProxy*>::iterator plugin_it;
- for (plugin_it = plugin_delegates_.begin();
- plugin_it != plugin_delegates_.end(); ++plugin_it) {
- (*plugin_it)->ImeCompositionCompleted(text, plugin_id);
- }
-}
-#endif // OS_MACOSX
-
void RenderViewImpl::CloseForFrame() {
DCHECK(frame_widget_);
frame_widget_->close();
@@ -2816,15 +2734,6 @@ void RenderViewImpl::OnWasHidden() {
for (PepperPluginSet::iterator i = active_pepper_instances_.begin();
i != active_pepper_instances_.end(); ++i)
(*i)->PageVisibilityChanged(false);
-
-#if defined(OS_MACOSX)
- // Inform NPAPI plugins that their container is no longer visible.
- std::set<WebPluginDelegateProxy*>::iterator plugin_it;
- for (plugin_it = plugin_delegates_.begin();
- plugin_it != plugin_delegates_.end(); ++plugin_it) {
- (*plugin_it)->SetContainerVisibility(false);
- }
-#endif // OS_MACOSX
#endif // ENABLE_PLUGINS
}
@@ -2844,15 +2753,6 @@ void RenderViewImpl::OnWasShown(bool needs_repainting,
for (PepperPluginSet::iterator i = active_pepper_instances_.begin();
i != active_pepper_instances_.end(); ++i)
(*i)->PageVisibilityChanged(true);
-
-#if defined(OS_MACOSX)
- // Inform NPAPI plugins that their container is now visible.
- std::set<WebPluginDelegateProxy*>::iterator plugin_it;
- for (plugin_it = plugin_delegates_.begin();
- plugin_it != plugin_delegates_.end(); ++plugin_it) {
- (*plugin_it)->SetContainerVisibility(true);
- }
-#endif // OS_MACOSX
#endif // ENABLE_PLUGINS
}
@@ -2876,20 +2776,6 @@ void RenderViewImpl::SetFocus(bool enable) {
RenderWidget::OnSetFocus(enable);
#if defined(ENABLE_PLUGINS)
- if (webview() && webview()->isActive()) {
- // Notify all NPAPI plugins.
- std::set<WebPluginDelegateProxy*>::iterator plugin_it;
- for (plugin_it = plugin_delegates_.begin();
- plugin_it != plugin_delegates_.end(); ++plugin_it) {
-#if defined(OS_MACOSX)
- // RenderWidget's call to setFocus can cause the underlying webview's
- // activation state to change just like a call to setIsActive.
- if (enable)
- (*plugin_it)->SetWindowFocus(true);
-#endif
- (*plugin_it)->SetContentAreaFocus(enable);
- }
- }
// Notify all Pepper plugins.
for (PepperPluginSet::iterator i = active_pepper_instances_.begin();
i != active_pepper_instances_.end(); ++i)
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698