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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 1117023002: Keep event page alive when there's some Pepper plugin on it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test. Created 5 years, 7 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 #elif defined(USE_X11) 197 #elif defined(USE_X11)
198 #include "ui/native_theme/native_theme.h" 198 #include "ui/native_theme/native_theme.h"
199 #elif defined(OS_MACOSX) 199 #elif defined(OS_MACOSX)
200 #include "skia/ext/skia_utils_mac.h" 200 #include "skia/ext/skia_utils_mac.h"
201 #endif 201 #endif
202 202
203 #if defined(ENABLE_PLUGINS) 203 #if defined(ENABLE_PLUGINS)
204 #include "content/renderer/npapi/webplugin_delegate_proxy.h" 204 #include "content/renderer/npapi/webplugin_delegate_proxy.h"
205 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" 205 #include "content/renderer/pepper/pepper_plugin_instance_impl.h"
206 #include "content/renderer/pepper/pepper_plugin_registry.h" 206 #include "content/renderer/pepper/pepper_plugin_registry.h"
207 #include "content/renderer/pepper/plugin_module.h"
bartfab (slow) 2015/05/18 09:57:41 Nit: Where are you using these new includes?
emaxx 2015/05/18 15:06:30 Done.
208 #include "content/renderer/pepper/renderer_ppapi_host_impl.h"
207 #endif 209 #endif
208 210
209 #if defined(ENABLE_WEBRTC) 211 #if defined(ENABLE_WEBRTC)
210 #include "content/renderer/media/rtc_peer_connection_handler.h" 212 #include "content/renderer/media/rtc_peer_connection_handler.h"
211 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" 213 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h"
212 #endif 214 #endif
213 215
214 using blink::WebAXObject; 216 using blink::WebAXObject;
215 using blink::WebApplicationCacheHost; 217 using blink::WebApplicationCacheHost;
216 using blink::WebApplicationCacheHostClient; 218 using blink::WebApplicationCacheHostClient;
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 } 1174 }
1173 1175
1174 blink::WebView* RenderViewImpl::webview() const { 1176 blink::WebView* RenderViewImpl::webview() const {
1175 return static_cast<blink::WebView*>(webwidget()); 1177 return static_cast<blink::WebView*>(webwidget());
1176 } 1178 }
1177 1179
1178 #if defined(ENABLE_PLUGINS) 1180 #if defined(ENABLE_PLUGINS)
1179 void RenderViewImpl::PepperInstanceCreated( 1181 void RenderViewImpl::PepperInstanceCreated(
1180 PepperPluginInstanceImpl* instance) { 1182 PepperPluginInstanceImpl* instance) {
1181 active_pepper_instances_.insert(instance); 1183 active_pepper_instances_.insert(instance);
1184 Send(new ViewHostMsg_PepperInstanceCreated(GetRoutingID()));
nasko 2015/05/11 16:24:09 This can be sent through the instance RenderFrame.
emaxx 2015/05/18 15:06:30 I'm not sure what did you mean. Now I've changed t
nasko 2015/05/19 14:11:45 This seems slightly incorrect. The PepperPluginIns
emaxx 2015/05/19 17:33:40 Done.
1182 } 1185 }
1183 1186
1184 void RenderViewImpl::PepperInstanceDeleted( 1187 void RenderViewImpl::PepperInstanceDeleted(
1185 PepperPluginInstanceImpl* instance) { 1188 PepperPluginInstanceImpl* instance) {
1186 active_pepper_instances_.erase(instance); 1189 active_pepper_instances_.erase(instance);
1187 1190
1188 if (pepper_last_mouse_event_target_ == instance) 1191 if (pepper_last_mouse_event_target_ == instance)
1189 pepper_last_mouse_event_target_ = NULL; 1192 pepper_last_mouse_event_target_ = NULL;
1190 if (focused_pepper_plugin_ == instance) 1193 if (focused_pepper_plugin_ == instance)
1191 PepperFocusChanged(instance, false); 1194 PepperFocusChanged(instance, false);
1195 Send(new ViewHostMsg_PepperInstanceDeleted(GetRoutingID()));
nasko 2015/05/11 16:24:09 Same as above.
emaxx 2015/05/18 15:06:29 Done.
1192 } 1196 }
1193 1197
1194 void RenderViewImpl::PepperFocusChanged(PepperPluginInstanceImpl* instance, 1198 void RenderViewImpl::PepperFocusChanged(PepperPluginInstanceImpl* instance,
1195 bool focused) { 1199 bool focused) {
1196 if (focused) 1200 if (focused)
1197 focused_pepper_plugin_ = instance; 1201 focused_pepper_plugin_ = instance;
1198 else if (focused_pepper_plugin_ == instance) 1202 else if (focused_pepper_plugin_ == instance)
1199 focused_pepper_plugin_ = NULL; 1203 focused_pepper_plugin_ = NULL;
1200 1204
1201 UpdateTextInputType(); 1205 UpdateTextInputType();
(...skipping 2567 matching lines...) Expand 10 before | Expand all | Expand 10 after
3769 std::vector<gfx::Size> sizes; 3773 std::vector<gfx::Size> sizes;
3770 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 3774 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
3771 if (!url.isEmpty()) 3775 if (!url.isEmpty())
3772 urls.push_back( 3776 urls.push_back(
3773 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 3777 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
3774 } 3778 }
3775 SendUpdateFaviconURL(urls); 3779 SendUpdateFaviconURL(urls);
3776 } 3780 }
3777 3781
3778 } // namespace content 3782 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698