Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / renderer / pepper / pepper_helper.cc
blobef78454b8f54e7c7caf26575d773585ef84768d0
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.
5 #include "chrome/renderer/pepper/pepper_helper.h"
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"
12 PepperHelper::PepperHelper(content::RenderFrame* render_frame)
13 : RenderFrameObserver(render_frame) {
16 PepperHelper::~PepperHelper() {
19 void 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)));