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

Side by Side Diff: content/renderer/pepper/pepper_plugin_delegate_impl.cc

Issue 11414180: Add a gyp flag to allow removing dependency on ppapi. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years 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 | Annotate | Revision Log
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/pepper/pepper_plugin_delegate_impl.h" 5 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <cstddef> 8 #include <cstddef>
9 #include <map> 9 #include <map>
10 #include <queue> 10 #include <queue>
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 76 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
77 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" 77 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
78 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" 78 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h"
79 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" 79 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h"
80 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" 80 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
81 #include "ui/gfx/size.h" 81 #include "ui/gfx/size.h"
82 #include "webkit/fileapi/file_system_callback_dispatcher.h" 82 #include "webkit/fileapi/file_system_callback_dispatcher.h"
83 #include "webkit/plugins/npapi/webplugin.h" 83 #include "webkit/plugins/npapi/webplugin.h"
84 #include "webkit/plugins/ppapi/plugin_module.h" 84 #include "webkit/plugins/ppapi/plugin_module.h"
85 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" 85 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
86 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h"
86 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" 87 #include "webkit/plugins/ppapi/ppb_file_io_impl.h"
87 #include "webkit/plugins/ppapi/ppb_flash_impl.h" 88 #include "webkit/plugins/ppapi/ppb_flash_impl.h"
88 #include "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h" 89 #include "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h"
89 #include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h" 90 #include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h"
90 #include "webkit/plugins/ppapi/ppb_udp_socket_private_impl.h" 91 #include "webkit/plugins/ppapi/ppb_udp_socket_private_impl.h"
91 #include "webkit/plugins/ppapi/resource_helper.h" 92 #include "webkit/plugins/ppapi/resource_helper.h"
92 #include "webkit/plugins/webplugininfo.h" 93 #include "webkit/plugins/webplugininfo.h"
93 94
94 using WebKit::WebView; 95 using WebKit::WebView;
95 using WebKit::WebFrame; 96 using WebKit::WebFrame;
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 focused_plugin_(NULL), 329 focused_plugin_(NULL),
329 last_mouse_event_target_(NULL), 330 last_mouse_event_target_(NULL),
330 device_enumeration_event_handler_( 331 device_enumeration_event_handler_(
331 new PepperDeviceEnumerationEventHandler()) { 332 new PepperDeviceEnumerationEventHandler()) {
332 } 333 }
333 334
334 PepperPluginDelegateImpl::~PepperPluginDelegateImpl() { 335 PepperPluginDelegateImpl::~PepperPluginDelegateImpl() {
335 DCHECK(mouse_lock_instances_.empty()); 336 DCHECK(mouse_lock_instances_.empty());
336 } 337 }
337 338
339 WebKit::WebPlugin* PepperPluginDelegateImpl::CreatePepperWebPlugin(
340 const webkit::WebPluginInfo& webplugin_info,
341 const WebKit::WebPluginParams& params) {
342 bool pepper_plugin_was_registered = false;
343 scoped_refptr<webkit::ppapi::PluginModule> pepper_module(
344 CreatePepperPluginModule(webplugin_info, &pepper_plugin_was_registered));
345
346 if (pepper_plugin_was_registered) {
347 if (!pepper_module)
348 return NULL;
349 return new webkit::ppapi::WebPluginImpl(
350 pepper_module.get(), params, AsWeakPtr());
351 }
352
353 return NULL;
354 }
355
338 scoped_refptr<webkit::ppapi::PluginModule> 356 scoped_refptr<webkit::ppapi::PluginModule>
339 PepperPluginDelegateImpl::CreatePepperPluginModule( 357 PepperPluginDelegateImpl::CreatePepperPluginModule(
340 const webkit::WebPluginInfo& webplugin_info, 358 const webkit::WebPluginInfo& webplugin_info,
341 bool* pepper_plugin_was_registered) { 359 bool* pepper_plugin_was_registered) {
342 *pepper_plugin_was_registered = true; 360 *pepper_plugin_was_registered = true;
343 361
344 // See if a module has already been loaded for this plugin. 362 // See if a module has already been loaded for this plugin.
345 FilePath path(webplugin_info.path); 363 FilePath path(webplugin_info.path);
346 scoped_refptr<webkit::ppapi::PluginModule> module = 364 scoped_refptr<webkit::ppapi::PluginModule> module =
347 PepperPluginRegistry::GetInstance()->GetLiveModule(path); 365 PepperPluginRegistry::GetInstance()->GetLiveModule(path);
(...skipping 1371 matching lines...) Expand 10 before | Expand all | Expand 10 after
1719 RenderWidgetFullscreenPepper* container = 1737 RenderWidgetFullscreenPepper* container =
1720 static_cast<RenderWidgetFullscreenPepper*>( 1738 static_cast<RenderWidgetFullscreenPepper*>(
1721 instance->fullscreen_container()); 1739 instance->fullscreen_container());
1722 return container->mouse_lock_dispatcher(); 1740 return container->mouse_lock_dispatcher();
1723 } else { 1741 } else {
1724 return render_view_->mouse_lock_dispatcher(); 1742 return render_view_->mouse_lock_dispatcher();
1725 } 1743 }
1726 } 1744 }
1727 1745
1728 } // namespace content 1746 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_plugin_delegate_impl.h ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698