| OLD | NEW |
| 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/browser/renderer_host/pepper/content_browser_pepper_host_facto
ry.h" | 5 #include "content/browser/renderer_host/pepper/content_browser_pepper_host_facto
ry.h" |
| 6 | 6 |
| 7 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h" | 7 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h" |
| 8 #include "content/browser/renderer_host/pepper/pepper_browser_font_singleton_hos
t.h" | 8 #include "content/browser/renderer_host/pepper/pepper_browser_font_singleton_hos
t.h" |
| 9 #include "content/browser/renderer_host/pepper/pepper_flash_file_message_filter.
h" | 9 #include "content/browser/renderer_host/pepper/pepper_flash_file_message_filter.
h" |
| 10 #include "content/browser/renderer_host/pepper/pepper_gamepad_host.h" | 10 #include "content/browser/renderer_host/pepper/pepper_gamepad_host.h" |
| 11 #include "content/browser/renderer_host/pepper/pepper_print_settings_manager.h" | 11 #include "content/browser/renderer_host/pepper/pepper_print_settings_manager.h" |
| 12 #include "content/browser/renderer_host/pepper/pepper_printing_host.h" | 12 #include "content/browser/renderer_host/pepper/pepper_printing_host.h" |
| 13 #include "content/browser/renderer_host/pepper/pepper_udp_socket_private_host.h" |
| 13 #include "ppapi/host/message_filter_host.h" | 14 #include "ppapi/host/message_filter_host.h" |
| 14 #include "ppapi/host/ppapi_host.h" | 15 #include "ppapi/host/ppapi_host.h" |
| 15 #include "ppapi/host/resource_host.h" | 16 #include "ppapi/host/resource_host.h" |
| 16 #include "ppapi/proxy/ppapi_messages.h" | 17 #include "ppapi/proxy/ppapi_messages.h" |
| 17 #include "ppapi/shared_impl/ppapi_permissions.h" | 18 #include "ppapi/shared_impl/ppapi_permissions.h" |
| 18 | 19 |
| 19 using ppapi::host::MessageFilterHost; | 20 using ppapi::host::MessageFilterHost; |
| 20 using ppapi::host::ResourceHost; | 21 using ppapi::host::ResourceHost; |
| 21 using ppapi::host::ResourceMessageFilter; | 22 using ppapi::host::ResourceMessageFilter; |
| 22 | 23 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 41 if (!host_->IsValidInstance(instance)) | 42 if (!host_->IsValidInstance(instance)) |
| 42 return scoped_ptr<ResourceHost>(); | 43 return scoped_ptr<ResourceHost>(); |
| 43 | 44 |
| 44 // Public interfaces. | 45 // Public interfaces. |
| 45 switch (message.type()) { | 46 switch (message.type()) { |
| 46 case PpapiHostMsg_Gamepad_Create::ID: | 47 case PpapiHostMsg_Gamepad_Create::ID: |
| 47 return scoped_ptr<ResourceHost>(new PepperGamepadHost( | 48 return scoped_ptr<ResourceHost>(new PepperGamepadHost( |
| 48 host_, instance, params.pp_resource())); | 49 host_, instance, params.pp_resource())); |
| 49 } | 50 } |
| 50 | 51 |
| 52 // Private interfaces. |
| 53 if (host_->GetPpapiHost()->permissions().HasPermission( |
| 54 ppapi::PERMISSION_PRIVATE) || |
| 55 message.type() == PpapiHostMsg_UDPSocketPrivate_Create::ID) { |
| 56 switch (message.type()) { |
| 57 case PpapiHostMsg_UDPSocketPrivate_Create::ID: |
| 58 return scoped_ptr<ResourceHost>(new PepperUDPSocketPrivateHost( |
| 59 host_, instance, params.pp_resource())); |
| 60 } |
| 61 } |
| 62 |
| 51 // Dev interfaces. | 63 // Dev interfaces. |
| 52 if (GetPermissions().HasPermission(ppapi::PERMISSION_DEV)) { | 64 if (GetPermissions().HasPermission(ppapi::PERMISSION_DEV)) { |
| 53 switch (message.type()) { | 65 switch (message.type()) { |
| 54 case PpapiHostMsg_Printing_Create::ID: { | 66 case PpapiHostMsg_Printing_Create::ID: { |
| 55 scoped_ptr<PepperPrintSettingsManager> manager( | 67 scoped_ptr<PepperPrintSettingsManager> manager( |
| 56 new PepperPrintSettingsManagerImpl()); | 68 new PepperPrintSettingsManagerImpl()); |
| 57 return scoped_ptr<ResourceHost>(new PepperPrintingHost( | 69 return scoped_ptr<ResourceHost>(new PepperPrintingHost( |
| 58 host_->GetPpapiHost(), instance, | 70 host_->GetPpapiHost(), instance, |
| 59 params.pp_resource(), manager.Pass())); | 71 params.pp_resource(), manager.Pass())); |
| 60 } | 72 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 85 | 97 |
| 86 return scoped_ptr<ResourceHost>(); | 98 return scoped_ptr<ResourceHost>(); |
| 87 } | 99 } |
| 88 | 100 |
| 89 const ppapi::PpapiPermissions& | 101 const ppapi::PpapiPermissions& |
| 90 ContentBrowserPepperHostFactory::GetPermissions() const { | 102 ContentBrowserPepperHostFactory::GetPermissions() const { |
| 91 return host_->GetPpapiHost()->permissions(); | 103 return host_->GetPpapiHost()->permissions(); |
| 92 } | 104 } |
| 93 | 105 |
| 94 } // namespace content | 106 } // namespace content |
| OLD | NEW |