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

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

Issue 11366038: Rewrite PPB_AudioInput_Dev to use the new-style host/resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 1 month 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/content_renderer_pepper_host_factory.h" 5 #include "content/renderer/pepper/content_renderer_pepper_host_factory.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/renderer/pepper/pepper_audio_input_host.h"
8 #include "content/renderer/pepper/pepper_file_chooser_host.h" 9 #include "content/renderer/pepper/pepper_file_chooser_host.h"
9 #include "content/renderer/pepper/pepper_flash_clipboard_host.h" 10 #include "content/renderer/pepper/pepper_flash_clipboard_host.h"
10 #include "content/renderer/pepper/pepper_flash_host.h" 11 #include "content/renderer/pepper/pepper_flash_host.h"
11 #include "content/renderer/pepper/pepper_websocket_host.h" 12 #include "content/renderer/pepper/pepper_websocket_host.h"
12 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" 13 #include "content/renderer/pepper/renderer_ppapi_host_impl.h"
13 #include "ppapi/host/resource_host.h" 14 #include "ppapi/host/resource_host.h"
14 #include "ppapi/proxy/ppapi_messages.h" 15 #include "ppapi/proxy/ppapi_messages.h"
15 16
16 using ppapi::host::ResourceHost; 17 using ppapi::host::ResourceHost;
17 18
(...skipping 27 matching lines...) Expand all
45 46
46 // Resources for dev interfaces. 47 // Resources for dev interfaces.
47 // TODO(brettw) when we support any public or private interfaces, put them in 48 // TODO(brettw) when we support any public or private interfaces, put them in
48 // a separate switch above. 49 // a separate switch above.
49 50
50 // TODO(brettw) put back this dev check! This was removed to fix issue 138902 51 // TODO(brettw) put back this dev check! This was removed to fix issue 138902
51 // where the permissions for bundled Flash (but not Flash that you specify 52 // where the permissions for bundled Flash (but not Flash that you specify
52 // on the command line, making it difficult to test) are incorrect. 53 // on the command line, making it difficult to test) are incorrect.
53 /*if (GetPermissions().HasPermission(ppapi::PERMISSION_DEV))*/ { 54 /*if (GetPermissions().HasPermission(ppapi::PERMISSION_DEV))*/ {
54 switch (message.type()) { 55 switch (message.type()) {
56 case PpapiHostMsg_AudioInput_Create::ID:
57 return scoped_ptr<ResourceHost>(new PepperAudioInputHost(
58 host_, instance, params.pp_resource()));
55 case PpapiHostMsg_FileChooser_Create::ID: 59 case PpapiHostMsg_FileChooser_Create::ID:
56 return scoped_ptr<ResourceHost>(new PepperFileChooserHost( 60 return scoped_ptr<ResourceHost>(new PepperFileChooserHost(
57 host_, instance, params.pp_resource())); 61 host_, instance, params.pp_resource()));
58 } 62 }
59 } 63 }
60 64
61 // Resources for Flash interfaces. 65 // Resources for Flash interfaces.
62 if (GetPermissions().HasPermission(ppapi::PERMISSION_FLASH)) { 66 if (GetPermissions().HasPermission(ppapi::PERMISSION_FLASH)) {
63 switch (message.type()) { 67 switch (message.type()) {
64 case PpapiHostMsg_Flash_Create::ID: 68 case PpapiHostMsg_Flash_Create::ID:
65 return scoped_ptr<ResourceHost>(new PepperFlashHost( 69 return scoped_ptr<ResourceHost>(new PepperFlashHost(
66 host_, instance, params.pp_resource())); 70 host_, instance, params.pp_resource()));
67 case PpapiHostMsg_FlashClipboard_Create::ID: 71 case PpapiHostMsg_FlashClipboard_Create::ID:
68 return scoped_ptr<ResourceHost>(new PepperFlashClipboardHost( 72 return scoped_ptr<ResourceHost>(new PepperFlashClipboardHost(
69 host_, instance, params.pp_resource())); 73 host_, instance, params.pp_resource()));
70 } 74 }
71 } 75 }
72 76
73 return scoped_ptr<ResourceHost>(); 77 return scoped_ptr<ResourceHost>();
74 } 78 }
75 79
76 const ppapi::PpapiPermissions& 80 const ppapi::PpapiPermissions&
77 ContentRendererPepperHostFactory::GetPermissions() const { 81 ContentRendererPepperHostFactory::GetPermissions() const {
78 return host_->GetPpapiHost()->permissions(); 82 return host_->GetPpapiHost()->permissions();
79 } 83 }
80 84
81 } // namespace content 85 } // namespace content
OLDNEW
« no previous file with comments | « content/public/renderer/renderer_ppapi_host.h ('k') | content/renderer/pepper/mock_renderer_ppapi_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698