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 3 // found in the LICENSE file. 4 5 #include "chrome/renderer/pepper/pepper_helper.h" 6 7 #include "chrome/renderer/pepper/chrome_renderer_pepper_host_factory.h" 8 #include "chrome/renderer/pepper/pepper_shared_memory_message_filter.h" 9 #include "content/public/renderer/renderer_ppapi_host.h" 10 #include "ppapi/host/ppapi_host.h" 11 PepperHelper(content::RenderFrame * render_frame)12PepperHelper::PepperHelper(content::RenderFrame* render_frame) 13 : RenderFrameObserver(render_frame) { 14 } 15 ~PepperHelper()16PepperHelper::~PepperHelper() { 17 } 18 DidCreatePepperPlugin(content::RendererPpapiHost * host)19void PepperHelper::DidCreatePepperPlugin(content::RendererPpapiHost* host) { 20 // TODO(brettw) figure out how to hook up the host factory. It needs some 21 // kind of filter-like system to allow dynamic additions. 22 host->GetPpapiHost()->AddHostFactoryFilter( 23 scoped_ptr<ppapi::host::HostFactory>( 24 new ChromeRendererPepperHostFactory(host))); 25 host->GetPpapiHost()->AddInstanceMessageFilter( 26 scoped_ptr<ppapi::host::InstanceMessageFilter>( 27 new PepperSharedMemoryMessageFilter(host))); 28 } 29