Home | History | Annotate | Download | only in pepper
      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 
     12 namespace chrome {
     13 
     14 PepperHelper::PepperHelper(content::RenderView* render_view)
     15     : RenderViewObserver(render_view) {
     16 }
     17 
     18 PepperHelper::~PepperHelper() {
     19 }
     20 
     21 void PepperHelper::DidCreatePepperPlugin(content::RendererPpapiHost* host) {
     22   // TODO(brettw) figure out how to hook up the host factory. It needs some
     23   // kind of filter-like system to allow dynamic additions.
     24   host->GetPpapiHost()->AddHostFactoryFilter(
     25       scoped_ptr<ppapi::host::HostFactory>(
     26           new ChromeRendererPepperHostFactory(host)));
     27   host->GetPpapiHost()->AddInstanceMessageFilter(
     28       scoped_ptr<ppapi::host::InstanceMessageFilter>(
     29           new PepperSharedMemoryMessageFilter(host)));
     30 }
     31 
     32 }  // namespace chrome
     33